Skip to content

Commit

Permalink
Misc: Handle VCRedist restart exit code in overlay setups
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotrekol committed Jul 30, 2022
1 parent 2f1e4db commit d416621
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions innoSetup/browserOverlayScript.iss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ VCRedistFailedToLaunch=Failed to launch VCRedist Installer with error "%1". Plea
VCRedistFailedOther=The VCRedist installer exited with an unexpected status code "%1". Please review any other messages shown by the installer to determine whether the installation completed successfully, and abort this installation and fix the problem if it did not.

[Code]
var
requiresRestart: boolean;
function InitializeSetup(): Boolean;
begin
Expand Down Expand Up @@ -117,6 +119,9 @@ begin
0: begin
// Successful
end;
3010: begin
requiresRestart := True;
end;
else begin
MsgBox(FmtMessage(CustomMessage('VCRedistFailedOther'), [IntToStr(resultCode)]), mbError, MB_OK);
end;
Expand All @@ -130,6 +135,11 @@ begin
end;
end;
function NeedRestart(): Boolean;
begin
Result := requiresRestart;
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
if VCRedistIsMissing() then
Expand Down
10 changes: 10 additions & 0 deletions innoSetup/osuOverlayScript.iss
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ VCRedistFailedToLaunch=Failed to launch VCRedist Installer with error "%1". Plea
VCRedistFailedOther=The VCRedist installer exited with an unexpected status code "%1". Please review any other messages shown by the installer to determine whether the installation completed successfully, and abort this installation and fix the problem if it did not.

[Code]
var
requiresRestart: boolean;
function InitializeSetup(): Boolean;
begin
Expand Down Expand Up @@ -116,6 +118,9 @@ begin
0: begin
// Successful
end;
3010: begin
requiresRestart := True;
end;
else begin
MsgBox(FmtMessage(CustomMessage('VCRedistFailedOther'), [IntToStr(resultCode)]), mbError, MB_OK);
end;
Expand All @@ -129,6 +134,11 @@ begin
end;
end;
function NeedRestart(): Boolean;
begin
Result := requiresRestart;
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
if VCRedistIsMissing() then
Expand Down

0 comments on commit d416621

Please sign in to comment.