Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,7 @@ endif
'$(NODE)' tools/license2rtf.mjs < LICENSE > \
$(MACOSOUTDIR)/installer/productbuild/Resources/license.rtf
cp doc/osx_installer_logo.png $(MACOSOUTDIR)/installer/productbuild/Resources
cp doc/osx_installer_logo_dark.png $(MACOSOUTDIR)/installer/productbuild/Resources
pkgbuild --version $(FULLVERSION) \
--identifier org.nodejs.node.pkg \
--root $(MACOSOUTDIR)/dist/node $(MACOSOUTDIR)/pkgs/node-$(FULLVERSION).pkg
Expand Down
Binary file modified doc/full-white-stripe.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/osx_installer_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/osx_installer_logo_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/thin-white-stripe.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions tools/generate-installer-assets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/sh
# Regenerates the installer logo assets in doc/ from the standardized
# Node.js logo artwork (https://github.com/openjs-foundation/artwork).
#
# The generated images are consumed by:
# - tools/msvs/msi/nodemsi/product.wxs (Windows MSI banner/dialog)
# - tools/macos-installer/productbuild/distribution.xml.tmpl
# (macOS installer background)
#
# The WiX UI bitmap slots are fixed-size (493x58 banner, 493x312 dialog) and
# the macOS background is placed unscaled (180x361), so the output dimensions
# must not change. Logo widths and offsets below were measured from the
# previous assets so the layout stays identical.
#
# Prerequisites: rsvg-convert (librsvg), magick (ImageMagick 7), curl
#
# Usage: tools/generate-installer-assets.sh

set -e

# Pinned artwork revision so the output is reproducible.
ARTWORK_REF=3816245ebbf4707bdafde748350ac8476b6b5b62
ARTWORK_URL="https://raw.githubusercontent.com/openjs-foundation/artwork/$ARTWORK_REF/projects/nodejs"

# Node.js brand green, matching the solid fill used in the standardized logo
# (see https://nodejs.org/en/about/branding).
GREEN='#5FA04E'

DOC_DIR="$(dirname "$0")/../doc"
TMP_DIR="$(mktemp -d)"
trap 'rm -rf "$TMP_DIR"' EXIT

curl -sSfL "$ARTWORK_URL/nodejs-logo-stacked-color.svg" \
-o "$TMP_DIR/logo-light.svg"
curl -sSfL "$ARTWORK_URL/nodejs-logo-stacked-color-dark_background.svg" \
-o "$TMP_DIR/logo-dark.svg"

# out canvas stripe logo_w x y background logo
MANIFEST='
thin-white-stripe.jpg 493x58 6 80 380 7 white light
full-white-stripe.jpg 493x312 6 116 37 89 white light
osx_installer_logo.png 180x361 0 142 19 254 none light
osx_installer_logo_dark.png 180x361 0 142 19 254 none dark
'

echo "$MANIFEST" | while read -r out canvas stripe logo_w x y bg logo; do
[ -z "$out" ] && continue

rsvg-convert -w "$logo_w" "$TMP_DIR/logo-$logo.svg" -o "$TMP_DIR/logo.png"

width="${canvas%x*}"
if [ "$stripe" -gt 0 ]; then
draw="rectangle 0,0 $width,$((stripe - 1))"
else
draw=''
fi

magick -size "$canvas" "canvas:$bg" \
-fill "$GREEN" ${draw:+-draw "$draw"} \
"$TMP_DIR/logo.png" -geometry "+$x+$y" -composite \
-strip -quality 95 "$DOC_DIR/$out"

got="$(magick identify -format '%wx%h' "$DOC_DIR/$out")"
if [ "$got" != "$canvas" ]; then
echo "error: $out is $got, expected $canvas" >&2
exit 1
fi
echo "generated doc/$out ($got)"
done
1 change: 1 addition & 0 deletions tools/macos-installer/productbuild/distribution.xml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<welcome file="welcome.html"/>
<conclusion file="conclusion.html"/>
<background alignment="topleft" file="osx_installer_logo.png"/>
<background-darkAqua alignment="topleft" file="osx_installer_logo_dark.png"/>
<pkg-ref id="org.nodejs.node.pkg" auth="root"/>
<pkg-ref id="org.nodejs.npm.pkg" auth="root"/>
<options customize="allow" require-scripts="false" hostArchitectures="x86_64,arm64"/>
Expand Down
Loading