diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1e2d7b133..750797b9d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -26,7 +26,7 @@ jobs: id: cache-msi with: path: fluent-package/msi/repositories - 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') }} + 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') }} - name: Build if: ${{ ! steps.cache-msi.outputs.cache-hit }} run: | @@ -61,6 +61,7 @@ jobs: matrix: test: - "install-test.ps1" + - "install-test-with-install-path-including-space.ps1" - "update-from-v4-test.ps1" - "update-from-v4-test.ps1 -ViaV5" - "update-from-v5-test.ps1" diff --git a/fluent-package/msi/assets/fluent-package-post-toast.bat b/fluent-package/msi/assets/fluent-package-post-toast.bat index 1a8a1dd7e..9d847def4 100644 --- a/fluent-package/msi/assets/fluent-package-post-toast.bat +++ b/fluent-package/msi/assets/fluent-package-post-toast.bat @@ -2,6 +2,6 @@ title Fluent-package post toast script if exist "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" ( if exist "%~dp0..\bin\fluent-package-post-toast.ps1" ( - "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "%~dp0..\bin\fluent-package-post-toast.ps1" + "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -File "%~dp0..\bin\fluent-package-post-toast.ps1" ) ) diff --git a/fluent-package/msi/install-test-with-install-path-including-space.ps1 b/fluent-package/msi/install-test-with-install-path-including-space.ps1 new file mode 100644 index 000000000..0c22a9601 --- /dev/null +++ b/fluent-package/msi/install-test-with-install-path-including-space.ps1 @@ -0,0 +1,16 @@ +$ErrorActionPreference = 'Stop' + +$msi = ((Get-Item "C:\\fluentd\\fluent-package\\msi\\repositories\\fluent-package-*.msi") | Sort-Object -Descending { $_.LastWriteTime } | Select-Object -First 1).FullName +Write-Host "Installing ${msi} ..." + +# Remove property logs (/lp) since they are large. +$logOptions = "/liwearucmo" + +$process = Start-Process msiexec -ArgumentList "/i", $msi, "/quiet", $logOptions, "installer.log", "OPTLOCATION=""C:\opt with space""" -Wait -NoNewWindow -PassThru + +if ($process.ExitCode -ne 0) { + Get-Content installer.log + Write-Host ".msi failed with exit code: $($process.ExitCode)." + [Environment]::Exit(1) +} +