diff --git a/build/windows/installer/base_gimp3264.iss b/build/windows/installer/base_gimp3264.iss index 00270c5a0b..cb0315c39e 100644 --- a/build/windows/installer/base_gimp3264.iss +++ b/build/windows/installer/base_gimp3264.iss @@ -1173,7 +1173,7 @@ var ResultCode: Integer; begin StatusLabel(CustomMessage('CreatingRestorePoint'),''); - if not ShellExec('RunAs', 'powershell', ExpandConstant('Checkpoint-Computer -Description "GIMP_{#CUSTOM_GIMP_VERSION}_install" -RestorePointType APPLICATION_INSTALL'), + if not ShellExec('RunAs', 'powershell', '-Command "$job = Start-Job -ScriptBlock { Checkpoint-Computer -Description "GIMP_' + ExpandConstant('{#CUSTOM_GIMP_VERSION}') + '_install" -RestorePointType APPLICATION_INSTALL }; Wait-Job $job -Timeout 24; if ($job.State -eq \"Running\") { Stop-Job $job -Confirm:$false }; Receive-Job $job"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then begin DebugMsg('RestorePoint','Failed to create restore point. Error code: ' + IntToStr(ResultCode)); diff --git a/build/windows/installer/util_uninst.isi b/build/windows/installer/util_uninst.isi index 88758516be..0ffbda44d6 100644 --- a/build/windows/installer/util_uninst.isi +++ b/build/windows/installer/util_uninst.isi @@ -266,7 +266,7 @@ var ResultCode: Integer; begin UninstallProgressForm.StatusLabel.Caption := CustomMessage('CreatingRestorePoint'); - if not ShellExec('RunAs', 'powershell', ExpandConstant('Checkpoint-Computer -Description "GIMP_{#CUSTOM_GIMP_VERSION}_uninstall" -RestorePointType APPLICATION_UNINSTALL'), + if not ShellExec('RunAs', 'powershell', '-Command "$job = Start-Job -ScriptBlock { Checkpoint-Computer -Description "GIMP_' + ExpandConstant('{#CUSTOM_GIMP_VERSION}') + '_uninstall" -RestorePointType APPLICATION_UNINSTALL }; Wait-Job $job -Timeout 24; if ($job.State -eq \"Running\") { Stop-Job $job -Confirm:$false }; Receive-Job $job"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then begin DebugMsg('RestorePointU','Failed to create restore point. Error code: ' + IntToStr(ResultCode));