-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.iss
More file actions
67 lines (58 loc) · 2.98 KB
/
setup.iss
File metadata and controls
67 lines (58 loc) · 2.98 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
; Script generated for Grid CLI
#define MyAppName "Grid CLI"
#define MyAppVersion "1.0"
#define MyAppPublisher "QuantForge AI"
#define MyAppExeName "grid.exe"
[Setup]
AppId={{A3D86659-3D4F-4C46-8659-3D4F4C468659}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
PrivilegesRequired=lowest
OutputDir=Output
OutputBaseFilename=GridSetup
Compression=lzma
SolidCompression=yes
WizardStyle=modern
SetupIconFile=grid\assets\icon.ico
UninstallDisplayIcon={app}\{#MyAppExeName}
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "Create a &Desktop Shortcut"; GroupDescription: "Additional icons:"; Flags: checkedonce
Name: "addtopath"; Description: "Add 'grid' command to PATH (Recommended)"; GroupDescription: "System Integration:"; Flags: checkedonce
[Files]
; The main executable
Source: "dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
; Copy the icon file so shortcuts can reference it
Source: "grid\assets\icon.ico"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
; Force the shortcut to use the deployed icon.ico
; We name the shortcut "Grid Terminal" so users feel it's a dedicated app
Name: "{autodesktop}\Grid Terminal"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; IconFilename: "{app}\icon.ico"
Name: "{autoprograms}\Grid Terminal"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\icon.ico"
[Registry]
; Add to PATH environment variable
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Tasks: addtopath; Check: NeedsAddPath(ExpandConstant('{app}'))
; Context menu: Right-click on folder (using HKCU for non-admin install)
Root: HKCU; Subkey: "Software\Classes\Directory\shell\OpenGridHere"; ValueType: string; ValueName: ""; ValueData: "Open Grid Here ⚡"; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\Classes\Directory\shell\OpenGridHere"; ValueType: string; ValueName: "Icon"; ValueData: "{app}\icon.ico"
Root: HKCU; Subkey: "Software\Classes\Directory\shell\OpenGridHere\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%V"""
; Context menu: Right-click on folder background (inside folder)
Root: HKCU; Subkey: "Software\Classes\Directory\Background\shell\OpenGridHere"; ValueType: string; ValueName: ""; ValueData: "Open Grid Here ⚡"; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\Classes\Directory\Background\shell\OpenGridHere"; ValueType: string; ValueName: "Icon"; ValueData: "{app}\icon.ico"
Root: HKCU; Subkey: "Software\Classes\Directory\Background\shell\OpenGridHere\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%V"""
[Code]
function NeedsAddPath(Param: string): boolean;
var
OrigPath: string;
begin
if not RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath)
then begin
Result := True;
exit;
end;
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
end;