-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.iss
More file actions
45 lines (40 loc) · 1.27 KB
/
installer.iss
File metadata and controls
45 lines (40 loc) · 1.27 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
#ifndef MyAppVersion
#define MyAppVersion "0.0.0"
#endif
[Setup]
AppName=Snoot
AppVersion={#MyAppVersion}
AppPublisher=brontoguana
AppPublisherURL=https://github.com/brontoguana/snoot
DefaultDirName={localappdata}\snoot
DisableProgramGroupPage=yes
OutputDir=dist
OutputBaseFilename=snoot-installer
Compression=lzma2
SolidCompression=yes
PrivilegesRequired=lowest
ChangesEnvironment=yes
WizardStyle=modern
DisableStartupPrompt=yes
SetupIconFile=compiler:SetupClassicIcon.ico
UninstallDisplayName=Snoot
DisableDirPage=yes
DisableReadyPage=yes
[Files]
Source: "dist\snoot-windows-x64.exe"; DestDir: "{app}"; DestName: "snoot.exe"; Flags: ignoreversion
[Registry]
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Check: NeedsAddPath(ExpandConstant('{app}'))
[Messages]
FinishedLabelNoIcons=Snoot has been installed to %n%n {localappdata}\snoot\snoot.exe%n%nOpen a new terminal and run:%n snoot set-user <your-session-id>%n cd C:\your\project%n snoot MyChannel
[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;