-
Notifications
You must be signed in to change notification settings - Fork 62
/
install.iss
89 lines (79 loc) · 2.49 KB
/
install.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
78
79
80
81
82
83
84
85
86
87
88
89
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Dev Proxy"
; for local use only. In production replaced by a command line arg
#define MyAppSetupExeName "dev-proxy-installer-win-x64-0.23.0"
#define MyAppVersion "0.23.0"
#define MyAppPublisher "Microsoft"
#define MyAppURL "https://aka.ms/devproxy"
[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={{4448FDE7-D519-4009-AFE2-0C5D0AA9C3D2}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
AppVerName={#MyAppName} v{#MyAppVersion}
UninstallDisplayName={#MyAppName}
UninstallDisplayIcon={app}\icon.ico
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=..\LICENSE
; Remove the following line to run in administrative install mode (install for all users.)
PrivilegesRequired=lowest
OutputBaseFilename={#MyAppSetupExeName}
Compression=lzma
SolidCompression=yes
WizardStyle=modern
OutputDir=.
ChangesEnvironment=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: ".\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.iss"
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[UninstallDelete]
Type:files;Name:"{app}\rootCert.pfx"
[Code]
procedure RemovePath(Path: string);
var
Paths: string;
begin
if RegQueryStringValue(HKCU, 'Environment', 'Path', Paths) then
begin
StringChangeEx(Paths, ';' + Path + ';', ';', true);
RegWriteStringValue(HKCU, 'Environment', 'Path', Paths);
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then
begin
RemovePath(ExpandConstant('{app}'));
end;
end;
procedure AddPath(Path: string);
var
Paths: string;
begin
if RegQueryStringValue(HKCU, 'Environment', 'Path', Paths) then
begin
if Pos(';' + Path + ';', Paths) < 1 then
begin
Paths := Paths + ';' + Path + ';'
StringChangeEx(Paths, ';;', ';', true);
RegWriteStringValue(HKCU, 'Environment', 'Path', Paths);
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
begin
AddPath(ExpandConstant('{app}'));
end;
end;