|
7 | 7 |
|
8 | 8 | [string] $ProductVersion, |
9 | 9 |
|
10 | | - [switch] $SkipInstallers |
| 10 | + [switch] $SkipInstallers, |
| 11 | + |
| 12 | + [switch] $SkipSetupExe, |
| 13 | + |
| 14 | + [switch] $SkipMsi |
11 | 15 | ) |
12 | 16 |
|
13 | 17 | $ErrorActionPreference = "Stop" |
@@ -97,7 +101,7 @@ function New-ToastDeskMsi([string] $version) { |
97 | 101 | $index = 0 |
98 | 102 |
|
99 | 103 | Get-ChildItem -Path $publishDir -File -Recurse | Sort-Object FullName | ForEach-Object { |
100 | | - $relativePath = [System.IO.Path]::GetRelativePath($publishDir, $_.FullName) |
| 104 | + $relativePath = $_.FullName.Substring($publishDir.TrimEnd("\").Length + 1) |
101 | 105 | $relativeDirectory = Split-Path -Parent $relativePath |
102 | 106 | $directoryId = switch ($relativeDirectory) { |
103 | 107 | "" { "INSTALLFOLDER" } |
@@ -165,7 +169,7 @@ $componentRefXml |
165 | 169 | "@ |
166 | 170 |
|
167 | 171 | Set-Content -Path $wxsPath -Value $wxs -Encoding UTF8 |
168 | | - & $wixCommand.Source build $wxsPath -arch x64 -out $setupMsiPath |
| 172 | + & $wixCommand.Source build $wxsPath -arch x64 -pdbtype none -out $setupMsiPath |
169 | 173 | } |
170 | 174 |
|
171 | 175 | $resolvedVersion = Get-ProductVersion |
@@ -207,23 +211,28 @@ if (Test-Path $zipPath) { |
207 | 211 | Compress-Archive -Path (Join-Path $publishDir "*") -DestinationPath $zipPath |
208 | 212 |
|
209 | 213 | if (-not $SkipInstallers) { |
210 | | - $isccPath = Get-IsccPath |
211 | | - if (-not $isccPath) { |
212 | | - throw "Inno Setup compiler was not found. Install Inno Setup 6 or run with -SkipInstallers." |
213 | | - } |
| 214 | + if (-not $SkipSetupExe) { |
| 215 | + $isccPath = Get-IsccPath |
| 216 | + if (-not $isccPath) { |
| 217 | + throw "Inno Setup compiler was not found. Install Inno Setup 6 or run with -SkipInstallers." |
| 218 | + } |
214 | 219 |
|
215 | | - & $isccPath "/DMyAppVersion=$resolvedVersion" $innoScriptPath |
| 220 | + & $isccPath "/DMyAppVersion=$resolvedVersion" $innoScriptPath |
216 | 221 |
|
217 | | - $builtSetupExe = Get-ChildItem -Path $installerDir -File -Filter "ToastDesk-Setup-*.exe" | |
218 | | - Sort-Object LastWriteTime -Descending | |
219 | | - Select-Object -First 1 |
| 222 | + $builtSetupExe = Get-ChildItem -Path $installerDir -File -Filter "ToastDesk-Setup-*.exe" | |
| 223 | + Sort-Object LastWriteTime -Descending | |
| 224 | + Select-Object -First 1 |
220 | 225 |
|
221 | | - if (-not $builtSetupExe) { |
222 | | - throw "Inno Setup did not create a setup executable." |
| 226 | + if (-not $builtSetupExe) { |
| 227 | + throw "Inno Setup did not create a setup executable." |
| 228 | + } |
| 229 | + |
| 230 | + Move-Item -LiteralPath $builtSetupExe.FullName -Destination $setupExePath -Force |
223 | 231 | } |
224 | 232 |
|
225 | | - Move-Item -LiteralPath $builtSetupExe.FullName -Destination $setupExePath -Force |
226 | | - New-ToastDeskMsi $resolvedVersion |
| 233 | + if (-not $SkipMsi) { |
| 234 | + New-ToastDeskMsi $resolvedVersion |
| 235 | + } |
227 | 236 | } |
228 | 237 |
|
229 | 238 | $packages = Get-ChildItem -Path $releaseDir -File | Where-Object { $_.Extension -in ".zip", ".exe", ".msi" } | Sort-Object Name |
|
0 commit comments