-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.iss
83 lines (72 loc) · 2.27 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
78
79
80
81
82
83
#define MyAppName "DVC (Data Version Control)"
#define MyAppVersion ReadIni(SourcePath + "\config.ini", "Version", "version", "unknown")
#define MyAppPublisher "Dmitry Petrov"
#define MyAppURL "https://dvc.org"
#define MyAppDir SourcePath + "\build\dvc"
[Setup]
AppId={{8258CE8A-110E-4E0D-AE60-FEE00B15F041}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={code:GetDefaultDirName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=dvc\LICENSE
OutputBaseFilename=dvc-{#MyAppVersion}
Compression=lzma2/max
SolidCompression=yes
OutputDir=.
ChangesEnvironment=yes
SetupIconFile=dvc.ico
WizardSmallImageFile=dvc_up.bmp
WizardImageFile=dvc_left.bmp
DisableWelcomePage=no
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "{#MyAppDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Tasks]
Name: modifypath; Description: Adds dvc's application directory to environmental path; Flags: checkablealone;
Name: modifypath\system; Description: Adds dvc's application directory to environmental path for all users;
Name: addsymlinkpermissions; Description: Add permission for creating symbolic links; Flags: checkablealone;
Name: addsymlinkpermissions\system; Description: Add permissions for creating symbolic links for all users;
[Code]
const
ModPathName = 'modifypath';
ModPathPath = '{app}';
SymLinkName = 'addsymlinkpermissions';
var
ModPathType: String;
SymLinkType: String;
function GetDefaultDirName(Dummy: string): string;
begin
if IsAdminLoggedOn then begin
Result := ExpandConstant('{pf}\{#MyAppName}');
end else begin
Result := ExpandConstant('{userpf}\{#MyAppName}');
end;
end;
#include "modpath.iss"
#include "addsymlink.iss"
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then begin
if IsTaskSelected(ModPathName + '\system') then begin
ModPathType := 'system';
end else begin
ModPathType := 'user';
end;
if IsTaskSelected(SymLinkName + '\system') then begin
SymLinkType := 'system';
end else begin
SymLinkType := 'user';
end;
if IsTaskSelected(ModPathName) then
ModPath();
if IsTaskSelected(SymLinkName) then
AddSymLink();
end;
end;