删除老旧windows打包文件

This commit is contained in:
yangjiaxuan 2024-02-20 16:41:07 +08:00
parent b4acd8c042
commit 9b2e453253
8 changed files with 0 additions and 2330 deletions

View File

@ -1,306 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "沧田扫描软件"
#define MyAppVersion GetFileVersion('..\..\x64\OEM\cumtenn\sane.dll')
#define MyAppSetupName "CumtennScan_App_Setup"
#define MyAppDefSetupDir "CumtennScan"
#define MyAppPublisher "浙江沧田智能信息科技有限公司"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{ADE66CB2-15FD-4BF8-BFA7-ED3E239C9ACE}
AppName={#MyAppName}
AppVerName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppDefSetupDir}
DefaultGroupName={#MyAppName}
VersionInfoVersion={#MyAppVersion}
OutputDir=..\..\package
OutputBaseFilename={#MyAppSetupName}_{#MyAppVersion}
Compression=lzma
AppPublisher={#MyAppPublisher}
SolidCompression=no
UninstallIconFile=uninstall.ico
SetupIconFile=CumtennScan_App.ico
LicenseFile=CumtennScan_App_License.txt
AlwaysShowComponentsList=true
ArchitecturesInstallIn64BitMode=x64
;PrivilegesRequired=admin
DisableWelcomePage=no
[Languages]
Name: "zn"; MessagesFile: "compiler:Languages/ChineseSimp.isl"
[Components]
;Name: "Upgrade"; Description: "在线升级功能" ; Types: Full
Name: "TwainG138"; Description: "CUMTENNSCAN G138 TWAIN" ; Types: Full
Name: "TwainG238"; Description: "CUMTENNSCAN G238 TWAIN" ; Types: Full
Name: "TwainG6005"; Description: "CUMTENNSCAN G6005 TWAIN" ; Types: Full
Name: "TwainG6006"; Description: "CUMTENNSCAN G6006 TWAIN" ; Types: Full
[Files]
; app
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
; app32
Source: "..\..\x86\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\CumtennScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
;Source: "..\..\x86\Release\CTSUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hasp_windows_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\CTSBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\CTSImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\CTSImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
;Source: "..\..\x86\Release\CTSVersion.dll"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\VC++\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\cumtenn\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\cumtenn\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\cumtenn\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: not Is64BitInstallMode
; app64
Source: "..\..\x64\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\CumtennScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
;Source: "..\..\x64\Release\CTSUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: Is64BitInstallMode
Source: "..\..\x64\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hasp_windows_x64_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\CTSBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\CTSImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\CTSImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
;Source: "..\..\x64\Release\CTSVersion.dll"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\VC++\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\zlib.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\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
; twain32 Source: "..\..\..\..\code_app\doc\scanner\CumtennScan_scanSettings_Help_manual.pdf"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\VC++\*.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\cumtenn\sane.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\cumtenn\scanner.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\cumtenn\lang.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{win}\twain_32\CumtennTwain\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\CTSBase.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\CTSImgFmt.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\CTSImgProc.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\CTSVersion.dll"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{win}\twain_32\CumtennTwain\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\cumtenn\cumtenntwain138.ds"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Components: TwainG138;
Source: "..\..\x86\OEM\cumtenn\cumtenntwain238.ds"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Components: TwainG238;
Source: "..\..\x86\OEM\cumtenn\cumtenntwain6005.ds"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Components: TwainG6005;
Source: "..\..\x86\OEM\cumtenn\cumtenntwain6006.ds"; DestDir: "{win}\twain_32\CumtennTwain\"; Flags: ignoreversion; Components: TwainG6006;
; twain64
Source: "..\..\x64\OEM\cumtenn\cumtenntwain138.ds"; DestDir: "{win}\twain_64\CumtennTwain\"; Flags: ignoreversion; Components: TwainG138; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\cumtenn\cumtenntwain238.ds"; DestDir: "{win}\twain_64\CumtennTwain\"; Flags: ignoreversion; Components: TwainG238; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\cumtenn\cumtenntwain6005.ds"; DestDir: "{win}\twain_64\CumtennTwain\"; Flags: ignoreversion; Components: TwainG6005; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\cumtenn\cumtenntwain6006.ds"; DestDir: "{win}\twain_64\CumtennTwain\"; Flags: ignoreversion; Components: TwainG6006; Check: Is64BitInstallMode
;拷贝驱动
Source: "..\..\usb\cumtenn\ctsusbscan.inf"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
Source: "..\..\usb\cumtenn\ctsusbscan.cat"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
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: "..\..\x86\Release\RemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion Source: "..\..\x86\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode Source: "..\..\x64\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
[INI]
[Icons]
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\CumtennScan.exe"
Name: "{group}\{#MyAppName}"; Filename: "{app}\CumtennScan.exe"
Name: "{group}\沧田扫描软件帮助文档"; Filename: "{app}\CumtennScan_App_Help_manual.pdf"
Name: "{group}\卸载"; Filename: "{uninstallexe}";
[Registry]
Root: HKLM; Subkey: "Software\CumtennScan"; ValueType: string; ValueName: "AppDirectory"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\CumtennScan"; ValueType: string; ValueName: "Application"; ValueData: "{app}\CumtennScan.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\CumtennScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\CumtennScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{app}"; Flags: uninsdeletekey; Check: not Is64BitInstallMode
Root: HKLM; Subkey: "Software\CumtennScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\CumtennTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\CumtennScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{app}"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\CumtennScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\CumtennTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\CumtennScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{app}"; Flags: uninsdeletekey; Check: Is64BitInstallMode
[Code]
var
globalInstallPath: String;
//初始化时把路径设置到编辑框
procedure InitializeWizard;
begin
WizardForm.DirEdit.Text := globalInstallPath;
end;
function GetInstallString(): String;
var
InstallPath: String;
begin
InstallPath := ExpandConstant('{pf}\{#MyAppDefSetupDir}');
if RegValueExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ADE66CB2-15FD-4BF8-BFA7-ED3E239C9ACE}_is1', 'Inno Setup: App Path') then
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ADE66CB2-15FD-4BF8-BFA7-ED3E239C9ACE}_is1', 'Inno Setup: App Path', InstallPath)
end
result := InstallPath;
end;
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
ResultCode: Integer;
ResultStr: String;
UninstallContinue: Boolean;
CmdStr: String;
begin
Result := false;
globalInstallPath := GetInstallString();
CmdStr := GetCmdTail();
ExtractTemporaryFile('RemoveOldApp.exe');
if Exec(ExpandConstant('{tmp}\RemoveOldApp.exe'), 'OEM_CANGTIAN', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ADE66CB2-15FD-4BF8-BFA7-ED3E239C9ACE}_is1', 'UninstallString', ResultStr) then
begin
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
ResultStr := RemoveQuotes(ResultStr);
if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
if 0 = ResultCode then
begin
Sleep(1000)
Result := true;
end
end
end
end
else
begin
Result := true;
end
end
else if 2 = ErrorCode then
begin
MsgBox('请先关闭旧版扫描软件!', mbInformation, MB_OK);
end
else
begin
MsgBox('卸载旧版扫描软件失败,停止安装!', mbInformation, MB_OK);
end
end
end;
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{ADE66CB2-15FD-4BF8-BFA7-ED3E239C9ACE}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
begin
Result := false;
if Exec(ExpandConstant('{app}\CheckNewApp.exe'), 'OEM_CANGTIAN', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
Result := true;
end
else
begin
MsgBox('请先关闭扫描软件!', mbInformation, MB_OK);
end
end
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{app}\CumtennScan_App.ico'));
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep:TUninstallStep);
begin
if CurUninstallStep = usDone then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
DelTree(ExpandConstant('{win}\twain_32\CumtennTwain'), True, True, True);
DelTree(ExpandConstant('{win}\twain_64\CumtennTwain'), True, True, True);
end;
end;
[Run]
Filename: "{app}\DPInst32"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: not IsWin64
Filename: "{app}\DPInst64"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: IsWin64
;Filename: "{app}\CTSUpgradeApp.exe"; Parameters:"-type=postinstallinfo -appName=Scanner -oemName=Cumtenn -desc=install/upgrade"; Components: Upgrade
Filename: "{app}\CumtennScan.exe"; Description: "{cm:LaunchProgram, {#MyAppName}}"; Flags: postinstall nowait skipifsilent
[UninstallRun]
; 卸载驱动 ;Filename: "{app}\DPInst32"; Parameters: "/u ""{app}\driver\cumtennusba3.inf"" /q /d"; Check: not IsWin64 ;Filename: "{app}\DPInst64"; Parameters: "/u ""{app}\driver\cumtennusba3.inf"" /q /d"; Check: IsWin64
;Filename: "{app}\DPInst32"; Parameters: "/u ""{app}\driver\cumtennusba4.inf"" /q /d"; Check: not IsWin64
;Filename: "{app}\DPInst64"; Parameters: "/u ""{app}\driver\cumtennusba4.inf"" /q /d"; Check: IsWin64

View File

@ -1,319 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "汉王扫描软件"
#define MyAppVersion GetFileVersion('..\..\x64\OEM\hanvon\sane.dll')
#define MyAppSetupName "HanvonScan_App_Setup"
#define MyAppDefSetupDir "HanvonScan"
#define MyAppPublisher "汉王科技股份有限公司"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{4486975C-CBCF-430B-BED1-427866D1738E}
AppName={#MyAppName}
AppVerName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppDefSetupDir}
DefaultGroupName={#MyAppName}
VersionInfoVersion={#MyAppVersion}
OutputDir=..\..\package
OutputBaseFilename={#MyAppSetupName}_{#MyAppVersion} Compression=lzma
AppPublisher={#MyAppPublisher} SolidCompression=no
UninstallIconFile=uninstall.ico
SetupIconFile=HanvonScan_App.ico
LicenseFile=HanvonScan_App_License.txt
AlwaysShowComponentsList=true
ArchitecturesInstallIn64BitMode=x64
;PrivilegesRequired=admin
DisableWelcomePage=no
[Languages]
Name: "zn"; MessagesFile: "compiler:Languages/ChineseSimp.isl"
[Components]
;Name: "Upgrade"; Description: "在线升级功能" ; Types: Full
Name: "Twain1000"; Description: "Hanvon HW-1000NS" ; Types: Full
Name: "Twain1002"; Description: "Hanvon HW-1000" ; Types: Full
Name: "Twain7000"; Description: "Hanvon HW-7000NS" ; Types: Full
Name: "Twain7002"; Description: "Hanvon HW-7000" ; Types: Full
Name: "Twain7039"; Description: "Hanvon HW-7039NS" ; Types: Full
Name: "Twain8000"; Description: "Hanvon HW-8000" ; Types: Full
Name: "Twain9000"; Description: "Hanvon HW-9000" ; Types: Full
[Files]
; app
Source: ".\HanvonScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\HanvonScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\HanvonScan_scanSettings_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
; app32
Source: "..\..\x86\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HanvonScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
;Source: "..\..\x86\Release\HWUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hasp_windows_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HWBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HWImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HWImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
;Source: "..\..\x86\Release\HWVersion.dll"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\hanvon\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\hanvon\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\hanvon\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: not Is64BitInstallMode
; app64
Source: "..\..\x64\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HanvonScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
;Source: "..\..\x64\Release\HWUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: Is64BitInstallMode
Source: "..\..\x64\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hasp_windows_x64_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HWBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HWImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HWImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
;Source: "..\..\x64\Release\HWVersion.dll"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\hanvon\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\hanvon\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\hanvon\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
; twain32
Source: "..\..\..\..\code_app\doc\scanner\HanvonScan_scanSettings_Help_manual.pdf"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\VC++\*"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\hanvon\sane.dll"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\hanvon\scanner.dll"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\hanvon\lang.dll"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{win}\twain_32\HanvonTwain\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\HWBase.dll"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\HWImgFmt.dll"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\HWImgProc.dll"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\HWVersion.dll"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{win}\twain_32\HanvonTwain\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\hanvon\hanvontwain1000.ds"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Components: Twain1000;
Source: "..\..\x86\OEM\hanvon\hanvontwain1002.ds"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Components: Twain1002;
Source: "..\..\x86\OEM\hanvon\hanvontwain7000.ds"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Components: Twain7000;
Source: "..\..\x86\OEM\hanvon\hanvontwain7002.ds"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Components: Twain7002;
Source: "..\..\x86\OEM\hanvon\hanvontwain7039.ds"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Components: Twain7039;
Source: "..\..\x86\OEM\hanvon\hanvontwain8000.ds"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Components: Twain8000;
Source: "..\..\x86\OEM\hanvon\hanvontwain9000.ds"; DestDir: "{win}\twain_32\HanvonTwain\"; Flags: ignoreversion; Components: Twain9000;
; twain64
Source: "..\..\x64\OEM\hanvon\hanvontwain1000.ds"; DestDir: "{win}\twain_64\HanvonTwain\"; Flags: ignoreversion; Components: Twain1000; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\hanvon\hanvontwain1002.ds"; DestDir: "{win}\twain_64\HanvonTwain\"; Flags: ignoreversion; Components: Twain1002; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\hanvon\hanvontwain7000.ds"; DestDir: "{win}\twain_64\HanvonTwain\"; Flags: ignoreversion; Components: Twain7000; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\hanvon\hanvontwain7002.ds"; DestDir: "{win}\twain_64\HanvonTwain\"; Flags: ignoreversion; Components: Twain7002; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\hanvon\hanvontwain7039.ds"; DestDir: "{win}\twain_64\HanvonTwain\"; Flags: ignoreversion; Components: Twain7039; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\hanvon\hanvontwain8000.ds"; DestDir: "{win}\twain_64\HanvonTwain\"; Flags: ignoreversion; Components: Twain8000; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\hanvon\hanvontwain9000.ds"; DestDir: "{win}\twain_64\HanvonTwain\"; Flags: ignoreversion; Components: Twain9000; Check: Is64BitInstallMode
;拷贝驱动
Source: "..\..\usb\hanvon\hanvonusbscan.inf"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
Source: "..\..\usb\hanvon\hanvonusbscan.cat"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
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: "..\..\x86\Release\RemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x64\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
[INI]
[Icons]
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\HanvonScan.exe"
Name: "{group}\{#MyAppName}"; Filename: "{app}\HanvonScan.exe"
Name: "{group}\汉王扫描软件帮助文档"; Filename: "{app}\HanvonScan_App_Help_manual.pdf"
Name: "{group}\卸载"; Filename: "{uninstallexe}";
[Registry]
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "AppDirectory"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "Application"; ValueData: "{app}\HanvonScan.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{app}"; Flags: uninsdeletekey; Check: not Is64BitInstallMode
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\HanvonTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{app}"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\HanvonScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\HanvonTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\HanvonScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{app}"; Flags: uninsdeletekey; Check: Is64BitInstallMode
[Code]
var
globalInstallPath: String;
//初始化时把路径设置到编辑框
procedure InitializeWizard;
begin
WizardForm.DirEdit.Text := globalInstallPath;
end;
function GetInstallString(): String;
var
InstallPath: String;
begin
InstallPath := ExpandConstant('{pf}\{#MyAppDefSetupDir}');
if RegValueExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4486975C-CBCF-430B-BED1-427866D1738E}_is1', 'Inno Setup: App Path') then
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4486975C-CBCF-430B-BED1-427866D1738E}_is1', 'Inno Setup: App Path', InstallPath)
end
result := InstallPath;
end;
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
ResultCode: Integer;
ResultStr: String;
UninstallContinue: Boolean;
CmdStr: String;
begin
Result := false;
globalInstallPath := GetInstallString();
CmdStr := GetCmdTail();
ExtractTemporaryFile('RemoveOldApp.exe');
if Exec(ExpandConstant('{tmp}\RemoveOldApp.exe'), 'OEM_HANWANG', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4486975C-CBCF-430B-BED1-427866D1738E}_is1', 'UninstallString', ResultStr) then
begin
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
ResultStr := RemoveQuotes(ResultStr);
if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
if 0 = ResultCode then
begin
Sleep(1000)
Result := true;
end
end
end
end
else
begin
Result := true;
end
end
else if 2 = ErrorCode then
begin
MsgBox('请先关闭旧版扫描软件!', mbInformation, MB_OK);
end
else
begin
MsgBox('卸载旧版扫描软件失败,停止安装!', mbInformation, MB_OK);
end
end
end;
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{4486975C-CBCF-430B-BED1-427866D1738E}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
begin
Result := false;
if Exec(ExpandConstant('{app}\CheckNewApp.exe'), 'OEM_HANWANG', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
Result := true;
end
else
begin
MsgBox('请先关闭扫描软件!', mbInformation, MB_OK);
end
end
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{app}\HanvonScan_App.ico'));
DelTree(ExpandConstant('{win}\twain_32\HanvonTwain\x86'), True, True, True);
DelTree(ExpandConstant('{win}\twain_32\HanvonTwain\x64'), True, True, True);
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep:TUninstallStep);
begin
if CurUninstallStep = usDone then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
DelTree(ExpandConstant('{win}\twain_32\HanvonTwain'), True, True, True);
DelTree(ExpandConstant('{win}\twain_64\HanvonTwain'), True, True, True);
end;
end;
[Run]
Filename: "{app}\DPInst32"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: not IsWin64
Filename: "{app}\DPInst64"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: IsWin64
;Filename: "{app}\HWUpgradeApp.exe"; Parameters:"-type=postinstallinfo -appName=Scanner -oemName=Hanvon -desc=install/upgrade"; Components: Upgrade
Filename: "{app}\HanvonScan.exe"; Description: "{cm:LaunchProgram, {#MyAppName}}"; Flags: postinstall nowait skipifsilent
[UninstallRun]
; 卸载驱动
;Filename: "{app}\DPInst32"; Parameters: "/u ""{app}\driver\hanvonusbscan.inf"" /q /d"; Check: not IsWin64 ;Filename: "{app}\DPInst64"; Parameters: "/u ""{app}\driver\hanvonusbscan.inf"" /q /d"; Check: IsWin64

View File

@ -1,351 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppVersion GetFileVersion('..\..\x64\OEM\huagao\sane.dll')
#define MyAppSetupName "HuaGoScan_App_Setup"
#define MyAppDefSetupDir "HuaGoScan"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{7076DC53-5C2F-4216-9783-2A6F954FEB3E}
AppName={cm:MyAppName}
AppVerName={cm:MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppDefSetupDir}
DefaultGroupName={cm:MyAppName}
VersionInfoVersion={#MyAppVersion}
OutputDir=..\..\package
OutputBaseFilename={#MyAppSetupName}_{#MyAppVersion}
Compression=lzma
AppPublisher={cm:MyAppPublisher}
SolidCompression=no
UninstallIconFile=uninstall.ico
SetupIconFile=HuaGoScan_App.ico
LicenseFile=HuaGoScan_App_License.txt
AlwaysShowComponentsList=true
ArchitecturesInstallIn64BitMode=x64
;PrivilegesRequired=admin
DisableWelcomePage=no
;ShowLanguageDialog=yes
;ShowUndisplayableLanguages=yes
[Languages] ;Name: "english"; MessagesFile: "compiler:Languages/English.isl"; LicenseFile:HuaGoScan_App_License_En.txt
Name: "chinese_simp"; MessagesFile: "compiler:Languages/ChineseSimp.isl"; LicenseFile:HuaGoScan_App_License.txt ;Name: "chinese_trad"; MessagesFile: "compiler:Languages/ChineseTrad.isl"; LicenseFile:HuaGoScan_App_License_Cn_Tr.txt
[CustomMessages]
; english
;english.MyAppName=Huago Scanning Software
;english.MyAppPublisher=Ningbo Huagao Information Technology Co., Ltd
;english.MyStr1=The scanning software has been installed. Do you want to uninstall the original version?
;english.MyStr2=Please close the old scanning software first!
;english.MyStr3=Failed to uninstall the old scanning software, stop installing!
;english.MyStr4=Please close the scanning software first!
; chinese_simp
chinese_simp.MyAppName=华高扫描软件
chinese_simp.MyAppPublisher=宁波华高信息科技有限公司
chinese_simp.MyStr1=扫描软件已安装,是否卸载原版本?
chinese_simp.MyStr2=请先关闭旧版扫描软件!
chinese_simp.MyStr3=卸载旧版扫描软件失败,停止安装!
chinese_simp.MyStr4=请先关闭扫描软件!
; chinese_trad
;chinese_trad.MyAppName=華高掃描軟件
;chinese_trad.MyAppPublisher=寧波華高資訊科技有限公司
;chinese_trad.MyStr1=掃描軟件已安裝,是否卸載原版本?
;chinese_trad.MyStr2=請先關閉舊版掃描軟件!
;chinese_trad.MyStr3=卸載舊版掃描軟件失敗,停止安裝!
;chinese_trad.MyStr4=請先關閉掃描軟件!
[Components]
;Name: "Upgrade"; Description: "Upgrade" ; Types: Full; Languages: english
Name: "Upgrade"; Description: "在线升级功能" ; Types: Full; Languages: chinese_simp
;Name: "Upgrade"; Description: "線上升級功能" ; Types: Full; Languages: chinese_trad
Name: "TwainG100"; Description: "HUAGOSCAN G100 TWAIN" ; Types: Full
Name: "TwainG200"; Description: "HUAGOSCAN G200 TWAIN" ; Types: Full
Name: "TwainG300"; Description: "HUAGOSCAN G300 TWAIN" ; Types: Full
Name: "TwainG400"; Description: "HUAGOSCAN G400 TWAIN" ; Types: Full
[Files]
; app
Source: ".\HuaGoScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\HuaGoScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\HuaGoScan_scanSettings_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
; app32
Source: "..\..\x86\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HuaGoScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HGUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: not Is64BitInstallMode Source: "..\..\x86\Release\HGFWUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hasp_windows_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HGBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HGImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HGImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HGVersion.dll"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\huagao\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\huagao\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\huagao\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: not Is64BitInstallMode
; app64
Source: "..\..\x64\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HuaGoScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HGUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HGFWUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hasp_windows_x64_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HGBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HGImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HGImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HGVersion.dll"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\huagao\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\huagao\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\huagao\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
; twain32
Source: "..\..\..\..\code_app\doc\scanner\HuaGoScan_scanSettings_Help_manual.pdf"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\VC++\*"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\huagao\sane.dll"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\huagao\scanner.dll"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\huagao\lang.dll"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{win}\twain_32\HuaGoTwain\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\HGBase.dll"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\HGImgFmt.dll"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\HGImgProc.dll"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\HGVersion.dll"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{win}\twain_32\HuaGoTwain\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\huagao\huagaotwain100.ds"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Components: TwainG100;
Source: "..\..\x86\OEM\huagao\huagaotwain200.ds"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Components: TwainG200;
Source: "..\..\x86\OEM\huagao\huagaotwain300.ds"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Components: TwainG300;
Source: "..\..\x86\OEM\huagao\huagaotwain400.ds"; DestDir: "{win}\twain_32\HuaGoTwain\"; Flags: ignoreversion; Components: TwainG400;
; twain64
Source: "..\..\x64\OEM\huagao\huagaotwain100.ds"; DestDir: "{win}\twain_64\HuaGoTwain\"; Flags: ignoreversion; Components: TwainG100; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\huagao\huagaotwain200.ds"; DestDir: "{win}\twain_64\HuaGoTwain\"; Flags: ignoreversion; Components: TwainG200; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\huagao\huagaotwain300.ds"; DestDir: "{win}\twain_64\HuaGoTwain\"; Flags: ignoreversion; Components: TwainG300; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\huagao\huagaotwain400.ds"; DestDir: "{win}\twain_64\HuaGoTwain\"; Flags: ignoreversion; Components: TwainG400; Check: Is64BitInstallMode
;拷贝驱动
Source: "..\..\usb\huagao\*.*"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
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: "..\..\x86\Release\RemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x64\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
[INI]
[Icons]
Name: "{commondesktop}\{cm:MyAppName}"; Filename: "{app}\HuaGoScan.exe"
Name: "{group}\{cm:MyAppName}"; Filename: "{app}\HuaGoScan.exe" Name: "{group}\华高扫描仪维护工具"; Filename: "{app}\HGFWUpgradeApp.exe"
;Name: "{group}\Huago scanning software help document"; Filename: "{app}\HuaGoScan_App_Help_manual.pdf"; Languages: english
Name: "{group}\华高扫描软件帮助文档"; Filename: "{app}\HuaGoScan_App_Help_manual.pdf"; Languages: chinese_simp
;Name: "{group}\華高掃描軟件幫助文檔"; Filename: "{app}\HuaGoScan_App_Help_manual.pdf"; Languages: chinese_trad
;Name: "{group}\Uninstall"; Filename: "{uninstallexe}"; Languages: english
Name: "{group}\卸载"; Filename: "{uninstallexe}"; Languages: chinese_simp
;Name: "{group}\卸載"; Filename: "{uninstallexe}"; Languages: chinese_trad
[Registry]
Root: HKLM; Subkey: "Software\HuaGoScan"; ValueType: string; ValueName: "AppDirectory"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HuaGoScan"; ValueType: string; ValueName: "Application"; ValueData: "{app}\HuaGoScan.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HuaGoScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HuaGoScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{app}"; Flags: uninsdeletekey; Check: not Is64BitInstallMode
Root: HKLM; Subkey: "Software\HuaGoScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\HuaGoTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\HuaGoScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{app}"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\HuaGoScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\HuaGoTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\HuaGoScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{app}"; Flags: uninsdeletekey; Check: Is64BitInstallMode
[Code]
var
globalInstallPath: String;
procedure InitializeWizard;
begin
WizardForm.DirEdit.Text := globalInstallPath; end;
function GetInstallString(): String;
var
InstallPath: String;
begin
InstallPath := ExpandConstant('{pf}\{#MyAppDefSetupDir}');
if RegValueExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7076DC53-5C2F-4216-9783-2A6F954FEB3E}_is1', 'Inno Setup: App Path') then
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7076DC53-5C2F-4216-9783-2A6F954FEB3E}_is1', 'Inno Setup: App Path', InstallPath)
end
result := InstallPath; end;
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
ResultCode: Integer;
ResultStr: String;
UninstallContinue: Boolean;
CmdStr: String;
begin
Result := false;
globalInstallPath := GetInstallString();
CmdStr := GetCmdTail();
ExtractTemporaryFile('RemoveOldApp.exe');
if Exec(ExpandConstant('{tmp}\RemoveOldApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7076DC53-5C2F-4216-9783-2A6F954FEB3E}_is1', 'UninstallString', ResultStr) then
begin
UninstallContinue := true;
if Pos('/verysilent', CmdStr) = 0 then
begin
if MsgBox(ExpandConstant('{cm:MyStr1}'), mbConfirmation, MB_YESNO) <> IDYES then
begin
UninstallContinue := false;
end
end
if UninstallContinue then
begin
ResultStr := RemoveQuotes(ResultStr);
if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
if 0 = ResultCode then
begin
Sleep(1000)
Result := true;
end
end
end
end
else
begin
Result := true;
end
end
else if 2 = ErrorCode then
begin
MsgBox(ExpandConstant('{cm:MyStr2}'), mbInformation, MB_OK);
end
else
begin
MsgBox(ExpandConstant('{cm:MyStr3}'), mbInformation, MB_OK);
end
end
end;
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{7076DC53-5C2F-4216-9783-2A6F954FEB3E}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
begin
Result := false;
if Exec(ExpandConstant('{app}\CheckNewApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
ShellExec('', ExpandConstant('{app}\HGUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -oemName=Huago -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result := true;
end
else
begin
MsgBox(ExpandConstant('{cm:MyStr4}'), mbInformation, MB_OK);
end
end
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{app}\HuaGoScan_App.ico'));
DeleteFile(ExpandConstant('{win}\twain_32\HuaGoTwain\huagaotwain139.ds'));
DeleteFile(ExpandConstant('{win}\twain_32\HuaGoTwain\huagaotwain239.ds'));
DeleteFile(ExpandConstant('{win}\twain_32\HuaGoTwain\huagaotwain302.ds'));
DeleteFile(ExpandConstant('{win}\twain_32\HuaGoTwain\huagaotwain402.ds'));
DeleteFile(ExpandConstant('{win}\twain_32\HuaGoTwain\huagaotwain439.ds'));
DeleteFile(ExpandConstant('{win}\twain_64\HuaGoTwain\huagaotwain139.ds'));
DeleteFile(ExpandConstant('{win}\twain_64\HuaGoTwain\huagaotwain239.ds'));
DeleteFile(ExpandConstant('{win}\twain_64\HuaGoTwain\huagaotwain302.ds'));
DeleteFile(ExpandConstant('{win}\twain_64\HuaGoTwain\huagaotwain402.ds'));
DeleteFile(ExpandConstant('{win}\twain_64\HuaGoTwain\huagaotwain439.ds'));
DelTree(ExpandConstant('{win}\twain_32\HuaGoTwain\x86'), True, True, True);
DelTree(ExpandConstant('{win}\twain_32\HuaGoTwain\x64'), True, True, True);
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep:TUninstallStep);
begin
if CurUninstallStep = usDone then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
DelTree(ExpandConstant('{win}\twain_32\HuaGoTwain'), True, True, True);
DelTree(ExpandConstant('{win}\twain_64\HuaGoTwain'), True, True, True);
end;
end;
[Run]
Filename: "{app}\DPInst32"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: not IsWin64
Filename: "{app}\DPInst64"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: IsWin64
Filename: "{app}\HGUpgradeApp.exe"; Parameters:"-type=postinstallinfo -appName=Scanner -oemName=Huago -desc=install/upgrade"; Components: Upgrade
;Filename: "{app}\HuaGoScan.exe"; Description: "{cm:LaunchProgram, {cm:MyAppName}}"; Parameters:"-language=english"; Flags: postinstall nowait skipifsilent; Languages: english
Filename: "{app}\HuaGoScan.exe"; Description: "{cm:LaunchProgram, {cm:MyAppName}}"; Parameters:"-language=chinese"; Flags: postinstall nowait skipifsilent; Languages: chinese_simp
;Filename: "{app}\HuaGoScan.exe"; Description: "{cm:LaunchProgram, {cm:MyAppName}}"; Parameters:"-language=chinese-trad"; Flags: postinstall nowait skipifsilent; Languages: chinese_trad
[UninstallRun] ;Filename: "{app}\DPInst32"; Parameters: "/u ""{app}\driver\hgscannerusball.inf"" /q /d"; Check: not IsWin64 ;Filename: "{app}\DPInst64"; Parameters: "/u ""{app}\driver\hgscannerusball.inf"" /q /d"; Check: IsWin64

View File

@ -1,321 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "立思辰扫描软件"
#define MyAppVersion GetFileVersion('..\..\x64\OEM\lanxum\sane.dll')
#define MyAppSetupName "LanxumScan_App_Setup"
#define MyAppDefSetupDir "LanxumScan"
#define MyAppPublisher "立思辰信息科技有限公司"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{F2890F43-A51C-4379-BB79-992616B1D6BD}
AppName={#MyAppName}
AppVerName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppDefSetupDir}
DefaultGroupName={#MyAppName}
VersionInfoVersion={#MyAppVersion}
OutputDir=..\..\package
OutputBaseFilename={#MyAppSetupName}_{#MyAppVersion}
Compression=lzma
AppPublisher={#MyAppPublisher}
SolidCompression=no
UninstallIconFile=uninstall.ico
SetupIconFile=LanxumScan_App.ico
LicenseFile=LanxumScan_App_License.txt
AlwaysShowComponentsList=true
ArchitecturesInstallIn64BitMode=x64
;PrivilegesRequired=admin
DisableWelcomePage=no
[Languages]
Name: "zn"; MessagesFile: "compiler:Languages/ChineseSimp.isl"
[Components]
;Name: "Upgrade"; Description: "在线升级功能" ; Types: Full
Name: "TwainG42S"; Description: "LANXUMSCAN G42S TWAIN" ; Types: Full
Name: "TwainG52S"; Description: "LANXUMSCAN G52S TWAIN" ; Types: Full
Name: "TwainG62S"; Description: "LANXUMSCAN G62S TWAIN" ; Types: Full
Name: "TwainG73S"; Description: "LANXUMSCAN G73S TWAIN" ; Types: Full
[Files]
; app
Source: ".\LanxumScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\LanxumScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\LanxumScan_scanSettings_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
; app32
Source: "..\..\x86\Release\update.zip"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hasp_windows_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\LanxumScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
;Source: "..\..\x86\Release\LSCUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\LSCBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\LSCImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\LSCImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
;Source: "..\..\x86\Release\LSCVersion.dll"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\lanxum\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\lanxum\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\lanxum\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: not Is64BitInstallMode
; app64
Source: "..\..\x64\Release\update.zip"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hasp_windows_x64_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\LanxumScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
;Source: "..\..\x64\Release\LSCUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: Is64BitInstallMode
Source: "..\..\x64\Release\LSCBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\LSCImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\LSCImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
;Source: "..\..\x64\Release\LSCVersion.dll"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\lanxum\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\lanxum\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\lanxum\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
; twain32
Source: "..\..\..\..\code_app\doc\scanner\LanxumScan_scanSettings_Help_manual.pdf"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\VC++\*"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\lanxum\sane.dll"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\lanxum\scanner.dll"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\lanxum\lang.dll"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{win}\twain_32\LanxumTwain\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\LSCBase.dll"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\LSCImgFmt.dll"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\LSCImgProc.dll"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\LSCVersion.dll"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{win}\twain_32\LanxumTwain\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\lanxum\lanxumtwain8420.ds"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Components: TwainG42S;
Source: "..\..\x86\OEM\lanxum\lanxumtwain8520.ds"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Components: TwainG52S;
Source: "..\..\x86\OEM\lanxum\lanxumtwain8620.ds"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Components: TwainG62S;
Source: "..\..\x86\OEM\lanxum\lanxumtwain8730.ds"; DestDir: "{win}\twain_32\LanxumTwain\"; Flags: ignoreversion; Components: TwainG73S;
; twain64
Source: "..\..\x64\OEM\lanxum\lanxumtwain8420.ds"; DestDir: "{win}\twain_64\LanxumTwain\"; Flags: ignoreversion; Components: TwainG42S; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\lanxum\lanxumtwain8520.ds"; DestDir: "{win}\twain_64\LanxumTwain\"; Flags: ignoreversion; Components: TwainG52S; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\lanxum\lanxumtwain8620.ds"; DestDir: "{win}\twain_64\LanxumTwain\"; Flags: ignoreversion; Components: TwainG62S; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\lanxum\lanxumtwain8730.ds"; DestDir: "{win}\twain_64\LanxumTwain\"; Flags: ignoreversion; Components: TwainG73S; Check: Is64BitInstallMode
;拷贝驱动
Source: "..\..\usb\lanxum\lanxumusb.inf"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
Source: "..\..\usb\lanxum\lanxumusb.cat"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
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: "..\..\x86\Release\RemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x64\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
[INI]
[Icons]
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\LanxumScan.exe"
Name: "{group}\{#MyAppName}"; Filename: "{app}\LanxumScan.exe"
Name: "{group}\立思辰扫描软件帮助文档"; Filename: "{app}\LanxumScan_App_Help_manual.pdf"
Name: "{group}\卸载"; Filename: "{uninstallexe}";
[Registry]
Root: HKLM; Subkey: "Software\LanxumScan"; ValueType: string; ValueName: "AppDirectory"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\LanxumScan"; ValueType: string; ValueName: "Application"; ValueData: "{app}\LanxumScan.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\LanxumScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\LanxumScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{app}"; Flags: uninsdeletekey; Check: not Is64BitInstallMode
Root: HKLM; Subkey: "Software\LanxumScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\LanxumTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\LanxumScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{app}"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\LanxumScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\LanxumTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\LanxumScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{app}"; Flags: uninsdeletekey; Check: Is64BitInstallMode
[Code]
var
globalInstallPath: String;
//初始化时把路径设置到编辑框
procedure InitializeWizard;
begin
WizardForm.DirEdit.Text := globalInstallPath;
end;
function GetInstallString(): String;
var
InstallPath: String;
begin
InstallPath := ExpandConstant('{pf}\{#MyAppDefSetupDir}');
if RegValueExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F2890F43-A51C-4379-BB79-992616B1D6BD}_is1', 'Inno Setup: App Path') then
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F2890F43-A51C-4379-BB79-992616B1D6BD}_is1', 'Inno Setup: App Path', InstallPath)
end
result := InstallPath;
end;
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
ResultCode: Integer;
ResultStr: String;
UninstallContinue: Boolean;
CmdStr: String;
begin
Result := false;
globalInstallPath := GetInstallString();
CmdStr := GetCmdTail();
ExtractTemporaryFile('RemoveOldApp.exe');
if Exec(ExpandConstant('{tmp}\RemoveOldApp.exe'), 'OEM_LISICHENG', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F2890F43-A51C-4379-BB79-992616B1D6BD}_is1', 'UninstallString', ResultStr) then
begin
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
ResultStr := RemoveQuotes(ResultStr);
if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
if 0 = ResultCode then
begin
Sleep(1000)
Result := true;
end
end
end
end
else
begin
Result := true;
end
end
else if 2 = ErrorCode then
begin
MsgBox('请先关闭旧版扫描软件!', mbInformation, MB_OK);
end
else
begin
MsgBox('卸载旧版扫描软件失败,停止安装!', mbInformation, MB_OK);
end
end
end;
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{F2890F43-A51C-4379-BB79-992616B1D6BD}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
begin
Result := false;
if Exec(ExpandConstant('{app}\CheckNewApp.exe'), 'OEM_LISICHENG', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
Result := true;
end
else
begin
MsgBox('请先关闭扫描软件!', mbInformation, MB_OK);
end
end
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{app}\LanxumScan_App.ico'));
DeleteFile(ExpandConstant('{win}\twain_32\LanxumTwain\lanxumtwain8200.ds'));
DeleteFile(ExpandConstant('{win}\twain_32\LanxumTwain\lanxumtwain8429.ds'));
DeleteFile(ExpandConstant('{win}\twain_32\LanxumTwain\lanxumtwain8529.ds'));
DeleteFile(ExpandConstant('{win}\twain_32\LanxumTwain\lanxumtwain8629.ds'));
DeleteFile(ExpandConstant('{win}\twain_32\LanxumTwain\lanxumtwain8739.ds'));
DeleteFile(ExpandConstant('{win}\twain_64\LanxumTwain\lanxumtwain8200.ds'));
DeleteFile(ExpandConstant('{win}\twain_64\LanxumTwain\lanxumtwain8429.ds'));
DeleteFile(ExpandConstant('{win}\twain_64\LanxumTwain\lanxumtwain8529.ds'));
DeleteFile(ExpandConstant('{win}\twain_64\LanxumTwain\lanxumtwain8629.ds'));
DeleteFile(ExpandConstant('{win}\twain_64\LanxumTwain\lanxumtwain8739.ds'));
DelTree(ExpandConstant('{win}\twain_32\LanxumTwain\x86'), True, True, True);
DelTree(ExpandConstant('{win}\twain_32\LanxumTwain\x64'), True, True, True);
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep:TUninstallStep);
begin
if CurUninstallStep = usDone then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
DelTree(ExpandConstant('{win}\twain_32\LanxumTwain'), True, True, True);
DelTree(ExpandConstant('{win}\twain_64\LanxumTwain'), True, True, True);
end;
end;
[Run]
Filename: "{app}\DPInst32"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: not IsWin64
Filename: "{app}\DPInst64"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: IsWin64
;Filename: "{app}\LSCUpgradeApp.exe"; Parameters:"-type=postinstallinfo -appName=Scanner -oemName=Lanxum -desc=install/upgrade"; Components: Upgrade
Filename: "{app}\LanxumScan.exe"; Description: "{cm:LaunchProgram, {#MyAppName}}"; Flags: postinstall nowait skipifsilent
[UninstallRun]
; 卸载驱动 ;Filename: "{app}\DPInst32"; Parameters: "/u ""{app}\driver\lanxumusb.inf"" /q /d"; Check: not IsWin64 ;Filename: "{app}\DPInst64"; Parameters: "/u ""{app}\driver\lanxumusb.inf"" /q /d"; Check: IsWin64

View File

@ -1,298 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppVersion GetFileVersion('..\..\x64\OEM\microtek\sane.dll')
#define MyAppSetupName "Microtek DocWizard EX_App"
#define MyAppDefSetupDir "Microtek DocWizard EX"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{36868C39-B195-498B-BFAE-36125D55305E}
AppName={cm:MyAppName}
AppVerName={cm:MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppDefSetupDir}
DefaultGroupName={cm:MyAppName}
VersionInfoVersion={#MyAppVersion}
OutputDir=..\..\package
OutputBaseFilename={#MyAppSetupName}_{#MyAppVersion}
Compression=lzma
AppPublisher={cm:MyAppPublisher}
SolidCompression=no
UninstallIconFile=uninstall.ico
SetupIconFile=MicrotekScan_App.ico
LicenseFile=MicrotekScan_App_License.txt
AlwaysShowComponentsList=true
ArchitecturesInstallIn64BitMode=x64
;PrivilegesRequired=admin
DisableWelcomePage=no
ShowLanguageDialog=yes
ShowUndisplayableLanguages=yes
[Languages] Name: "english"; MessagesFile: "compiler:Languages/English.isl"; LicenseFile:MicrotekScan_App_License_En.txt
Name: "chinese_simp"; MessagesFile: "compiler:Languages/ChineseSimp.isl"; LicenseFile:MicrotekScan_App_License.txt ;Name: "chinese_trad"; MessagesFile: "compiler:Languages/ChineseTrad.isl"; LicenseFile:MicrotekScan_App_License_Cn_Tr.txt
[CustomMessages]
; english
english.MyAppName=Microtek DocWizard EX Scanner
english.MyAppPublisher=Shanghai Microtek Technology Co., Ltd
english.MyStr1=The scanning software has been installed. Do you want to uninstall the original version?
english.MyStr2=Please close the old scanning software first!
english.MyStr3=Failed to uninstall the old scanning software, stop installing!
english.MyStr4=Please close the scanning software first!
; chinese_simp
chinese_simp.MyAppName=Microtek DocWizard EX 扫描软件
chinese_simp.MyAppPublisher=上海中晶科技有限公司
chinese_simp.MyStr1=扫描软件已安装,是否卸载原版本?
chinese_simp.MyStr2=请先关闭旧版扫描软件!
chinese_simp.MyStr3=卸载旧版扫描软件失败,停止安装!
chinese_simp.MyStr4=请先关闭扫描软件!
; chinese_trad
;chinese_trad.MyAppName=Microtek DocWizard EX 掃描軟件
;chinese_trad.MyAppPublisher=上海中晶科技有限公司
;chinese_trad.MyStr1=掃描軟件已安裝,是否卸載原版本?
;chinese_trad.MyStr2=請先關閉舊版掃描軟件!
;chinese_trad.MyStr3=卸載舊版掃描軟件失敗,停止安裝!
;chinese_trad.MyStr4=請先關閉掃描軟件!
[Files]
; app
Source: ".\MicrotekScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion Source: "..\..\..\..\code_app\doc\scanner\MicrotekScan_App_Help_manual_EN.pdf"; DestDir: "{app}\"; Flags: ignoreversion; Source: "..\..\..\..\code_app\doc\scanner\MicrotekScan_scanSettings_Help_manual_EN.pdf"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\..\..\code_app\doc\scanner\MicrotekScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\..\..\code_app\doc\scanner\MicrotekScan_scanSettings_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\x86\Release\microtek-settings\*"; DestDir: "{app}\settings\"; Flags: ignoreversion recursesubdirs
; app32
Source: "..\..\x86\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hasp_windows_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\MicrotekScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ZJBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ZJImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ZJImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\microtek\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\microtek\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\microtek\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: not Is64BitInstallMode
; app64
Source: "..\..\x64\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hasp_windows_x64_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\MicrotekScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ZJBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ZJImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ZJImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\microtek\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\microtek\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\microtek\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
;拷贝驱动
Source: "..\..\usb\microtek\Microtek_A3_scanner_usb.inf"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
Source: "..\..\usb\microtek\Microtek_A3_scanner_usb.cat"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
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: "..\..\x86\Release\RemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x64\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
[INI]
[Icons]
Name: "{commondesktop}\{cm:MyAppName}"; Filename: "{app}\MicrotekScan.exe"
Name: "{group}\{cm:MyAppName}"; Filename: "{app}\MicrotekScan.exe"
;Name: "{group}\Microtek after-sales tools"; Filename: "{app}\microtek-tool\After_sales_tool.exe"; Languages: english
;Name: "{group}\中晶售后工具"; Filename: "{app}\microtek-tool\After_sales_tool.exe"; Languages: chinese_simp
;Name: "{group}\中晶售後工具"; Filename: "{app}\microtek-tool\After_sales_tool.exe"; Languages: chinese_trad
Name: "{group}\Microtek DocWizard EX Scanner help document"; Filename: "{app}\MicrotekScan_App_Help_manual.pdf"; Languages: english
Name: "{group}\中晶扫描软件帮助文档"; Filename: "{app}\MicrotekScan_App_Help_manual.pdf"; Languages: chinese_simp
;Name: "{group}\中晶掃描軟件幫助文檔"; Filename: "{app}\MicrotekScan_App_Help_manual.pdf"; Languages: chinese_trad
Name: "{group}\Uninstall"; Filename: "{uninstallexe}"; Languages: english
Name: "{group}\卸载"; Filename: "{uninstallexe}"; Languages: chinese_simp
;Name: "{group}\卸載"; Filename: "{uninstallexe}"; Languages: chinese_trad
[Registry]
Root: HKLM; Subkey: "Software\MicrotekScan"; ValueType: string; ValueName: "AppDirectory"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\MicrotekScan"; ValueType: string; ValueName: "Application"; ValueData: "{app}\MicrotekScan.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\MicrotekScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
[Code]
var
globalInstallPath: String;
procedure InitializeWizard;
begin
WizardForm.DirEdit.Text := globalInstallPath; end;
function GetInstallString(): String;
var
InstallPath: String;
begin
InstallPath := ExpandConstant('{pf}\{#MyAppDefSetupDir}');
if RegValueExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{36868C39-B195-498B-BFAE-36125D55305E}_is1', 'Inno Setup: App Path') then
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{36868C39-B195-498B-BFAE-36125D55305E}_is1', 'Inno Setup: App Path', InstallPath)
end
result := InstallPath; end;
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
ResultCode: Integer;
ResultStr: String;
UninstallContinue: Boolean;
CmdStr: String;
begin
Result := false;
globalInstallPath := GetInstallString();
CmdStr := GetCmdTail();
ExtractTemporaryFile('RemoveOldApp.exe');
if Exec(ExpandConstant('{tmp}\RemoveOldApp.exe'), 'OEM_ZHONGJING', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{36868C39-B195-498B-BFAE-36125D55305E}_is1', 'UninstallString', ResultStr) then
begin
UninstallContinue := true;
if Pos('/verysilent', CmdStr) = 0 then
begin
if MsgBox(ExpandConstant('{cm:MyStr1}'), mbConfirmation, MB_YESNO) <> IDYES then
begin
UninstallContinue := false;
end
end
if UninstallContinue then
begin
ResultStr := RemoveQuotes(ResultStr);
if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
if 0 = ResultCode then
begin
Sleep(1000)
Result := true;
end
end
end
end
else
begin
Result := true;
end
end
else if 2 = ErrorCode then
begin
MsgBox(ExpandConstant('{cm:MyStr2}'), mbInformation, MB_OK);
end
else
begin
MsgBox(ExpandConstant('{cm:MyStr3}'), mbInformation, MB_OK);
end
end
end;
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{36868C39-B195-498B-BFAE-36125D55305E}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
begin
Result := false;
if Exec(ExpandConstant('{app}\CheckNewApp.exe'), 'OEM_ZHONGJING', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
Result := true;
end
else
begin
MsgBox(ExpandConstant('{cm:MyStr4}'), mbInformation, MB_OK);
end
end
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{app}\MicrotekScan_App.ico'));
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep:TUninstallStep);
begin
if CurUninstallStep = usDone then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
end;
end;
[Run]
Filename: "{app}\DPInst32"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: not IsWin64
Filename: "{app}\DPInst64"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: IsWin64
Filename: "{app}\MicrotekScan.exe"; Description: "{cm:LaunchProgram, {cm:MyAppName}}"; Parameters:"-language=english"; Flags: postinstall nowait skipifsilent; Languages: english
Filename: "{app}\MicrotekScan.exe"; Description: "{cm:LaunchProgram, {cm:MyAppName}}"; Parameters:"-language=chinese"; Flags: postinstall nowait skipifsilent; Languages: chinese_simp
;Filename: "{app}\MicrotekScan.exe"; Description: "{cm:LaunchProgram, {cm:MyAppName}}"; Parameters:"-language=chinese-trad"; Flags: postinstall nowait skipifsilent; Languages: chinese_trad
[UninstallRun] ;Filename: "{app}\DPInst32"; Parameters: "/u ""{app}\driver\Microtek_A3_scanner_usb.inf"" /q /d"; Check: not IsWin64 ;Filename: "{app}\DPInst64"; Parameters: "/u ""{app}\driver\Microtek_A3_scanner_usb.inf"" /q /d"; Check: IsWin64

View File

@ -1,134 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppVersion GetFileVersion('..\..\x64\OEM\microtek\sane.dll')
#define MyAppSetupName "Microtek DocWizard EX_TWAIN"
#define MyAppDefSetupDir "Microtek DocWizard EX"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{DDE9139A-3298-4CB8-BB31-755A1F158D93}
AppName={cm:MyAppName}
AppVerName={cm:MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppDefSetupDir}
DefaultGroupName={cm:MyAppName}
VersionInfoVersion={#MyAppVersion}
OutputDir=..\..\package
OutputBaseFilename={#MyAppSetupName}_{#MyAppVersion}
Compression=lzma
AppPublisher={cm:MyAppPublisher}
SolidCompression=no
UninstallIconFile=uninstall.ico
SetupIconFile=MicrotekScan_App.ico
LicenseFile=MicrotekScan_App_License.txt
AlwaysShowComponentsList=true
ArchitecturesInstallIn64BitMode=x64
;PrivilegesRequired=admin
DisableWelcomePage=no
ShowLanguageDialog=yes
ShowUndisplayableLanguages=yes
DisableDirPage=yes
[Languages] Name: "english"; MessagesFile: "compiler:Languages/English.isl"; LicenseFile:MicrotekScan_App_License_En.txt
Name: "chinese_simp"; MessagesFile: "compiler:Languages/ChineseSimp.isl"; LicenseFile:MicrotekScan_App_License.txt ;Name: "chinese_trad"; MessagesFile: "compiler:Languages/ChineseTrad.isl"; LicenseFile:MicrotekScan_App_License_Cn_Tr.txt
[CustomMessages]
; english
english.MyAppName=Microtek DocWizard EX TWAIN
english.MyAppPublisher=Shanghai Microtek Technology Co., Ltd
; chinese_simp
chinese_simp.MyAppName=Microtek DocWizard EX TWAIN
chinese_simp.MyAppPublisher=上海中晶科技有限公司
; chinese_trad
;chinese_trad.MyAppName=Microtek DocWizard EX TWAIN
;chinese_trad.MyAppPublisher=上海中晶科技有限公司
[Files]
Source: ".\MicrotekScan_App.ico"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion
; twain32 Source: "..\..\..\..\code_app\doc\scanner\MicrotekScan_scanSettings_Help_manual.pdf"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion;
Source: "..\..\..\..\code_app\doc\scanner\MicrotekScan_scanSettings_Help_manual_EN.pdf"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion;
Source: "..\..\x86\VC++\*.dll"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion;
Source: "..\..\x86\OEM\microtek\sane.dll"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion;
Source: "..\..\x86\OEM\microtek\scanner.dll"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion;
Source: "..\..\x86\OEM\microtek\lang.dll"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion;
Source: "..\..\..\lang\*"; DestDir: "{win}\twain_32\MicrotekTwain\lang\"; Flags: ignoreversion;
Source: "..\..\x86\Release\ZJBase.dll"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion;
Source: "..\..\x86\Release\ZJImgFmt.dll"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion;
Source: "..\..\x86\Release\ZJImgProc.dll"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion;
Source: "..\..\x86\Release\ZJVersion.dll"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion;
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{win}\twain_32\MicrotekTwain\tessdata\"; Flags: ignoreversion;
Source: "..\..\x86\OEM\microtek\microtektwain9200.ds"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion;
Source: "..\..\x86\Release\microtek-settings\*"; DestDir: "{win}\twain_32\MicrotekTwain\settings\"; Flags: ignoreversion recursesubdirs
; twain64
Source: "..\..\..\..\code_app\doc\scanner\MicrotekScan_scanSettings_Help_manual.pdf"; DestDir: "{win}\twain_64\MicrotekTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "..\..\..\..\code_app\doc\scanner\MicrotekScan_scanSettings_Help_manual_EN.pdf"; DestDir: "{win}\twain_64\MicrotekTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\VC++\*"; DestDir: "{win}\twain_64\MicrotekTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\microtek\sane.dll"; DestDir: "{win}\twain_64\MicrotekTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\microtek\scanner.dll"; DestDir: "{win}\twain_64\MicrotekTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\microtek\lang.dll"; DestDir: "{win}\twain_64\MicrotekTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{win}\twain_64\MicrotekTwain\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ZJBase.dll"; DestDir: "{win}\twain_64\MicrotekTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ZJImgFmt.dll"; DestDir: "{win}\twain_64\MicrotekTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ZJImgProc.dll"; DestDir: "{win}\twain_64\MicrotekTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ZJVersion.dll"; DestDir: "{win}\twain_64\MicrotekTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tessdata\*"; DestDir: "{win}\twain_64\MicrotekTwain\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\microtek\microtektwain9200.ds"; DestDir: "{win}\twain_64\MicrotekTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\microtek-settings\*"; DestDir: "{win}\twain_64\MicrotekTwain\settings\"; Flags: ignoreversion recursesubdirs; Check: Is64BitInstallMode
;拷贝驱动
Source: "..\..\usb\microtek\Microtek_A3HG_scanner_usb.inf"; DestDir: "{win}\twain_32\MicrotekTwain\driver\"; Flags: ignoreversion recursesubdirs;
Source: "..\..\usb\microtek\Microtek_A3HG_scanner_usb.cat"; DestDir: "{win}\twain_32\MicrotekTwain\driver\"; Flags: ignoreversion recursesubdirs;
Source: "..\..\x86\Release\DPInst32.exe"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion recursesubdirs; Check: not IsWin64
Source: "..\..\x64\Release\DPInst64.exe"; DestDir: "{win}\twain_32\MicrotekTwain\"; Flags: ignoreversion recursesubdirs; Check: IsWin64
[INI]
[Icons]
Name: "{group}\Uninstall"; Filename: "{uninstallexe}"; Languages: english
Name: "{group}\卸载"; Filename: "{uninstallexe}"; Languages: chinese_simp
;Name: "{group}\卸載"; Filename: "{uninstallexe}"; Languages: chinese_trad
[Registry]
Root: HKLM; Subkey: "Software\MicrotekScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\MicrotekTwain"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\MicrotekScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{win}\twain_64\MicrotekTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\MicrotekScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\MicrotekTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\MicrotekScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{win}\twain_64\MicrotekTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
[Code]
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{DDE9139A-3298-4CB8-BB31-755A1F158D93}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{win}\twain_32\MicrotekTwain\MicrotekScan_App.ico'));
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep:TUninstallStep);
begin
if CurUninstallStep = usDone then
begin
DelTree(ExpandConstant('{win}\twain_32\MicrotekTwain'), True, True, True);
DelTree(ExpandConstant('{win}\twain_64\MicrotekTwain'), True, True, True);
end;
end;
[Run]
Filename: "{win}\twain_32\MicrotekTwain\DPInst32"; Parameters: "/path ""{win}\twain_32\MicrotekTwain\driver"" /sw /se /lm /f"; Check: not IsWin64
Filename: "{win}\twain_32\MicrotekTwain\DPInst64"; Parameters: "/path ""{win}\twain_32\MicrotekTwain\driver"" /sw /se /lm /f"; Check: IsWin64
[UninstallRun] ;Filename: "{win}\twain_32\MicrotekTwain\DPInst32"; Parameters: "/u ""{win}\twain_32\MicrotekTwain\driver\Microtek_A3HG_scanner_usb.inf"" /q /d"; Check: not IsWin64 ;Filename: "{win}\twain_32\MicrotekTwain\DPInst64"; Parameters: "/u ""{win}\twain_32\MicrotekTwain\driver\Microtek_A3HG_scanner_usb.inf"" /q /d"; Check: IsWin64

View File

@ -1,304 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppVersion GetFileVersion('..\..\x64\OEM\neutral\sane.dll')
#define MyAppSetupName "NeuScan_App_Setup"
#define MyAppDefSetupDir "NeuScan"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{05E346E5-D4F2-410C-A2AB-62E416E13996}
AppName={cm:MyAppName}
AppVerName={cm:MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppDefSetupDir}
DefaultGroupName={cm:MyAppName}
VersionInfoVersion={#MyAppVersion}
OutputDir=..\..\package
OutputBaseFilename={#MyAppSetupName}_{#MyAppVersion}
Compression=lzma
AppPublisher={cm:MyAppPublisher}
SolidCompression=no
UninstallIconFile=uninstall.ico
SetupIconFile=NeuScan_App.ico
LicenseFile=NeuScan_App_License.txt
AlwaysShowComponentsList=true
ArchitecturesInstallIn64BitMode=x64
;PrivilegesRequired=admin
DisableWelcomePage=no
[Languages]
Name: "chinese_simp"; MessagesFile: "compiler:Languages/ChineseSimp.isl"; LicenseFile:NeuScan_App_License.txt
[CustomMessages]
chinese_simp.MyAppName=扫描软件
chinese_simp.MyAppPublisher=
chinese_simp.MyStr1=扫描软件已安装,是否卸载原版本?
chinese_simp.MyStr2=请先关闭旧版扫描软件!
chinese_simp.MyStr3=卸载旧版扫描软件失败,停止安装!
chinese_simp.MyStr4=请先关闭扫描软件!
[Components]
Name: "TwainG100"; Description: "SCAN G100 TWAIN" ; Types: Full
Name: "TwainG200"; Description: "SCAN G200 TWAIN" ; Types: Full
Name: "TwainG300"; Description: "SCAN G300 TWAIN" ; Types: Full
Name: "TwainG400"; Description: "SCAN G400 TWAIN" ; Types: Full
[Files]
; app
Source: ".\NeuScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\NeuScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\NeuScan_scanSettings_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
; app32
Source: "..\..\x86\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\NeuScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hasp_windows_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\NEUBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\NEUImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\NEUImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\neutral\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\neutral\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\neutral\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: not Is64BitInstallMode
; app64
Source: "..\..\x64\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\NeuScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hasp_windows_x64_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\NEUBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\NEUImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\NEUImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\neutral\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\neutral\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\neutral\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
; twain32
Source: "..\..\..\..\code_app\doc\scanner\NeuScan_scanSettings_Help_manual.pdf"; DestDir: "{win}\twain_32\NeuTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\VC++\*"; DestDir: "{win}\twain_32\NeuTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\neutral\sane.dll"; DestDir: "{win}\twain_32\NeuTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\neutral\scanner.dll"; DestDir: "{win}\twain_32\NeuTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\neutral\lang.dll"; DestDir: "{win}\twain_32\NeuTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{win}\twain_32\NeuTwain\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\NEUBase.dll"; DestDir: "{win}\twain_32\NeuTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\NEUImgFmt.dll"; DestDir: "{win}\twain_32\NeuTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\NEUImgProc.dll"; DestDir: "{win}\twain_32\NeuTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{win}\twain_32\NeuTwain\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\neutral\neutwain100.ds"; DestDir: "{win}\twain_32\NeuTwain\"; Flags: ignoreversion; Components: TwainG100;
Source: "..\..\x86\OEM\neutral\neutwain200.ds"; DestDir: "{win}\twain_32\NeuTwain\"; Flags: ignoreversion; Components: TwainG200;
Source: "..\..\x86\OEM\neutral\neutwain300.ds"; DestDir: "{win}\twain_32\NeuTwain\"; Flags: ignoreversion; Components: TwainG300;
Source: "..\..\x86\OEM\neutral\neutwain400.ds"; DestDir: "{win}\twain_32\NeuTwain\"; Flags: ignoreversion; Components: TwainG400;
; twain64
Source: "..\..\x64\OEM\neutral\neutwain100.ds"; DestDir: "{win}\twain_64\NeuTwain\"; Flags: ignoreversion; Components: TwainG100; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\neutral\neutwain200.ds"; DestDir: "{win}\twain_64\NeuTwain\"; Flags: ignoreversion; Components: TwainG200; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\neutral\neutwain300.ds"; DestDir: "{win}\twain_64\NeuTwain\"; Flags: ignoreversion; Components: TwainG300; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\neutral\neutwain400.ds"; DestDir: "{win}\twain_64\NeuTwain\"; Flags: ignoreversion; Components: TwainG400; Check: Is64BitInstallMode
;拷贝驱动
Source: "..\..\usb\huagao\huagaousb.inf"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
Source: "..\..\usb\huagao\huagaousb.cat"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
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: "..\..\x86\Release\RemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x64\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
[INI]
[Icons]
Name: "{commondesktop}\{cm:MyAppName}"; Filename: "{app}\NeuScan.exe"
Name: "{group}\{cm:MyAppName}"; Filename: "{app}\NeuScan.exe"
Name: "{group}\扫描软件帮助文档"; Filename: "{app}\NeuScan_App_Help_manual.pdf"; Languages: chinese_simp
Name: "{group}\卸载"; Filename: "{uninstallexe}"; Languages: chinese_simp
[Registry]
Root: HKLM; Subkey: "Software\NeuScan"; ValueType: string; ValueName: "AppDirectory"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\NeuScan"; ValueType: string; ValueName: "Application"; ValueData: "{app}\NeuScan.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\NeuScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\NeuScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{app}"; Flags: uninsdeletekey; Check: not Is64BitInstallMode
Root: HKLM; Subkey: "Software\NeuScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\NeuTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\NeuScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{app}"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\NeuScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\NeuTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\NeuScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{app}"; Flags: uninsdeletekey; Check: Is64BitInstallMode
[Code]
var
globalInstallPath: String;
procedure InitializeWizard;
begin
WizardForm.DirEdit.Text := globalInstallPath; end;
function GetInstallString(): String;
var
InstallPath: String;
begin
InstallPath := ExpandConstant('{pf}\{#MyAppDefSetupDir}');
if RegValueExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{05E346E5-D4F2-410C-A2AB-62E416E13996}_is1', 'Inno Setup: App Path') then
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{05E346E5-D4F2-410C-A2AB-62E416E13996}_is1', 'Inno Setup: App Path', InstallPath)
end
result := InstallPath; end;
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
ResultCode: Integer;
ResultStr: String;
UninstallContinue: Boolean;
CmdStr: String;
begin
Result := false;
globalInstallPath := GetInstallString();
CmdStr := GetCmdTail();
ExtractTemporaryFile('RemoveOldApp.exe');
if Exec(ExpandConstant('{tmp}\RemoveOldApp.exe'), 'OEM_NEUTRAL', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{05E346E5-D4F2-410C-A2AB-62E416E13996}_is1', 'UninstallString', ResultStr) then
begin
UninstallContinue := true;
if Pos('/verysilent', CmdStr) = 0 then
begin
if MsgBox(ExpandConstant('{cm:MyStr1}'), mbConfirmation, MB_YESNO) <> IDYES then
begin
UninstallContinue := false;
end
end
if UninstallContinue then
begin
ResultStr := RemoveQuotes(ResultStr);
if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
if 0 = ResultCode then
begin
Sleep(1000)
Result := true;
end
end
end
end
else
begin
Result := true;
end
end
else if 2 = ErrorCode then
begin
MsgBox(ExpandConstant('{cm:MyStr2}'), mbInformation, MB_OK);
end
else
begin
MsgBox(ExpandConstant('{cm:MyStr3}'), mbInformation, MB_OK);
end
end
end;
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{05E346E5-D4F2-410C-A2AB-62E416E13996}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
begin
Result := false;
if Exec(ExpandConstant('{app}\CheckNewApp.exe'), 'OEM_NEUTRAL', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
Result := true;
end
else
begin
MsgBox(ExpandConstant('{cm:MyStr4}'), mbInformation, MB_OK);
end
end
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{app}\NeuScan_App.ico'));
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep:TUninstallStep);
begin
if CurUninstallStep = usDone then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
DelTree(ExpandConstant('{win}\twain_32\NeuTwain'), True, True, True);
DelTree(ExpandConstant('{win}\twain_64\NeuTwain'), True, True, True);
end;
end;
[Run]
Filename: "{app}\DPInst32"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: not IsWin64
Filename: "{app}\DPInst64"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: IsWin64
Filename: "{app}\NeuScan.exe"; Description: "{cm:LaunchProgram, {cm:MyAppName}}"; Parameters:"-language=chinese"; Flags: postinstall nowait skipifsilent; Languages: chinese_simp

View File

@ -1,297 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "紫光扫描软件"
#define MyAppVersion GetFileVersion('..\..\x64\OEM\unis\sane.dll')
#define MyAppSetupName "UniScan_App_Setup"
#define MyAppDefSetupDir "UniScan"
#define MyAppPublisher "紫光股份有限公司"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{6512BEFD-F0E0-495F-8E12-4D07B5B3BE87}
AppName={#MyAppName}
AppVerName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppDefSetupDir}
DefaultGroupName={#MyAppName}
VersionInfoVersion={#MyAppVersion}
OutputDir=..\..\package
OutputBaseFilename={#MyAppSetupName}_{#MyAppVersion}
Compression=lzma
AppPublisher={#MyAppPublisher}
SolidCompression=no
UninstallIconFile=uninstall.ico
SetupIconFile=UniScan_App.ico
LicenseFile=UniScan_App_License.txt
AlwaysShowComponentsList=true
ArchitecturesInstallIn64BitMode=x64
;PrivilegesRequired=admin
DisableWelcomePage=no
[Languages]
Name: "zn"; MessagesFile: "compiler:Languages/ChineseSimp.isl"
[Components]
;Name: "Upgrade"; Description: "在线升级功能" ; Types: Full
Name: "TwainG200"; Description: "UNISCAN Q7110 TWAIN" ; Types: Full
Name: "TwainG210"; Description: "UNISCAN Q1070 TWAIN" ; Types: Full
[Files]
; app
Source: ".\UniScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion Source: "..\..\..\..\code_app\doc\scanner\UniScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion Source: "..\..\..\..\code_app\doc\scanner\UniScan_scanSettings_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
; app32
Source: "..\..\x86\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\UniScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
;Source: "..\..\x86\Release\ZGUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\hasp_windows_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ZGBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ZGImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ZGImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
;Source: "..\..\x86\Release\ZGVersion.dll"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\unis\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\unis\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\x86\OEM\unis\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: not Is64BitInstallMode
; app64
Source: "..\..\x64\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tessdata\*"; DestDir: "{app}\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\UniScan.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
;Source: "..\..\x64\Release\ZGUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: Is64BitInstallMode
Source: "..\..\x64\Release\cnocr.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\doc_seg.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ExportFile.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\FormEx.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetPdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetRtf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\GetXls.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hanwangOCRdetect.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\hasp_windows_x64_113819.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ZGBase.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ZGImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ZGImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
;Source: "..\..\x64\Release\ZGVersion.dll"; DestDir: "{app}\"; Flags: ignoreversion; Components: Upgrade; Check: Is64BitInstallMode
Source: "..\..\x64\Release\HwOcrSdk.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\libzip.org.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\mp30.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\ofd.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\PDFParse.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\tinyxml2.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\Release\zlib.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\unis\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\unis\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\unis\lang.dll"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
; twain32
Source: "..\..\..\..\code_app\doc\scanner\UniScan_scanSettings_Help_manual.pdf"; DestDir: "{win}\twain_32\UnisTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\VC++\*"; DestDir: "{win}\twain_32\UnisTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\unis\sane.dll"; DestDir: "{win}\twain_32\UnisTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\unis\scanner.dll"; DestDir: "{win}\twain_32\UnisTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\unis\lang.dll"; DestDir: "{win}\twain_32\UnisTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\..\lang\*"; DestDir: "{win}\twain_32\UnisTwain\lang\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\ZGBase.dll"; DestDir: "{win}\twain_32\UnisTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\ZGImgFmt.dll"; DestDir: "{win}\twain_32\UnisTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\ZGImgProc.dll"; DestDir: "{win}\twain_32\UnisTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\ZGVersion.dll"; DestDir: "{win}\twain_32\UnisTwain\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\Release\tessdata\*"; DestDir: "{win}\twain_32\UnisTwain\tessdata\"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "..\..\x86\OEM\unis\unistwain200.ds"; DestDir: "{win}\twain_32\UnisTwain\"; Flags: ignoreversion; Components: TwainG200;
Source: "..\..\x86\OEM\unis\unistwain210.ds"; DestDir: "{win}\twain_32\UnisTwain\"; Flags: ignoreversion; Components: TwainG210;
; twain64
Source: "..\..\x64\OEM\unis\unistwain200.ds"; DestDir: "{win}\twain_64\UnisTwain\"; Flags: ignoreversion; Components: TwainG200; Check: Is64BitInstallMode
Source: "..\..\x64\OEM\unis\unistwain210.ds"; DestDir: "{win}\twain_64\UnisTwain\"; Flags: ignoreversion; Components: TwainG210; Check: Is64BitInstallMode
;拷贝驱动
Source: "..\..\usb\uniscan\uniscanusb.inf"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
Source: "..\..\usb\uniscan\uniscanusb.cat"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
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: "..\..\x86\Release\RemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion Source: "..\..\x86\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: not Is64BitInstallMode Source: "..\..\x64\Release\CheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion; Check: Is64BitInstallMode
[INI]
[Icons]
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\UniScan.exe"
Name: "{group}\{#MyAppName}"; Filename: "{app}\UniScan.exe"
Name: "{group}\紫光扫描软件帮助文档"; Filename: "{app}\UniScan_App_Help_manual.pdf"
Name: "{group}\卸载"; Filename: "{uninstallexe}";
[Registry]
Root: HKLM; Subkey: "Software\UniScan"; ValueType: string; ValueName: "AppDirectory"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\UniScan"; ValueType: string; ValueName: "Application"; ValueData: "{app}\UniScan.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\UniScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\UniScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{app}"; Flags: uninsdeletekey; Check: not Is64BitInstallMode
Root: HKLM; Subkey: "Software\UniScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\UnisTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\UniScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{app}"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\UniScan"; ValueType: string; ValueName: "DriverPath"; ValueData: "{win}\twain_32\UnisTwain"; Flags: uninsdeletekey; Check: Is64BitInstallMode
Root: HKLM; Subkey: "Software\WOW6432Node\UniScan"; ValueType: string; ValueName: "DriverPath64"; ValueData: "{app}"; Flags: uninsdeletekey; Check: Is64BitInstallMode
[Code]
var
globalInstallPath: String;
//初始化时把路径设置到编辑框
procedure InitializeWizard;
begin
WizardForm.DirEdit.Text := globalInstallPath;
end;
function GetInstallString(): String;
var
InstallPath: String;
begin
InstallPath := ExpandConstant('{pf}\{#MyAppDefSetupDir}');
if RegValueExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6512BEFD-F0E0-495F-8E12-4D07B5B3BE87}_is1', 'Inno Setup: App Path') then
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6512BEFD-F0E0-495F-8E12-4D07B5B3BE87}_is1', 'Inno Setup: App Path', InstallPath)
end
result := InstallPath;
end;
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
ResultCode: Integer;
ResultStr: String;
UninstallContinue: Boolean;
CmdStr: String;
begin
Result := false;
globalInstallPath := GetInstallString();
CmdStr := GetCmdTail();
ExtractTemporaryFile('RemoveOldApp.exe');
if Exec(ExpandConstant('{tmp}\RemoveOldApp.exe'), 'OEM_ZIGUANG', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6512BEFD-F0E0-495F-8E12-4D07B5B3BE87}_is1', 'UninstallString', ResultStr) then
begin
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
ResultStr := RemoveQuotes(ResultStr);
if Exec(ResultStr, '/verysilent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
if 0 = ResultCode then
begin
Sleep(1000)
Result := true;
end
end
end
end
else
begin
Result := true;
end
end
else if 2 = ErrorCode then
begin
MsgBox('请先关闭旧版扫描软件!', mbInformation, MB_OK);
end
else
begin
MsgBox('卸载旧版扫描软件失败,停止安装!', mbInformation, MB_OK);
end
end
end;
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{6512BEFD-F0E0-495F-8E12-4D07B5B3BE87}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
begin
Result := false;
if Exec(ExpandConstant('{app}\CheckNewApp.exe'), 'OEM_ZIGUANG', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
if 0 = ErrorCode then
begin
Result := true;
end
else
begin
MsgBox('请先关闭扫描软件!', mbInformation, MB_OK);
end
end
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{app}\UniScan_App.ico'));
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep:TUninstallStep);
begin
if CurUninstallStep = usDone then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
DelTree(ExpandConstant('{win}\twain_32\UnisTwain'), True, True, True);
DelTree(ExpandConstant('{win}\twain_64\UnisTwain'), True, True, True);
end;
end;
[Run]
Filename: "{app}\DPInst32"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: not IsWin64
Filename: "{app}\DPInst64"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: IsWin64
;Filename: "{app}\ZGUpgradeApp.exe"; Parameters:"-type=postinstallinfo -appName=Scanner -oemName=Unis -desc=install/upgrade"; Components: Upgrade
Filename: "{app}\UniScan.exe"; Description: "{cm:LaunchProgram, {#MyAppName}}"; Flags: postinstall nowait skipifsilent
[UninstallRun]
; 卸载驱动 ;Filename: "{app}\DPInst32"; Parameters: "/u ""{app}\driver\uniscanusb.inf"" /q /d"; Check: not IsWin64 ;Filename: "{app}\DPInst64"; Parameters: "/u ""{app}\driver\uniscanusb.inf"" /q /d"; Check: IsWin64