Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit fb31bf6

Browse files
committed
CA-335410: Corrected build script to sign the produced msi files. Corrected utility script.
Signed-off-by: Konstantina Chremmou <[email protected]>
1 parent dc9d3a5 commit fb31bf6

File tree

3 files changed

+27
-33
lines changed

3 files changed

+27
-33
lines changed

mk/build-installers.sh

+13-25
Original file line numberDiff line numberDiff line change
@@ -100,36 +100,23 @@ compile_installer()
100100
mkdir -p out${name}
101101

102102
${LIGHT} -nologo obj${name}/$1.wixobj lib/WixUI_InstallDir.wixlib -loc wixlib/wixui_$2.wxl -loc $2.wxl -ext WiXNetFxExtension -out out${name}/${name}.msi
103+
cp out${name}/${name}.msi ${WIX}
103104
}
104105

105-
sign_msi()
106-
{
107-
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ] || [ -z "$5" ] || [ -z "$6" ] ; then
108-
echo "Some signing parameters are not set; skip signing binaries"
109-
else
110-
cd ${WIX}/out$1 && chmod a+rw $1.msi && ${SIGN_BAT} $1.msi "${SIGN_DESCR}"
111-
fi
112-
}
113-
114-
#create just english msi
115106
if [ "XenCenter" != "${BRANDING_BRAND_CONSOLE}" ]
116107
then
117108
cd ${WIX}
118109
mv XenCenter.wxs ${BRANDING_BRAND_CONSOLE}.wxs
119110
mv XenCenter.l10n.wxs ${BRANDING_BRAND_CONSOLE}.l10n.wxs
120111
fi
121112

122-
compile_installer "${BRANDING_BRAND_CONSOLE}" "en-us" && sign_msi "${BRANDING_BRAND_CONSOLE}"
113+
#create just english msi
114+
compile_installer "${BRANDING_BRAND_CONSOLE}" "en-us"
123115

124116
#then create l10n msi containing all resources
125-
compile_installer "${BRANDING_BRAND_CONSOLE}.l10n" "en-us" && sign_msi "${BRANDING_BRAND_CONSOLE}.l10n"
126-
compile_installer "${BRANDING_BRAND_CONSOLE}.l10n" "ja-jp" && sign_msi "${BRANDING_BRAND_CONSOLE}.l10n.ja-jp"
127-
compile_installer "${BRANDING_BRAND_CONSOLE}.l10n" "zh-cn" && sign_msi "${BRANDING_BRAND_CONSOLE}.l10n.zh-cn"
128-
129-
cp ${WIX}/out${BRANDING_BRAND_CONSOLE}.l10n/${BRANDING_BRAND_CONSOLE}.l10n.msi \
130-
${WIX}/out${BRANDING_BRAND_CONSOLE}.l10n.ja-jp/${BRANDING_BRAND_CONSOLE}.l10n.ja-jp.msi \
131-
${WIX}/out${BRANDING_BRAND_CONSOLE}.l10n.zh-cn/${BRANDING_BRAND_CONSOLE}.l10n.zh-cn.msi \
132-
${WIX}
117+
compile_installer "${BRANDING_BRAND_CONSOLE}.l10n" "en-us"
118+
compile_installer "${BRANDING_BRAND_CONSOLE}.l10n" "ja-jp"
119+
compile_installer "${BRANDING_BRAND_CONSOLE}.l10n" "zh-cn"
133120

134121
cd ${WIX} && cp ${BRANDING_BRAND_CONSOLE}.l10n.msi ${BRANDING_BRAND_CONSOLE}.l10n.zh-tw.msi
135122
cd ${WIX} && cscript /nologo CodePageChange.vbs ZH-TW ${BRANDING_BRAND_CONSOLE}.l10n.zh-tw.msi
@@ -142,13 +129,14 @@ cd ${WIX} && wscript WiSubStg.vbs ${BRANDING_BRAND_CONSOLE}.l10n.msi ja-jp.mst 1
142129
cd ${WIX} && wscript WiSubStg.vbs ${BRANDING_BRAND_CONSOLE}.l10n.msi zh-cn.mst 2052
143130
cd ${WIX} && wscript WiSubStg.vbs ${BRANDING_BRAND_CONSOLE}.l10n.msi zh-tw.mst 1028
144131

