forked from nullptrlabs/pgmodeler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpgmodeler.iss
More file actions
104 lines (90 loc) · 3.7 KB
/
pgmodeler.iss
File metadata and controls
104 lines (90 loc) · 3.7 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
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
; Created with Inno Setup (http://www.jrsoftware.org/isinfo.php)
#define MyAppName "pgModeler - PostgreSQL Database Modeler"
#define MyAppVersion "v0.4.0-rc"
#define MyAppPublisher "pgModeler Project"
#define MyAppURL "http://www.pgmodeler.com.br/"
#define MyAppExeName "pgmodeler.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={{8978809A-8AA1-4DE8-A4B8-058F2CE7B9E7}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=.\build\LICENSE
OutputDir=.\
OutputBaseFilename=pgmodeler-{#MyAppVersion}-setup
Compression=lzma
SolidCompression=yes
ChangesEnvironment=true
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
[Files]
Source: ".\build\pgmodeler.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\build\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
[code]
procedure SetEnv(EnvName, EnvValue: String; IsInstall: Boolean);
var
OrgValue:String;
OrgLen:Integer;
EnvValuePos:Integer;
EnvValueLen:Integer;
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', EnvName, OrgValue);
OrgValue:=Trim(OrgValue);
OrgLen:=length(OrgValue);
EnvValuePos:=pos(Uppercase(EnvValue),Uppercase(OrgValue));
EnvValueLen:=length(EnvValue);
if IsInstall then
begin
if OrgLen>0 then EnvValue:=';'+EnvValue;
if EnvValuePos=0 then Insert(EnvValue,OrgValue,OrgLen+1);
end
else
begin
if EnvValuePos>0 then Delete(OrgValue,EnvValuePos,EnvValueLen);
if length(OrgValue)=0 then
begin
RegDeleteValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',EnvName);
exit;
end;
end;
StringChange(OrgValue,';;',';');
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', EnvName, OrgValue);
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep=ssInstall then
begin
SetEnv('Path',ExpandConstant('{app}\lib'),true);
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then
begin
SetEnv('Path',ExpandConstant('{app}\lib'),false);
end;
end;