From 7d5f127748fdffe836fb06a350d76089f6ea3ad2 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Tue, 3 Apr 2018 15:19:42 -0400 Subject: [PATCH] generalize build-msi.sh for 32/64 builds (#408) * generalize build-msi.sh for 32/64 builds * Rename windows-connector.wxs to windows-connector-x64.wxs * Create windows-connector-x86.wxs --- wix/build-msi.sh | 12 +- ...onnector.wxs => windows-connector-x64.wxs} | 0 wix/windows-connector-x86.wxs | 174 ++++++++++++++++++ 3 files changed, 184 insertions(+), 2 deletions(-) rename wix/{windows-connector.wxs => windows-connector-x64.wxs} (100%) create mode 100644 wix/windows-connector-x86.wxs diff --git a/wix/build-msi.sh b/wix/build-msi.sh index a598292..7085157 100644 --- a/wix/build-msi.sh +++ b/wix/build-msi.sh @@ -6,7 +6,15 @@ fi export CONNECTOR_VERSION=$1 LDFLAGS="github.com/google/cloud-print-connector/lib.BuildDate=$CONNECTOR_VERSION" CONNECTOR_DIR=$GOPATH/src/github.com/google/cloud-print-connector -MSI_FILE="$CONNECTOR_DIR/wix/windows-connector-$CONNECTOR_VERSION.msi" + +arch=$(arch) +if [[ "$arch" == "i686" ]]; then + wixarch="x86" +elif [[ "$arch" == "x86_64" ]]; then + wixarch="x64" +fi + +MSI_FILE="$CONNECTOR_DIR/wix/windows-connector-$CONNECTOR_VERSION-$arch.msi" echo "Running go get..." go get -ldflags -X="$LDFLAGS" -v github.com/google/cloud-print-connector/... @@ -25,7 +33,7 @@ if [[ $rc != 0 ]]; then fi echo "Running WIX candle.exe..." -"$WIX/bin/candle.exe" -arch x64 "$CONNECTOR_DIR/wix/windows-connector.wxs" \ +"$WIX/bin/candle.exe" -arch $wixarch "$CONNECTOR_DIR/wix/windows-connector-$wixarch.wxs" \ "$CONNECTOR_DIR/wix/dependencies.wxs" rc=$? if [[ $rc != 0 ]]; then diff --git a/wix/windows-connector.wxs b/wix/windows-connector-x64.wxs similarity index 100% rename from wix/windows-connector.wxs rename to wix/windows-connector-x64.wxs diff --git a/wix/windows-connector-x86.wxs b/wix/windows-connector-x86.wxs new file mode 100644 index 0000000..76d6dc6 --- /dev/null +++ b/wix/windows-connector-x86.wxs @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + STARTSERVICE="YES" + + + + + + + + + + + + + + + NOT CONFIGFILE + + + CONFIGFILE + + + + + + + + + + NOT CONFIGFILE and NOT Installed and NOT WIX_UPGRADE_DETECTED and RUNINIT="YES" + + + + + + + DELETEPRINTERS="YES" AND $ConfigFile=2 + + + + + +