Galactic/Compile.iss.template

83 lines
3.1 KiB
Plaintext
Raw Normal View History

2025-02-09 19:56:41 +08:00
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "%APPNAME%"
#define MyAppExec "%APPEXEC%"
#define MyAppVersion "%APPVERSION%"
2025-02-13 00:17:22 +08:00
#define MyAppBuildDate "%APPBUILDDATE%"
2025-02-09 19:56:41 +08:00
[Code]
function IsProcessRunning(ExeFileName: string): Boolean;
var
FSWbemLocator: Variant;
FWMIService: Variant;
FWbemObject: Variant;
begin
Result := False;
FSWbemLocator := CreateOleObject('WbemScripting.SWbemLocator');
FWMIService := FSWbemLocator.ConnectServer('localhost', 'root\CIMV2');
FWbemObject := FWMIService.ExecQuery(Format('SELECT * FROM Win32_Process Where Name = "%s"', [ExeFileName]));
Result := not VarIsNull(FWbemObject) and (FWbemObject.Count > 0);
end;
function InitializeSetup(): Boolean;
begin
if IsProcessRunning(ExpandConstant('{#MyAppExec}.exe')) then
begin
MsgBox('The main program is still running, please close it before installation.', mbError, MB_OK);
Result := False;
end
else
begin
Result := True;
end;
end;
[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={{225A7526-BAB4-4DBE-B5F6-9CE1BEACCB36}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
2025-02-13 00:17:22 +08:00
AppVerName={#MyAppName} {#MyAppVersion} ({#MyAppBuildDate})
2025-02-09 19:56:41 +08:00
VersionInfoProductName={#MyAppName}
VersionInfoProductTextVersion={#MyAppVersion}
VersionInfoProductVersion={#MyAppVersion}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoVersion={#MyAppVersion}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputBaseFilename={#MyAppName} Setup {#MyAppVersion}
OutputDir={#MyAppExec}.output
SetupIconFile={#MyAppExec}.dist\favicon.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
CloseApplications=yes
2025-02-11 22:45:42 +08:00
%DISABLEX64%ArchitecturesAllowed=x64compatible
%DISABLEX64%ArchitecturesInstallIn64BitMode=x64compatible
2025-02-09 19:56:41 +08:00
[UninstallRun]
Filename: "cmd.exe"; Parameters: "/C taskkill /IM {#MyAppExec}.exe /F"; Flags: runhidden
Filename: "cmd.exe"; Parameters: "/C taskkill /IM QtWebEngineProcess.exe /F"; Flags: runhidden
Filename: "cmd.exe"; Parameters: "/C taskkill /IM chrome.exe /F"; Flags: runhidden
Filename: "cmd.exe"; Parameters: "/C taskkill /IM chromedriver.exe /F"; Flags: runhidden
Filename: "cmd.exe"; Parameters: "/C taskkill /IM selenium-manager.exe /F"; Flags: runhidden
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "{#MyAppExec}.dist\{#MyAppExec}.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyAppExec}.dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExec}.exe"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExec}.exe"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExec}.exe"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent