Skip to content

Commit

Permalink
Create an MSI package as part of the build.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuetschard committed May 22, 2017
1 parent 2e729e0 commit 60af926
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 1 deletion.
11 changes: 11 additions & 0 deletions kokoro/windows/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ unzip -q go1.8.windows-amd64.zip
set GOROOT=%BUILD_ROOT%\go
set PATH=%GOROOT%\bin;%PATH%

REM Install WiX Toolset.
wget -q https://github.com/wixtoolset/wix3/releases/download/wix311rtm/wix311-binaries.zip
unzip -q -d wix wix311-binaries.zip
set WIX=%cd%\wix

REM Fix up the MSYS environment: remove gcc and add mingw's gcc
c:\tools\msys64\usr\bin\bash --login -c "pacman -R --noconfirm gcc"
c:\tools\msys64\usr\bin\bash --login -c "pacman -S --noconfirm mingw-w64-x86_64-gcc"
Expand Down Expand Up @@ -87,3 +92,9 @@ call %SRC%\kokoro\windows\copy_jre.bat %cd%\gapid\jre

REM Package up the zip file.
zip -r gapid-%VERSION%-windows.zip gapid

REM Create an MSI installer.
copy %SRC%\kokoro\windows\gapid.wxs .
%WIX%\heat.exe dir gapid -ag -cg gapid -dr gapid -template fragment -sreg -sfrag -srd -o component.wxs
%WIX%\candle.exe gapid.wxs component.wxs
%WIX%\light.exe gapid.wixobj component.wixobj -b gapid -ext WixUIExtension -cultures:en-us -o gapid-%VERSION%.msi
2 changes: 1 addition & 1 deletion kokoro/windows/gapid.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ GAPID launch script. https://github.com/google/gapid
:start

SET GAPID=%~dp0
"%~dp0\jre\bin\javaw.exe" -jar "%~dp0/lib/gapic.jar" $@
"%~dp0\jre\bin\javaw.exe" -jar "%~dp0/lib/gapic.jar" %*
86 changes: 86 additions & 0 deletions kokoro/windows/gapid.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. -->

<!-- MSI Definition for GAPID consumed by the WiX Toolset -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Name="GAPID" Manufacturer="Google, Inc"
Id="E88564FC-D455-4523-B35A-1E100176A91D"
UpgradeCode="7187CA6A-4A6D-4187-B6B1-1E100176A91D"
Language="1033" Codepage="1252" Version="1.0.0">
<Package Id="*" Keywords="Installer" Description="GAPID Installer"
Comments="Installs the Graphics API Debugger" Manufacturer="Google, Inc"
InstallerVersion="100" Languages="1033" Compressed="yes" SummaryCodepage="1252" />
<MediaTemplate EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="gapid" Name="gapid">
</Directory>
</Directory>
</Directory>
<Feature Id="GAPID" Title="Graphics API Debugger" Level="1">
<ComponentGroupRef Id="gapid" />
</Feature>

<Property Id="WIXUI_INSTALLDIR" Value="gapid" />
<!-- From WixUI_InstallDir.wxs - without a license dialog -->
<UI Id="gapid">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />

<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="InstallDir" />

<DialogRef Id="BrowseDlg" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />

<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>

<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>

<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>

<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>

<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>

<Property Id="ARPNOMODIFY" Value="1" />
</UI>
<UIRef Id="WixUI_Common" />
</Product>
</Wix>
1 change: 1 addition & 0 deletions kokoro/windows/release.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
build_file: "src/github.com/google/gapid/kokoro/windows/build.bat"
action {
define_artifacts {
regex: "out/dist/gapid*.msi"
regex: "out/dist/gapid*.zip"
}
}

0 comments on commit 60af926

Please sign in to comment.