Skip to content

Commit 0db08e6

Browse files
authored
msi: fix bug where install fails for path with spaces (#927)
* Fixes #926 --------- Signed-off-by: Daijiro Fukuda <[email protected]>
1 parent 252e47d commit 0db08e6

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.github/workflows/windows.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
id: cache-msi
2727
with:
2828
path: fluent-package/msi/repositories
29-
key: ${{ runner.os }}-cache-windows-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', '!**/*.ps1', 'fluent-package/msi/source.wxs', 'fluent-package/msi/parameters.wxi.erb', 'fluent-package/msi/localization-en-us.wxl', 'fluent-package/msi/exclude-files.xslt', 'fluent-package/msi/Dockerfile') }}
29+
key: ${{ runner.os }}-cache-windows-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', 'fluent-package/msi/assets/*', 'fluent-package/msi/source.wxs', 'fluent-package/msi/parameters.wxi.erb', 'fluent-package/msi/localization-en-us.wxl', 'fluent-package/msi/exclude-files.xslt', 'fluent-package/msi/Dockerfile') }}
3030
- name: Build
3131
if: ${{ ! steps.cache-msi.outputs.cache-hit }}
3232
run: |
@@ -61,6 +61,7 @@ jobs:
6161
matrix:
6262
test:
6363
- "install-test.ps1"
64+
- "install-test-with-install-path-including-space.ps1"
6465
- "update-from-v4-test.ps1"
6566
- "update-from-v4-test.ps1 -ViaV5"
6667
- "update-from-v5-test.ps1"

fluent-package/msi/assets/fluent-package-post-toast.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
title Fluent-package post toast script
33
if exist "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" (
44
if exist "%~dp0..\bin\fluent-package-post-toast.ps1" (
5-
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "%~dp0..\bin\fluent-package-post-toast.ps1"
5+
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -File "%~dp0..\bin\fluent-package-post-toast.ps1"
66
)
77
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
$ErrorActionPreference = 'Stop'
2+
3+
$msi = ((Get-Item "C:\\fluentd\\fluent-package\\msi\\repositories\\fluent-package-*.msi") | Sort-Object -Descending { $_.LastWriteTime } | Select-Object -First 1).FullName
4+
Write-Host "Installing ${msi} ..."
5+
6+
# Remove property logs (/lp) since they are large.
7+
$logOptions = "/liwearucmo"
8+
9+
$process = Start-Process msiexec -ArgumentList "/i", $msi, "/quiet", $logOptions, "installer.log", "OPTLOCATION=""C:\opt with space""" -Wait -NoNewWindow -PassThru
10+
11+
if ($process.ExitCode -ne 0) {
12+
Get-Content installer.log
13+
Write-Host ".msi failed with exit code: $($process.ExitCode)."
14+
[Environment]::Exit(1)
15+
}
16+

0 commit comments

Comments
 (0)