静默卸载不进行卸载提示

This commit is contained in:
luoliangyi 2022-11-26 12:58:27 +08:00
parent 649e00a76e
commit 9af29f6df8
4 changed files with 55 additions and 17 deletions

View File

@ -43,9 +43,7 @@ Name: "TwainG404"; Description: "CUMTENNSCAN G404 TWAIN" ; Types: Full
[Files] [Files]
; app ; app
Source: ".\CumtennScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion Source: ".\CumtennScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion Source: "..\..\..\..\code_app\doc\scanner\CumtennScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion Source: "..\..\..\..\code_app\doc\scanner\CumtennScan_scanSettings_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
;Source: "..\..\..\..\code_app\doc\scanner\CumtennScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
;Source: "..\..\..\..\code_app\doc\scanner\CumtennScan_scanSettings_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
; app32 ; app32
Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: not Is64BitInstallMode Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: not Is64BitInstallMode
@ -91,8 +89,7 @@ Source: "..\..\x64\Release\concrt140.dll"; DestDir: "{app}\"; Flags: ignoreversi
Source: "..\..\x64\OEM\cumtenn\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "..\..\x64\OEM\cumtenn\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\cumtenn\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "..\..\x64\OEM\cumtenn\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
; twain32 ; twain32 Source: "..\..\..\..\code_app\doc\scanner\CumtennScan_scanSettings_Help_manual.pdf"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
;Source: "..\..\..\..\code_app\doc\scanner\CumtennScan_scanSettings_Help_manual.pdf"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\msvcp140.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "..\..\x86\Release\msvcp140.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\vcruntime140.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "..\..\x86\Release\vcruntime140.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\concrt140.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "..\..\x86\Release\concrt140.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
@ -121,10 +118,7 @@ Source: "..\..\usb\cumtenn\cumtennctsa4.cat"; DestDir: "{app}\driver\"; Flags:
Source: "..\..\x86\Release\DPInst32.exe"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs; Check: not IsWin64 Source: "..\..\x86\Release\DPInst32.exe"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs; Check: not IsWin64
Source: "..\..\x64\Release\DPInst64.exe"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs; Check: IsWin64 Source: "..\..\x64\Release\DPInst64.exe"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs; Check: IsWin64
; 临时使用 ; 临时使用 Source: "..\..\x86\Release\CTSRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion Source: "..\..\x86\Release\CTSCheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode Source: "..\..\x64\Release\CTSCheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
;Source: "..\..\x86\Release\CTSRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
;Source: "..\..\x86\Release\CTSCheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
;Source: "..\..\x64\Release\CTSCheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
[INI] [INI]
@ -172,9 +166,12 @@ var
ErrorCode: Integer; ErrorCode: Integer;
ResultCode: Integer; ResultCode: Integer;
ResultStr: String; ResultStr: String;
UninstallContinue: Boolean;
CmdStr: String;
begin begin
Result := false; Result := false;
globalInstallPath := GetInstallString(); globalInstallPath := GetInstallString();
CmdStr := GetCmdTail();
ExtractTemporaryFile('CTSRemoveOldApp.exe'); ExtractTemporaryFile('CTSRemoveOldApp.exe');
if Exec(ExpandConstant('{tmp}\CTSRemoveOldApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then if Exec(ExpandConstant('{tmp}\CTSRemoveOldApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin begin
@ -182,12 +179,20 @@ begin
begin begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ADE66CB2-15FD-4BF8-BFA7-ED3E239C9ACE}_is1', 'UninstallString', ResultStr) then if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ADE66CB2-15FD-4BF8-BFA7-ED3E239C9ACE}_is1', 'UninstallString', ResultStr) then
begin begin
if MsgBox('扫描软件已安装,是否卸载原版本?', mbConfirmation, MB_YESNO) = IDYES then UninstallContinue := true;
if Pos('/verysilent', CmdStr) = 0 then
begin
if MsgBox('扫描软件已安装,是否卸载原版本?', mbConfirmation, MB_YESNO) <> IDYES then
begin
UninstallContinue := false;
end
end
if UninstallContinue then
begin begin
ResultStr := RemoveQuotes(ResultStr); ResultStr := RemoveQuotes(ResultStr);
if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin begin
if 0 = ResultCode then if 0 = ResultCode then
begin begin
Sleep(1000) Sleep(1000)
Result := true; Result := true;

View File

