-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.iss
More file actions
120 lines (105 loc) · 4.51 KB
/
setup.iss
File metadata and controls
120 lines (105 loc) · 4.51 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
; Script generated for ProXPL Project
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "ProXPL"
#define MyAppVersion "1.2.0"
#define MyAppPublisher "ProXentix"
#define MyAppURL "https://github.com/ProgrammerKR/ProXPL"
#define MyAppExeName "proxpl.exe"
[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={{D13F2113-1B21-4608-8756-748924080123}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
PrivilegesRequired=admin
OutputDir=build
OutputBaseFilename=ProXPL_Installer_v{#MyAppVersion}
SetupIconFile=assets\icon.ico
SolidCompression=yes
WizardStyle=modern
WizardImageFile=extension\logo.png
WizardSmallImageFile=extension\logo.png
LicenseFile=LICENSE
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "addtopath"; Description: "Add ProXPL to the system PATH environment variable"; GroupDescription: "System Integration"
[Files]
; Binaries
Source: "bin\{#MyAppExeName}"; DestDir: "{app}\bin"; Flags: ignoreversion
Source: "bin\prm.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
Source: "bin\*.dll"; DestDir: "{app}\bin"; Flags: ignoreversion skipifsourcedoesntexist
; Libraries
Source: "std\lib\*"; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs
; Documentation
Source: "docs\*"; DestDir: "{app}\docs"; Flags: ignoreversion recursesubdirs createallsubdirs
; Assets
Source: "assets\*"; DestDir: "{app}\assets"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\bin\{#MyAppExeName}"; IconFilename: "{app}\assets\icon.ico"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\bin\{#MyAppExeName}"; Tasks: desktopicon; IconFilename: "{app}\assets\icon.ico"
[Registry]
Root: HKA; Subkey: "Software\Classes\.prox"; ValueType: string; ValueName: ""; ValueData: "ProXPLSourceFile"; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.pxpl"; ValueType: string; ValueName: ""; ValueData: "ProXPLSourceFile"; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\ProXPLSourceFile"; ValueType: string; ValueName: ""; ValueData: "ProXPL Source File"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\ProXPLSourceFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\bin\{#MyAppExeName},0"
Root: HKA; Subkey: "Software\Classes\ProXPLSourceFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\bin\{#MyAppExeName}"" ""%1"""
[Code]
const
EnvironmentKey = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment';
procedure EnvAddPath(Path: string);
var
Paths: string;
begin
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths) then
Paths := '';
if Pos(';' + Path + ';', ';' + Paths + ';') = 0 then
begin
Paths := Paths + ';' + Path;
RegWriteStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths);
end;
end;
procedure EnvRemovePath(Path: string);
var
Paths: string;
P: Integer;
begin
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths) then exit;
P := Pos(';' + Path + ';', ';' + Paths + ';');
if P = 0 then
begin
if Pos(Path + ';', Paths) = 1 then P := 1
else if Pos(';' + Path, Paths) = Length(Paths) - Length(Path) then P := Length(Paths) - Length(Path);
end;
if P > 0 then
begin
Delete(Paths, P - 1, Length(Path) + 1);
RegWriteStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths);
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if (CurStep = ssPostInstall) and IsTaskSelected('addtopath') then
begin
EnvAddPath(ExpandConstant('{app}\bin'));
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usPostUninstall then
begin
EnvRemovePath(ExpandConstant('{app}\bin'));
end;
end;