forked from kwalus/QCADesigner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQCADesigner-win32-gtk.iss.in
132 lines (120 loc) · 7.75 KB
/
QCADesigner-win32-gtk.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
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
121
122
123
124
125
126
127
128
129
130
131
132
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
AppName=@PACKAGE@
AppVerName=@PACKAGE@ @VERSION@
AppPublisher=University of Calgary
AppPublisherURL=qcadesigner.ca
AppSupportURL=qcadesigner.ca
AppUpdatesURL=qcadesigner.ca
DefaultDirName={pf}\@PACKAGE@
DefaultGroupName=@PACKAGE@
LicenseFile=@prefix@\docs\COPYING
ChangesAssociations=yes
OutputBaseFilename=@PACKAGE@-@VERSION@-setup-gtk
[Tasks]
; NOTE: The following entry contains English phrases ("Create a desktop icon" and "Additional icons"). You are free to translate them into another language if required.
Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"; Flags: unchecked
[Registry]
; This adds the GTK+ libraries to QCADesigner.exe's path
Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\App Paths\QCADesigner.exe"; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\App Paths\QCADesigner.exe"; ValueType: string; ValueData: "{app}\QCADesigner.exe"; Flags: uninsdeletevalue
Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\App Paths\QCADesigner.exe"; ValueType: string; ValueName: "Path"; ValueData: "{app};{code:GetGtkPath}\bin"; Flags: uninsdeletevalue
; This adds the GTK+ libraries to graph_dialog.exe's path
Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\App Paths\graph_dialog.exe"; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\App Paths\graph_dialog.exe"; ValueType: string; ValueData: "{app}\QCADesigner.exe"; Flags: uninsdeletevalue
Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\App Paths\graph_dialog.exe"; ValueType: string; ValueName: "Path"; ValueData: "{app};{code:GetGtkPath}\bin"; Flags: uninsdeletevalue
; File associations
; QCA Design
Root: HKCR; SubKey: ".qca"; Flags: uninsdeletekey
Root: HKCR; SubKey: ".qca"; ValueType: string; ValueName: ""; ValueData: "QCADesigner.File"
Root: HKCR; SubKey: "QCADesigner.File"; Flags: uninsdeletekey
Root: HKCR; SubKey: "QCADesigner.File"; ValueType: string; ValueName: ""; ValueData: "QCADesigner Design"
Root: HKCR; SubKey: "QCADesigner.File"; ValueType: dword; ValueName: "BrowserFlags"; ValueData: 8; Flags: uninsdeletevalue
Root: HKCR; SubKey: "QCADesigner.File"; ValueType: dword; ValueName: "EditFlags"; ValueData: 0; Flags: uninsdeletevalue
Root: HKCR; SubKey: "QCADesigner.File\DefaultIcon"; Flags: uninsdeletekey
Root: HKCR; SubKey: "QCADesigner.File\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\pixmaps\QCADesigner.winxp.ico"; MinVersion: 0, 1
Root: HKCR; SubKey: "QCADesigner.File\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\pixmaps\QCADesigner.win32.ico"; MinVersion: 1, 0
Root: HKCR; SubKey: "QCADesigner.File\shell"; Flags: uninsdeletekey
Root: HKCR; SubKey: "QCADesigner.File\shell"; ValueType: string; ValueName: ""; ValueData: "Open"
Root: HKCR; SubKey: "QCADesigner.File\shell\Open"; Flags: uninsdeletekey
Root: HKCR; SubKey: "QCADesigner.File\shell\Open"; ValueType: string; ValueName: ""; ValueData: "&Open"
Root: HKCR; SubKey: "QCADesigner.File\shell\Open\command"; Flags: uninsdeletekey
Root: HKCR; SubKey: "QCADesigner.File\shell\Open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\QCADesigner.exe"" ""%1"""
; QCA Simulation Results
Root: HKCR; SubKey: ".rst"; Flags: uninsdeletekey
Root: HKCR; SubKey: ".rst"; ValueType: string; ValueName: ""; ValueData: "QCADesigner.SimResults.File"
Root: HKCR; SubKey: ".sim_output"; Flags: uninsdeletekey
Root: HKCR; SubKey: ".sim_output"; ValueType: string; ValueName: ""; ValueData: "QCADesigner.SimResults.File"
Root: HKCR; SubKey: "QCADesigner.SimResults.File"; Flags: uninsdeletekey
Root: HKCR; SubKey: "QCADesigner.SimResults.File"; ValueType: string; ValueName: ""; ValueData: "QCADesigner Simulation Results"
Root: HKCR; SubKey: "QCADesigner.SimResults.File"; ValueType: dword; ValueName: "BrowserFlags"; ValueData: 8; Flags: uninsdeletevalue
Root: HKCR; SubKey: "QCADesigner.SimResults.File"; ValueType: dword; ValueName: "EditFlags"; ValueData: 0; Flags: uninsdeletevalue
Root: HKCR; SubKey: "QCADesigner.SimResults.File\DefaultIcon"; Flags: uninsdeletekey
Root: HKCR; SubKey: "QCADesigner.SimResults.File\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\pixmaps\graph_dialog.winxp.ico"; MinVersion: 0, 1
Root: HKCR; SubKey: "QCADesigner.SimResults.File\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\pixmaps\graph_dialog.win32.ico"; MinVersion: 1, 0
Root: HKCR; SubKey: "QCADesigner.SimResults.File\shell"; Flags: uninsdeletekey
Root: HKCR; SubKey: "QCADesigner.SimResults.File\shell"; ValueType: string; ValueName: ""; ValueData: "Open"
Root: HKCR; SubKey: "QCADesigner.SimResults.File\shell\Open"; Flags: uninsdeletekey
Root: HKCR; SubKey: "QCADesigner.SimResults.File\shell\Open"; ValueType: string; ValueName: ""; ValueData: "&Open"
Root: HKCR; SubKey: "QCADesigner.SimResults.File\shell\Open\command"; Flags: uninsdeletekey
Root: HKCR; SubKey: "QCADesigner.SimResults.File\shell\Open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\graph_dialog.exe"" ""%1"""
[Files]
Source: "@prefix@\*"; DestDir: "{app}"; Flags: recursesubdirs
Source: "@packagesrcdir@\@GTK_RUNTIME_PKG@"; DestDir: "{tmp}"; Flags: dontcopy
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\QCADesigner"; Filename: "{app}\QCADesigner.exe"; IconFilename: "{app}\pixmaps\QCADesigner.winxp.ico"; MinVersion: 0, 1
Name: "{group}\Simulation Results Viewer"; Filename: "{app}\graph_dialog.exe"; IconFilename: "{app}\pixmaps\graph_dialog.winxp.ico"; MinVersion: 0, 1
Name: "{userdesktop}\QCADesigner"; Filename: "{app}\QCADesigner.exe"; Tasks: desktopicon; IconFilename: "{app}\pixmaps\QCADesigner.winxp.ico"; MinVersion: 0, 1
Name: "{group}\QCADesigner"; Filename: "{app}\QCADesigner.exe"; IconFilename: "{app}\pixmaps\QCADesigner.win32.ico"; MinVersion: 1, 0
Name: "{group}\Simulation Results Viewer"; Filename: "{app}\graph_dialog.exe"; IconFilename: "{app}\share\@PACKAGE@\pixmaps\graph_dialog.win32.ico"; MinVersion: 1, 0
Name: "{userdesktop}\QCADesigner"; Filename: "{app}\QCADesigner.exe"; Tasks: desktopicon; IconFilename: "{app}\pixmaps\QCADesigner.win32.ico"; MinVersion: 1, 0
[Code]
var
Exists: Boolean;
GtkPath: String;
function GetGtkInstalled (): Boolean;
begin
Exists := RegQueryStringValue (HKLM, 'Software\GTK\2.0', 'Path', GtkPath);
if not Exists then begin
Exists := RegQueryStringValue (HKCU, 'Software\GTK\2.0', 'Path', GtkPath);
end;
Result := Exists
end;
function EnsureGtkInstalled ():Boolean;
var ExecResult : integer ;
var iMsgBox : integer ;
begin
Result := GetGtkInstalled ();
if not Result then
iMsgBox := MsgBox('QCADesigner requires GTK+ version 2.4 or higher. Would you like to install it ?', mbConfirmation, MB_YESNO) ;
begin
if idNo = iMsgBox then
begin
Result := False ;
end;
if idYes = iMsgBox then
begin
ExtractTemporaryFile ('@GTK_RUNTIME_PKG@');
Exec (ExpandConstant ('{tmp}')+'\@GTK_RUNTIME_PKG@',
'', ExpandConstant ('{tmp}'), SW_SHOWNORMAL, ewWaitUntilTerminated, ExecResult) ;
Result := GetGtkInstalled ();
if not Result then
begin
MsgBox('Failed to install GTK+ !', mbError, MB_OK);
end;
end;
end;
end;
function GetGtkPath (S: String): String;
begin
Result := GtkPath;
end;
function InitializeSetup(): Boolean;
begin
Result := EnsureGtkInstalled ();
if not Result then begin
MsgBox ('Please install the GTK+ Runtime Environment version 2.4 or higher before installing @PACKAGE@. You can obtain GTK+ from http://gaim.sourceforge.net/win32/index.php#wingtk . Look for files of the form gtk-runtime-<Version>.exe', mbError, MB_OK);
end;
end;