forked from goeb/reqflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreqflow.iss.in
86 lines (73 loc) · 3.45 KB
/
reqflow.iss.in
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
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Reqflow"
#define MyAppVersion "@VERSION@"
#define MyAppPublisher "Frederic Hoerni"
#define MyAppURL "http://goeb.github.io/reqflow"
#define MyAppExeName "reqflow.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={{9C26518E-614F-4CEB-BAC9-CCC42D7BAF6D}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=@srcdir@\COPYING
OutputDir=.
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "reqflow.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "@srcdir@\README"; DestName: "README.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "@srcdir@\COPYING"; DestDir: "{app}"; Flags: ignoreversion
Source: "@srcdir@\NEWS"; DestDir: "{app}"; Flags: ignoreversion
Source: "@srcdir@\ChangeLog"; DestDir: "{app}"; Flags: ignoreversion
Source: "@srcdir@\AUTHORS"; DestDir: "{app}"; Flags: ignoreversion
Source: "@srcdir@\test\*.test"; DestDir: "{app}\test"; Flags: ignoreversion
Source: "@srcdir@\test\*.ref"; DestDir: "{app}\test"; Flags: ignoreversion
Source: "@srcdir@\test\*.req"; DestDir: "{app}\test"; Flags: ignoreversion
Source: "@srcdir@\test\*.pdf"; DestDir: "{app}\test"; Flags: ignoreversion
Source: "@srcdir@\test\*.docx"; DestDir: "{app}\test"; Flags: ignoreversion
Source: "@srcdir@\test\*.txt"; DestDir: "{app}\test"; Flags: ignoreversion
Source: "@srcdir@\test\*.html"; DestDir: "{app}\test"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
[Run]
Filename: "{app}\README.txt"; Description: "View the README file"; Flags: postinstall shellexec skipifsilent
#define KeyPath "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
[Registry]
; associate .req files with reqflow
Root: HKCR; Subkey: ".req"; ValueType: string; ValueName: ""; ValueData: "Reqflow"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Reqflow"; ValueType: string; ValueName: ""; ValueData: "Reqflow File"; Flags: uninsdeletekey
Root: HKCR; Subkey: "Reqflow\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\REQFLOW.EXE,0"
Root: HKCR; Subkey: "Reqflow\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\REQFLOW.EXE"" ""%1"""
; set reqflow in the PATH
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,
'{#KeyPath}',
'Path', OrigPath)
then begin
Result := True;
exit;
end;
// look for the path with leading and trailing semicolon
// Pos() returns 0 if not found
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
end;