release/win/setup/webservice/LanxumWebSdk_Setup.iss

127 lines
5.4 KiB
Plaintext

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "立思辰WEBSDK"
#define MyAppVersion "4.36.14000.22332"
#define MyAppSetupName "LanxumWebSdk_Setup"
#define MyAppDefSetupDir "LanxumWebSdk"
#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={{63F80920-AB67-49A5-AE9E-555165DC5122}
AppName={#MyAppName}
AppVerName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppDefSetupDir}
DefaultGroupName={#MyAppName}
VersionInfoVersion={#MyAppVersion}
OutputDir=..\..\package
OutputBaseFilename={#MyAppSetupName}_{#MyAppVersion}
Compression=lzma
AppPublisher={#MyAppPublisher}
SolidCompression=yes
UninstallIconFile=uninstall.ico
SetupIconFile=LanxumWebSdk.ico
LicenseFile=LanxumWebSdk_License.txt
PrivilegesRequired=admin
DisableWelcomePage=no
[Languages]
Name: "zn"; MessagesFile: "compiler:Languages/ChineseSimp.isl"
[Files]
; app
Source: ".\LanxumWebSdk.ico"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\宋体.ttf"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\IsTask.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\LSCWebService.exe"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\webservice\新版websdk接口说明.doc"; DestDir: "{app}\doc\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\test\webservice\webdemoproject\*"; DestDir: "{app}\demo\"; Flags: ignoreversion createallsubdirs recursesubdirs
Source: "..\..\x86\Release\LSCBase.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\LSCImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\LSCImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\OEM\lanxum\sane.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\OEM\lanxum\scanner.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\msvcp140.dll"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\x86\Release\vcruntime140.dll"; DestDir: "{app}\"; Flags: ignoreversion;
Source: "..\..\x86\Release\concrt140.dll"; DestDir: "{app}\"; Flags: ignoreversion;
;拷贝驱动
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
[INI]
[Icons]
Name: "{group}\立思辰WEBSDK接口文档"; Filename: "{app}\doc\新版websdk接口说明.doc"
Name: "{group}\立思辰WEBSDK示例网页"; Filename: "{app}\demo\webDemo.html"
Name: "{group}\{cm:UninstallProgram, {#MyAppName}}"; Filename: "{uninstallexe}";
[Registry]
Root: HKLM; Subkey: "Software\LanxumWebSdk"; ValueType: string; ValueName: "AppDirectory"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\LanxumWebSdk"; ValueType: string; ValueName: "Application"; ValueData: "{app}\LSCWebService.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\LanxumWebSdk"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "LSCWebService"; ValueData: "{app}\LSCWebService.exe"
[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 InitializeUninstall(): Boolean;
begin
Result:= true;
if RunTaskU('LSCWebService.exe', false) then
begin
KillTaskU('LSCWebService.exe');
Result:= true;
end
else
Result:= true;
UnloadDll(ExpandConstant('{app}/ISTask.dll'));
end;
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{63F80920-AB67-49A5-AE9E-555165DC5122}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{app}\LanxumWebSdk.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}\LSCWebService.exe"; Description: "{cm:LaunchProgram, {#MyAppName}}"; Flags: nowait runascurrentuser