diff --git a/installer/main.wxs b/installer/main.wxs
index b5ca3ba3..df33ce31 100644
--- a/installer/main.wxs
+++ b/installer/main.wxs
@@ -81,6 +81,13 @@
+
+
+
diff --git a/tools/test-installer.ps1 b/tools/test-installer.ps1
index 4a249aad..1b4dc60b 100644
--- a/tools/test-installer.ps1
+++ b/tools/test-installer.ps1
@@ -76,7 +76,7 @@ function Write-MsiexecDiagnostic([String] $Log, [DateTime] $Since) {
}
}
-function Invoke-Msiexec([String] $Name, [String[]] $Arguments) {
+function Invoke-Msiexec([String] $Name, [String[]] $Arguments, [Switch] $PreviousPackage) {
$log = Join-Path $WorkDir "$Name.log"
$allArguments = $Arguments + @('/qn', '/norestart', '/L*v', "`"$log`"")
Write-Host "msiexec $($allArguments -join ' ')"
@@ -87,6 +87,17 @@ function Invoke-Msiexec([String] $Name, [String[]] $Arguments) {
Write-Host " msiexec $Name took $([Math]::Round(((Get-Date) - $since).TotalSeconds, 1)) s, exit code $($process.ExitCode)"
Write-Host " runner after: $(Get-RunnerProcess)"
Write-MsiexecDiagnostic -Log $log -Since $since
+
+ # The package disables the Restart Manager, so no operation may shut down
+ # applications that hold its files. An upgrade removes the previous release
+ # with the previous package's settings, which still enable it.
+ if (-not $PreviousPackage -and (Test-Path $log)) {
+ $shutdown = Select-String -Path $log -Encoding unicode -Pattern 'RESTART MANAGER: Successfully shut down'
+ if ($null -ne $shutdown) {
+ throw "msiexec $Name let the Restart Manager shut down applications, see $log"
+ }
+ }
+
# 3010 means success, but a restart is required.
if ($process.ExitCode -ne 0 -and $process.ExitCode -ne 3010) {
throw "msiexec $Name failed with exit code $($process.ExitCode), see $log"
@@ -204,7 +215,7 @@ try {
throw "checksum mismatch for $previousMsi`: $actualHash, expected $expectedHash"
}
- Invoke-Msiexec -Name 'install-previous' -Arguments @('/i', "`"$previousMsi`"")
+ Invoke-Msiexec -Name 'install-previous' -Arguments @('/i', "`"$previousMsi`"") -PreviousPackage
Assert-ServiceRunning | Out-Null
Write-Host '::endgroup::'
@@ -217,7 +228,7 @@ try {
Write-Step 'Upgrade to this build'
Start-Foreign
- Invoke-Msiexec -Name 'upgrade' -Arguments @('/i', "`"$UpgradeMsi`"")
+ Invoke-Msiexec -Name 'upgrade' -Arguments @('/i', "`"$UpgradeMsi`"") -PreviousPackage
$metrics = Assert-ServiceRunning
Assert-InstalledExecutable