Skip to content

Commit

Permalink
chore(windows): cleanup build.sh for installer
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdurdin committed May 19, 2024
1 parent e7a4c57 commit 7b0528f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 11 deletions.
4 changes: 2 additions & 2 deletions oem/firstvoices/windows/src/inst/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function do_publish() {
# Build the installation archive
#

local GUID1=$(run_in_vs_env uuidgen)
local GUID1=$(generate_uuid)

"$WIXHEAT" dir ../xml -o desktopui.wxs -ag -cg DesktopUI -dr INSTALLDIR -suid -var var.DESKTOPUISOURCE -wx -nologo
"$WIXCANDLE" -dOEMNAME="FirstVoices" -dPRODUCTNAME="FirstVoices Keyboards" -dROOT="$KEYMAN_ROOT/windows" \
Expand All @@ -74,7 +74,7 @@ function do_publish() {
# Build self-extracting archive
#
create-setup-inf
"$WZZIP" firstvoices.zip firstvoices.msi license.html setup.inf setuptitle.png fv_all.kmp
wzzip firstvoices.zip firstvoices.msi license.html setup.inf setuptitle.png fv_all.kmp
rm -f setup.inf
cat "$WINDOWS_PROGRAM_APP/setup-redist.exe" firstvoices.zip > firstvoices.exe
rm -f firstvoices.zip
Expand Down
7 changes: 7 additions & 0 deletions resources/build/win/environment.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ VERIFY_SIGNATURES_PATH="$KEYMAN_ROOT/common/windows/delphi/tools/verify_signatur
VERIFY_SIGNATURES="$VERIFY_SIGNATURES_PATH/$WIN32_TARGET_PATH/verify_signatures.exe"
SIGCHECK="$VERIFY_SIGNATURES_PATH/$WIN32_TARGET_PATH/sigcheck.exe"

generate_uuid() {
(
source "$KEYMAN_ROOT/resources/build/win/visualstudio_environment.inc.sh"
uuidgen
)
}

run_in_vs_env() {
(
builder_echo heading "### visual_studio: $@"
Expand Down
38 changes: 29 additions & 9 deletions windows/src/desktop/inst/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ builder_describe "Installation files for Keyman for Windows" \
# after all other builds complete

builder_describe_outputs \
publish /windows/src/desktop/inst/keymandesktop-${VERSION}.exe
publish /windows/release/${VERSION}/keyman-${VERSION}.exe

builder_parse "$@"

Expand Down Expand Up @@ -60,9 +60,15 @@ function do_publish() {
#
# Build the installation archive
#
candle
do_candle

# ICE82: we suppress because it reports spurious errors with merge module
# keymanengine to do with duplicate sequence numbers. Safely ignored.
# ICE80: we suppress because it reports x64 components without targeting x64.
# Safely ignored.

"$WIXLIGHT" \
-sice:ICE82 -sice:ICE80 \
-nologo \
-dWixUILicenseRtf=License.rtf \
-out keymandesktop.msi -ext WixUIExtension \
Expand All @@ -77,7 +83,7 @@ function do_publish() {
# Build self-extracting archive
#
create-setup-inf
"$WZZIP" keymandesktop.zip keymandesktop.msi license.html setup.inf
wzzip keymandesktop.zip keymandesktop.msi license.html setup.inf
rm -f setup.inf
cat "$WINDOWS_PROGRAM_APP/setup-redist.exe" keymandesktop.zip > keymandesktop.exe
rm -f keymandesktop.zip
Expand All @@ -101,7 +107,7 @@ function copy-installer() {
verify-installer-signatures

# Copy the unsigned setup.exe for use in bundling scenarios; zip it up for clarity
"$WZZIP" "$KEYMAN_ROOT/windows/release/${VERSION}/setup-redist.zip" "$WINDOWS_PROGRAM_APP/setup-redist.exe"
wzzip "$KEYMAN_ROOT/windows/release/${VERSION}/setup-redist.zip" "$WINDOWS_PROGRAM_APP/setup-redist.exe"
}

function verify-program-signatures() {
Expand All @@ -122,18 +128,32 @@ function test-releaseexists() {
fi
}

function candle() {
builder_heading candle
function do_candle() {
heat-cef

local GUID1=$(run_in_vs_env uuidgen)
builder_heading candle

local GUID1=$(generate_uuid)
"$WIXHEAT" dir ../kmshell/xml -o desktopui.wxs -ag -cg DesktopUI -dr INSTALLDIR -suid -var var.DESKTOPUISOURCE -wx -nologo
"$WIXHEAT" dir ../kmshell/locale -o locale.wxs -ag -cg Locale -dr INSTALLDIR -var var.LOCALESOURCE -wx -nologo
"$WIXCANDLE" -dVERSION_WITH_TAG=${VERSION_WITH_TAG} -dVERSION=${VERSION_WIN} -dRELEASE=${VERSION_RELEASE} -dPRODUCTID=$GUID1 \
-dDESKTOPUISOURCE=../kmshell/xml -dLOCALESOURCE=../kmshell/locale \
keymandesktop.wxs desktopui.wxs locale.wxs
-dDESKTOPUISOURCE=../kmshell/xml -dLOCALESOURCE=../kmshell/locale "-dCefSourceDir=$KEYMAN_CEF4DELPHI_ROOT" \
keymandesktop.wxs desktopui.wxs locale.wxs cef.wxs
}

function heat-cef() {
builder_heading heat-cef

# We copy the files to a temp folder in order to exclude .git and README.md from harvesting
rm -rf "$KEYMAN_WIX_TEMP_CEF"
mkdir -p "$KEYMAN_WIX_TEMP_CEF"
cp -r "$KEYMAN_CEF4DELPHI_ROOT"/* "$KEYMAN_WIX_TEMP_CEF"
"$WIXHEAT" dir "$KEYMAN_WIX_TEMP_CEF" -o cef.wxs -ag -cg CEF -dr INSTALLDIR -var var.CefSourceDir -wx -nologo
# When we candle/light build, we can grab the source files from the proper root so go ahead and delete the temp folder again
rm -rf "$KEYMAN_WIX_TEMP_CEF"
}


function create-setup-inf() {
builder_heading create-setup-inf

Expand Down

0 comments on commit 7b0528f

Please sign in to comment.