@ -229,9 +229,12 @@ var
ErrorCode: Integer; ErrorCode: Integer;
ResultCode: Integer; ResultCode: Integer;
ResultStr: String; ResultStr: String;
UninstallContinue: Boolean;
CmdStr: String;
begin begin
Result := false; Result := false;
globalInstallPath := GetInstallString(); globalInstallPath := GetInstallString();
CmdStr := GetCmdTail();
ExtractTemporaryFile('HWRemoveOldApp.exe'); ExtractTemporaryFile('HWRemoveOldApp.exe');
if Exec(ExpandConstant('{tmp}\HWRemoveOldApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then if Exec(ExpandConstant('{tmp}\HWRemoveOldApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin begin
@ -239,12 +242,20 @@ begin
begin begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4486975C-CBCF-430B-BED1-427866D1738E}_is1', 'UninstallString', ResultStr) then if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4486975C-CBCF-430B-BED1-427866D1738E}_is1', 'UninstallString', ResultStr) then
begin begin
if MsgBox('扫描软件已安装,是否卸载原版本?', mbConfirmation, MB_YESNO) = IDYES then UninstallContinue := true;
if Pos('/verysilent', CmdStr) = 0 then
begin
if MsgBox('扫描软件已安装,是否卸载原版本?', mbConfirmation, MB_YESNO) <> IDYES then
begin
UninstallContinue := false;
end
end
if UninstallContinue then
begin begin
ResultStr := RemoveQuotes(ResultStr); ResultStr := RemoveQuotes(ResultStr);
if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin begin
if 0 = ResultCode then if 0 = ResultCode then
begin begin
Sleep(1000) Sleep(1000)
Result := true; Result := true;

View File

@ -221,9 +221,12 @@ var
ErrorCode: Integer; ErrorCode: Integer;
ResultCode: Integer; ResultCode: Integer;
ResultStr: String; ResultStr: String;
UninstallContinue: Boolean;
CmdStr: String;
begin begin
Result := false; Result := false;
globalInstallPath := GetInstallString(); globalInstallPath := GetInstallString();
CmdStr := GetCmdTail();
ExtractTemporaryFile('HGRemoveOldApp.exe'); ExtractTemporaryFile('HGRemoveOldApp.exe');
if Exec(ExpandConstant('{tmp}\HGRemoveOldApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then if Exec(ExpandConstant('{tmp}\HGRemoveOldApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin begin
@ -231,12 +234,20 @@ begin
begin begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7076DC53-5C2F-4216-9783-2A6F954FEB3E}_is1', 'UninstallString', ResultStr) then if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7076DC53-5C2F-4216-9783-2A6F954FEB3E}_is1', 'UninstallString', ResultStr) then
begin begin
if MsgBox('扫描软件已安装,是否卸载原版本?', mbConfirmation, MB_YESNO) = IDYES then UninstallContinue := true;
if Pos('/verysilent', CmdStr) = 0 then
begin
if MsgBox('扫描软件已安装,是否卸载原版本?', mbConfirmation, MB_YESNO) <> IDYES then
begin
UninstallContinue := false;
end
end
if UninstallContinue then
begin begin
ResultStr := RemoveQuotes(ResultStr); ResultStr := RemoveQuotes(ResultStr);
if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin begin
if 0 = ResultCode then if 0 = ResultCode then
begin begin
Sleep(1000) Sleep(1000)
Result := true; Result := true;

View File

@ -169,9 +169,12 @@ var
ErrorCode: Integer; ErrorCode: Integer;
ResultCode: Integer; ResultCode: Integer;
ResultStr: String; ResultStr: String;
UninstallContinue: Boolean;
CmdStr: String;
begin begin
Result := false; Result := false;
globalInstallPath := GetInstallString(); globalInstallPath := GetInstallString();
CmdStr := GetCmdTail();
ExtractTemporaryFile('LSCRemoveOldApp.exe'); ExtractTemporaryFile('LSCRemoveOldApp.exe');
if Exec(ExpandConstant('{tmp}\LSCRemoveOldApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then if Exec(ExpandConstant('{tmp}\LSCRemoveOldApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin begin
@ -179,12 +182,20 @@ begin
begin begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F2890F43-A51C-4379-BB79-992616B1D6BD}_is1', 'UninstallString', ResultStr) then if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F2890F43-A51C-4379-BB79-992616B1D6BD}_is1', 'UninstallString', ResultStr) then
begin begin
if MsgBox('扫描软件已安装,是否卸载原版本?', mbConfirmation, MB_YESNO) = IDYES then UninstallContinue := true;
if Pos('/verysilent', CmdStr) = 0 then
begin
if MsgBox('扫描软件已安装,是否卸载原版本?', mbConfirmation, MB_YESNO) <> IDYES then
begin
UninstallContinue := false;
end
end
if UninstallContinue then
begin begin
ResultStr := RemoveQuotes(ResultStr); ResultStr := RemoveQuotes(ResultStr);
if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin begin
if 0 = ResultCode then if 0 = ResultCode then
begin begin
Sleep(1000) Sleep(1000)
Result := true; Result := true;