增加了app的离线包脚本

This commit is contained in:
luoliangyi 2022-07-27 09:59:13 +08:00
parent 5b8bb1ee03
commit ebe3b42920
4 changed files with 152 additions and 1 deletions

View File

@ -57,7 +57,7 @@ Source: "..\..\x86\Release\translations\*"; DestDir: "{app}\translations\"; Flag
Source: "..\..\x86\Release\HuaGoScan.exe"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\HGUpgradeApp.exe"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\*.dll"; Excludes: "HGVersion.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\*.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\huagaotwain100.ds"; DestDir: "{win}\twain_32\"; Flags: ignoreversion; Components: TwainG100;
Source: "..\..\x86\Release\huagaotwain139.ds"; DestDir: "{win}\twain_32\"; Flags: ignoreversion; Components: TwainG139;

View File

@ -0,0 +1,151 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "华高扫描仪软件"
#define MyAppVersion "4.1026.2022.7261"
#define MyAppSetupName "HuaGoScan_App_Setup"
#define MyAppDefSetupDir "HuaGoScan"
#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={{7076DC53-5C2F-4216-9783-2A6F954FEB3E}
AppName={#MyAppName}
AppVerName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppDefSetupDir}
DefaultGroupName={#MyAppName}
VersionInfoVersion={#MyAppVersion}
OutputDir=.\
OutputBaseFilename={#MyAppSetupName}_{#MyAppVersion}_Offline
Compression=lzma
AppPublisher={#MyAppPublisher}
SolidCompression=yes
UninstallIconFile=uninstall.ico
SetupIconFile=HuaGoScan_App.ico
LicenseFile=HuaGoScan_App_License.txt
AlwaysShowComponentsList=true
[Languages]
Name: "zn"; MessagesFile: "compiler:Languages/Chinese.isl"
[Components]
Name: "TwainG100"; Description: "HUAGOSCAN G100 TWAIN" ; Types: Full
Name: "TwainG139"; Description: "HUAGOSCAN G139 TWAIN" ; Types: Full
Name: "TwainG200"; Description: "HUAGOSCAN G200 TWAIN" ; Types: Full
Name: "TwainG239"; Description: "HUAGOSCAN G239 TWAIN" ; Types: Full
Name: "TwainG300"; Description: "HUAGOSCAN G300 TWAIN" ; Types: Full
Name: "TwainG400"; Description: "HUAGOSCAN G400 TWAIN" ; Types: Full
Name: "TwainG402"; Description: "HUAGOSCAN G402 TWAIN" ; Types: Full
Name: "TwainG439"; Description: "HUAGOSCAN G439 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: "..\..\x86\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\IsTask.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion
Source: "..\..\x86\Release\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion
Source: "..\..\x86\Release\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion
Source: "..\..\x86\Release\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion
Source: "..\..\x86\Release\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion
Source: "..\..\x86\Release\HuaGoScan.exe"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\*.dll"; Excludes: "HGVersion.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\huagaotwain100.ds"; DestDir: "{win}\twain_32\"; Flags: ignoreversion; Components: TwainG100;
Source: "..\..\x86\Release\huagaotwain139.ds"; DestDir: "{win}\twain_32\"; Flags: ignoreversion; Components: TwainG139;
Source: "..\..\x86\Release\huagaotwain200.ds"; DestDir: "{win}\twain_32\"; Flags: ignoreversion; Components: TwainG200;
Source: "..\..\x86\Release\huagaotwain239.ds"; DestDir: "{win}\twain_32\"; Flags: ignoreversion; Components: TwainG239;
Source: "..\..\x86\Release\huagaotwain300.ds"; DestDir: "{win}\twain_32\"; Flags: ignoreversion; Components: TwainG300;
Source: "..\..\x86\Release\huagaotwain400.ds"; DestDir: "{win}\twain_32\"; Flags: ignoreversion; Components: TwainG400;
Source: "..\..\x86\Release\huagaotwain402.ds"; DestDir: "{win}\twain_32\"; Flags: ignoreversion; Components: TwainG402;
Source: "..\..\x86\Release\huagaotwain439.ds"; DestDir: "{win}\twain_32\"; Flags: ignoreversion; Components: TwainG439;
;拷贝驱动
Source: "..\..\x86\Release\scannerusb.inf"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
Source: "..\..\x86\Release\scannerusb.cat"; DestDir: "{app}\driver\"; Flags: ignoreversion recursesubdirs;
Source: "..\driver\x86\DPInst32.exe"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs; Check: not IsWin64
Source: "..\driver\x64\DPInst64.exe"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs; Check: IsWin64
[INI]
[Icons]
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\HuaGoScan.exe"
Name: "{group}\{#MyAppName}"; Filename: "{app}\HuaGoScan.exe"
Name: "{group}\华高扫描仪软件帮助文档"; Filename: "{app}\HuaGoScan_App_Help_manual.pdf"
Name: "{group}\{cm:UninstallProgram, {#MyAppName}}"; Filename: "{uninstallexe}";
[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
[Code]
// 卸载前判断进程是否在运行
function RunTaskU(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function KillTaskU(ExeFileName: string): Integer;
external 'KillTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
if (IsWin64()) then begin
SubKeyName := 'Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{7076DC53-5C2F-4216-9783-2A6F954FEB3E}_is1';
RegWriteStringValue(HKLM64,SubKeyName,'DisplayIcon',iconPath);
end else begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{7076DC53-5C2F-4216-9783-2A6F954FEB3E}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
end;
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
bRes: Boolean;
begin
Result := true;
if RunTaskU('HuaGoScan.exe', false) then
begin
KillTaskU('HuaGoScan.exe');
Result:= true;
end
else
Result:= true;
UnloadDll(ExpandConstant('{app}/ISTask.dll'));
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{app}\HuaGoScan_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}\HuaGoScan.exe"; Description: "{cm:LaunchProgram, {#MyAppName}}"; Flags: postinstall nowait skipifsilent
[UninstallRun]
; 卸载二代证驱动
Filename: "{app}\DPInst32"; Parameters: "/u ""{app}\driver\scannerusb.inf"" /q /d"; Check: not IsWin64
Filename: "{app}\DPInst64"; Parameters: "/u ""{app}\driver\scannerusb.inf"" /q /d"; Check: IsWin64

Binary file not shown.

Binary file not shown.