-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathsetup.iss
77 lines (68 loc) · 2.46 KB
/
setup.iss
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
; https://jrsoftware.org/ishelp/index.php
#define AppName "vinetrimmer"
#define Version "0.0.7"
#define AppPublisher "PHOENiX"
#define AppURL "https://github.com/rlaphoenix/vinetrimmer"
#define AppReadme "https://github.com/rlaphoenix/vinetrimmer/blob/master/README.md"
#define AppSupport "https://github.com/rlaphoenix/vinetrimmer/discussions"
#define AppReleases "https://github.com/rlaphoenix/vinetrimmer/releases"
#define AppVerName "{#AppName} {#Version}"
#define AppExeName "{#AppName}.exe"
[Setup]
AppId={#AppName}
AppName={#AppName}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppReadmeFile={#AppReadme}
AppSupportURL={#AppSupport}
AppUpdatesURL={#AppReleases}
AppVersion={#Version}
AppVerName={#AppVerName}
Compression=lzma2/max
DefaultDirName={autopf}\{#AppName}
LicenseFile=LICENSE
MinVersion=6.2
OutputBaseFilename=vinetrimmer-setup
OutputDir=dist
OutputManifestFile=vinetrimmer-setup-manifest.txt
PrivilegesRequiredOverridesAllowed=dialog commandline
SetupIconFile=assets\temp-icon.ico
SolidCompression=yes
VersionInfoVersion=0.0.1
WizardStyle=modern
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: dist\{#AppName}\{#AppExeName}; DestDir: {app}; Flags: ignoreversion
Source: dist\{#AppName}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{autoprograms}\{#AppName}"; Filename: "{app}\{#AppExeName}"
Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Registry]
Root: HKLM; \
Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \
ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; \
Check: NeedsAddPath(ExpandConstant('{app}'))
[Code]
function NeedsAddPath(Param: string): boolean;
var
OrigPath: string;
begin
if not RegQueryStringValue(
HKEY_LOCAL_MACHINE,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'Path', OrigPath
)
then begin
Result := True;
exit;
end;
Result :=
(Pos(';' + UpperCase(Param) + ';', ';' + UpperCase(OrigPath) + ';') = 0) and
(Pos(';' + UpperCase(Param) + '\;', ';' + UpperCase(OrigPath) + ';') = 0);
end;