33 [ValidateSet (' x64' )]
44 [string ] $Target = ' x64' ,
55 [ValidateSet (' Debug' , ' RelWithDebInfo' , ' Release' , ' MinSizeRel' )]
6- [string ] $Configuration = ' RelWithDebInfo'
6+ [string ] $Configuration = ' RelWithDebInfo' ,
7+ [switch ] $BuildInstaller = $false
78)
89
910$ErrorActionPreference = ' Stop'
@@ -53,6 +54,7 @@ function Package {
5354 ErrorAction = ' SilentlyContinue'
5455 Path = @ (
5556 " ${ProjectRoot} /release/${ProductName} -*-windows-*.zip"
57+ " ${ProjectRoot} /release/${ProductName} -*-windows-*.exe"
5658 )
5759 }
5860
@@ -67,6 +69,24 @@ function Package {
6769 }
6870 Compress-Archive - Force @CompressArgs
6971 Log- Group
72+
73+ if ( ( $BuildInstaller ) ) {
74+ $IsccFile = " ${ProjectRoot} /build_${Target} /installer-Windows.generated.iss"
75+
76+ if ( ! ( Test-Path - Path $IsccFile ) ) {
77+ throw ' InnoSetup install script not found. Run the build script or the CMake build and install procedures first.'
78+ }
79+
80+ Log- Information ' Creating InnoSetup installer...'
81+ Push-Location - Stack BuildTemp
82+ Ensure- Location - Path " ${ProjectRoot} /release"
83+ Copy-Item - Path ${Configuration} - Destination Package - Recurse
84+ Invoke-External iscc ${IsccFile} / O" ${ProjectRoot} /release" / F" ${OutputName} -Installer"
85+ Remove-Item - Path Package - Recurse
86+ Pop-Location - Stack BuildTemp
87+
88+ Log- Group
89+ }
7090}
7191
7292Package
0 commit comments