-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.iss
More file actions
83 lines (72 loc) · 2.76 KB
/
Copy pathinstaller.iss
File metadata and controls
83 lines (72 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
; PortPilot Inno Setup Script
; Creates a proper Windows installer
#define MyAppName "PortPilot"
#define MyAppVersion "0.2.2"
#define MyAppPublisher "logando-al"
#define MyAppURL "https://github.com/logando-al/port_pilot"
#define MyAppExeName "PortPilot.exe"
[Setup]
AppId={{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}/releases
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=
OutputDir=dist
OutputBaseFilename=PortPilot-Setup
SetupIconFile=resources\icons\tray_icon.ico
Compression=lzma2/ultra64
SolidCompression=yes
WizardStyle=modern
PrivilegesRequired=admin
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible
; Close app settings
CloseApplications=force
CloseApplicationsFilter=*.exe
RestartApplications=no
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "startupicon"; Description: "Start PortPilot when Windows starts"; GroupDescription: "Startup Options:"; Flags: unchecked
[Files]
Source: "dist\PortPilot.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "resources\icons\tray_icon.ico"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\tray_icon.ico"
Name: "{group}\Uninstall {#MyAppName}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\tray_icon.ico"; Tasks: desktopicon
[Registry]
; Add to Windows startup if selected
Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "PortPilot"; ValueData: """{app}\{#MyAppExeName}"""; Flags: uninsdeletevalue; Tasks: startupicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[UninstallDelete]
Type: filesandordirs; Name: "{localappdata}\PortPilot"
[Code]
function InitializeSetup(): Boolean;
var
ResultCode: Integer;
begin
// Kill any running instances of PortPilot before installation
Exec('taskkill.exe', '/F /IM PortPilot.exe', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
// Small delay to ensure process is fully terminated
Sleep(500);
Result := True;
end;
function InitializeUninstall(): Boolean;
var
ResultCode: Integer;
begin
// Kill any running instances before uninstall
Exec('taskkill.exe', '/F /IM PortPilot.exe', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
Sleep(500);
Result := True;
end;