Do not show message box to confirm uninstallation of old install when /VERYSILENT switch specified.

This commit is contained in:
dolphin6k 2022-01-11 15:47:59 +09:00
parent c67dfbc562
commit 4a70b008c1

View file

@ -255,6 +255,19 @@ begin
Result := Path; Result := Path;
end; end;
function CmdLineParamExists(const Value: string): Boolean;
var
I: Integer;
begin
Result := False;
for I := 1 to ParamCount do
if CompareText(ParamStr(I), Value) = 0 then
begin
Result := True;
Exit;
end;
end;
Procedure ForceUninstallPreviousX86Install(); Procedure ForceUninstallPreviousX86Install();
var var
ResultCode: Integer; ResultCode: Integer;
@ -262,6 +275,8 @@ begin
if Is64BitInstallMode then if Is64BitInstallMode then
begin begin
if FileExists('C:\Program Files (x86)\TuxPaint\unins000.exe') then if FileExists('C:\Program Files (x86)\TuxPaint\unins000.exe') then
begin
if CmdLineParamExists('/VERYSILENT') = False then
begin begin
if MsgBox('Old version will be uninstalled automatically.', mbInformation, MB_OKCANCEL) = IDOK then if MsgBox('Old version will be uninstalled automatically.', mbInformation, MB_OKCANCEL) = IDOK then
begin begin
@ -270,6 +285,10 @@ begin
else begin else begin
Abort; Abort;
end; end;
end
else begin
Exec('C:\Program Files (x86)\TuxPaint\unins000.exe', '/VERYSILENT', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
end;
end; end;
end; end;
end; end;