Skip to content

Commit 76f904b

Browse files
committed
msi: fix bug where install fails for path with spaces
WIP Signed-off-by: Daijiro Fukuda <[email protected]>
1 parent dd39211 commit 76f904b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.github/workflows/windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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"
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)