145-
#sign again the combined msi because it seems the embedding breaks the signature
146-
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ] || [ -z "$5" ] || [ -z "$6" ] ; then
132+
#copy installers to output directory and sign them
133+
cd ${WIX} && chmod a+rw ${BRANDING_BRAND_CONSOLE}.msi ${BRANDING_BRAND_CONSOLE}.l10n.msi
134+
135+
if [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ] || [ -z "$5" ] || [ -z "$6" ] ; then
147136
echo "Some signing parameters are not set; skip signing binaries"
148137
else
149-
cd ${WIX} && chmod a+rw ${BRANDING_BRAND_CONSOLE}.l10n.msi && ${SIGN_BAT} ${BRANDING_BRAND_CONSOLE}.l10n.msi "${SIGN_DESCR}"
138+
cd ${WIX} && ${SIGN_BAT} ${BRANDING_BRAND_CONSOLE}.msi ${SIGN_DESCR}
139+
cd ${WIX} && ${SIGN_BAT} ${BRANDING_BRAND_CONSOLE}.l10n.msi ${SIGN_DESCR}
150140
fi
151141

152-
#copy the msi installers
153-
cp ${WIX}/out${BRANDING_BRAND_CONSOLE}/${BRANDING_BRAND_CONSOLE}.msi ${OUTPUT_DIR}
154-
cp ${WIX}/${BRANDING_BRAND_CONSOLE}.l10n.msi ${OUTPUT_DIR}
142+
cp ${WIX}/${BRANDING_BRAND_CONSOLE}.msi ${WIX}/${BRANDING_BRAND_CONSOLE}.l10n.msi ${OUTPUT_DIR}

mk/sign.bat

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ if "%sbe%"=="true" (
8989
--cross-sign --pagehashes yes "%thefile%"
9090
)
9191
%CTXSIGN% --end
92+
echo.
9293

9394
) else (
9495
echo "Self signing"

packages/download_packages.ps1

+13-8
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,14 @@ Param(
3838
[String]$DOMAIN,
3939

4040
[Parameter(HelpMessage ="Whether to download symbols (*.pdb files)")]
41-
[switch]$SYMBOLS
41+
[switch]$SYMBOLS,
42+
43+
[Parameter(HelpMessage ="Whether to download all packages needed to build the installer")]
44+
[switch]$ZIP
4245
)
4346

4447
$DOMAIN = $DOMAIN.Trim()
45-
$PACKAGE_DIR = Get-Item "$PSScriptRoot" | select -ExpandProperty FullName
48+
$PACKAGE_DIR = Get-Item "$PSScriptRoot\" | select -ExpandProperty FullName
4649
$MK_DIR = Get-Item "$PSScriptRoot\..\mk" | select -ExpandProperty FullName
4750

4851
#dotnet packages
@@ -56,12 +59,14 @@ foreach($dep in $DEPS_MAP.files) {
5659
$pattern = "https://$DOMAIN/" + $dep.pattern
5760
$filename = Split-Path $pattern -leaf
5861

59-
if (($filename -eq "putty.exe") -or ($filename -like "*.dll")) {
60-
Invoke-WebRequest -Uri $pattern -Method Get -OutFile "$PACKAGE_DIR\$filename"
62+
if (($filename -like "*.dll") -and $SYMBOLS) {
63+
$symbolfile = [IO.Path]::GetFileNameWithoutExtension($filename) + ".pdb"
64+
Write-Output "Downloading $symbolfile"
65+
Invoke-WebRequest -Uri $pattern -Method Get -OutFile "$PACKAGE_DIR\$symbolfile"
66+
}
6167

62-
if ($SYMBOLS) {
63-
$symbolfile = [IO.Path]::GetFileNameWithoutExtension($filename) + ".pdb"
64-
Invoke-WebRequest -Uri $pattern -Method Get -OutFile "$PACKAGE_DIR\$symbolfile"
65-
}
68+
if (($filename -eq "putty.exe") -or ($filename -like "*.dll") -or (($filename -like "*.zip") -and $ZIP)) {
69+
Write-Output "Downloading $filename"
70+
Invoke-WebRequest -Uri $pattern -Method Get -OutFile "$PACKAGE_DIR\$filename"
6671
}
6772
}

0 commit comments

Comments
 (0)