release/win/setup/twaintest/HGTwainTestTool_App_Setup.iss

104 lines
4.7 KiB
Plaintext

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "华高Twain测试工具"
#define MyAppVersion GetFileVersion('..\..\x86\OEM\huagao\sanexy.dll')
#define MyAppSetupName "HGTwainTestTool_App_Setup"
#define MyAppDefSetupDir "HGTwainTestTool"
#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={{3BBB8E45-9449-437F-A391-ADA462CF2204}
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=HGTwainTestTool_App.ico
LicenseFile=HGTwainTestTool_App_License.txt
AlwaysShowComponentsList=true
PrivilegesRequired=admin
DisableWelcomePage=no
[Languages]
Name: "zn"; MessagesFile: "compiler:Languages/ChineseSimp.isl"
[Files]
; app
Source: ".\HGTwainTestTool_App.ico"; DestDir: "{app}\"; Flags: ignoreversion
; app32
Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion;
Source: "..\..\x86\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion;
Source: "..\..\x86\Qt\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion;
Source: "..\..\x86\Qt\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion;
Source: "..\..\x86\Qt\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion;
Source: "..\..\x86\Qt\*.dll"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\x86\Release\HGTwainTestApp.exe"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\x86\Release\HGBase.dll"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\x86\Release\HGImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\x86\Release\HGTwainUser.dll"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\x86\Release\HGTwainUI.dll"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\x86\VC++\*"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\x86\OEM\huagao\sanexy.dll"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\x86\OEM\huagao\scannerqd.dll"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\x86\OEM\huagao\yuyanbao.dll"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\..\lang\*"; DestDir: "{app}\lang\"; Flags: ignoreversion;
;拷贝驱动
Source: "..\..\usb\huagao\hgscannerusball.inf"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
Source: "..\..\usb\huagao\hgscannerusball.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
[INI]
[Icons]
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\HGTwainTestApp.exe"
Name: "{group}\{#MyAppName}"; Filename: "{app}\HGTwainTestApp.exe"
Name: "{group}\{cm:UninstallProgram, {#MyAppName}}"; Filename: "{uninstallexe}";
[Code]
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{3BBB8E45-9449-437F-A391-ADA462CF2204}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{app}\HGTwainTestTool_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; Flags: runascurrentuser
Filename: "{app}\DPInst64"; Parameters: "/path ""{app}\driver"" /sw /se /lm /f"; Check: IsWin64; Flags: runascurrentuser
Filename: "{app}\HGTwainTestApp.exe"; Description: "{cm:LaunchProgram, {#MyAppName}}"; Flags: postinstall nowait skipifsilent runascurrentuser
[UninstallRun]
; 卸载驱动
;Filename: "{app}\DPInst32"; Parameters: "/u ""{app}\driver\huagaousb.inf"" /q /d"; Check: not IsWin64; Flags: runascurrentuser
;Filename: "{app}\DPInst64"; Parameters: "/u ""{app}\driver\huagaousb.inf"" /q /d"; Check: IsWin64; Flags: runascurrentuser