forked from vpython/visual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MakeVPython3.1.iss
228 lines (187 loc) · 10.8 KB
/
MakeVPython3.1.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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
; Create installer for VPython using Inno Setup Compiler (www.innosetup.com)
; Assumes Python and numpy already installed.
; Make sure version numbers are correct for VPython and numpy.
; Also, make sure that vidle\config-main.def has the correct Python version number for documentation
[Setup]
AppName=VPython for Python 3.1
AppVerName=VPython 5.72
AppPublisherURL=http://vpython.org
DefaultDirName={code:MyConst}
SourceDir=C:\Python31
DisableProgramGroupPage=yes
DirExistsWarning=no
DisableStartupPrompt=yes
OutputBaseFilename=VPython-Win-Py3.1-5.72
OutputDir=c:\workspace
[Files]
; The following overwrite is no longer performed, now that VIDLE is an option:
; Make sure that config-main.def has
; editor-on-startup and autosave set to 1
; and help set for Visual before building package.
;Source: "Lib\idlelib\config-main.def"; DestDir: "{app}\Lib\idlelib\"; Flags: uninsneveruninstall
Source: "Lib\site-packages\vis\cvisual.pyd"; DestDir: "{app}\Lib\site-packages\vis\"; Components: Visual
Source: "Lib\site-packages\vis\*.py"; DestDir: "{app}\Lib\site-packages\vis\"; Components: Visual
Source: "Lib\site-packages\vis\*.tga"; DestDir: "{app}\Lib\site-packages\vis\"; Components: Visual
Source: "Lib\site-packages\visual\*.py"; DestDir: "{app}\Lib\site-packages\visual\"; Components: Visual
; Execute compilevisual.py from the CVS files to compile the .pyc files:
Source: "Lib\site-packages\vis\*.pyc"; DestDir: "{app}\Lib\site-packages\vis\"; Components: Visual
Source: "Lib\site-packages\visual\*.pyc"; DestDir: "{app}\Lib\site-packages\visual\"; Components: Visual
Source: "c:\workspace\vpython-core2\license.txt"; DestDir: "{app}\Lib\site-packages\visual\"; Components: Visual
; Need to have installed numpy, FontTools, ttfquery, and Polygon before building Visual, so components available in site-packages:
Source: "Lib\site-packages\numpy*egg-info"; DestDir: "{app}\Lib\site-packages\"; Components: numpy
Source: "Lib\site-packages\numpy\*"; DestDir: "{app}\Lib\site-packages\numpy\"; Components: numpy; Flags: recursesubdirs
Source: "Lib\site-packages\FontTools.pth"; DestDir: "{app}\Lib\site-packages\"; Components: FontTools
Source: "Lib\site-packages\FontTools\*"; DestDir: "{app}\Lib\site-packages\FontTools\"; Components: FontTools; Flags: recursesubdirs
Source: "Lib\site-packages\TTFQuery*egg-info"; DestDir: "{app}\Lib\site-packages\"; Components: ttfquery
Source: "Lib\site-packages\ttfquery\*"; DestDir: "{app}\Lib\site-packages\ttfquery\"; Components: ttfquery; Flags: recursesubdirs
Source: "Lib\site-packages\Polygon*egg-info"; DestDir: "{app}\Lib\site-packages\"; Components: Polygon
Source: "Lib\site-packages\Polygon\*"; DestDir: "{app}\Lib\site-packages\Polygon\"; Components: Polygon; Flags: recursesubdirs
Source: "Lib\site-packages\vidle\*.py"; DestDir: "{app}\Lib\site-packages\vidle\"; Components: VIDLE; Flags: recursesubdirs
Source: "Lib\site-packages\vidle\*.pyc"; DestDir: "{app}\Lib\site-packages\vidle\"; Components: VIDLE; Flags: recursesubdirs
Source: "Lib\site-packages\vidle\*.pyw"; DestDir: "{app}\Lib\site-packages\vidle\"; Components: VIDLE; Flags: recursesubdirs
Source: "Lib\site-packages\vidle\*.txt"; DestDir: "{app}\Lib\site-packages\vidle\"; Components: VIDLE; Flags: recursesubdirs
Source: "Lib\site-packages\vidle\*.py"; DestDir: "{app}\Lib\site-packages\vidle\"; Components: VIDLE; Flags: recursesubdirs
Source: "Lib\site-packages\vidle\*.bat"; DestDir: "{app}\Lib\site-packages\vidle\"; Components: VIDLE; Flags: recursesubdirs
Source: "Lib\site-packages\vidle\*.def"; DestDir: "{app}\Lib\site-packages\vidle\"; Components: VIDLE; Flags: recursesubdirs
Source: "Lib\site-packages\vidle\*.gif"; DestDir: "{app}\Lib\site-packages\vidle\"; Components: VIDLE; Flags: recursesubdirs
Source: "Lib\site-packages\vidle\*.icns"; DestDir: "{app}\Lib\site-packages\vidle\"; Components: VIDLE; Flags: recursesubdirs
Source: "Lib\site-packages\visual\examples\*.py"; DestDir: "{app}\Lib\site-packages\visual\examples\"; Components: Examples
Source: "Lib\site-packages\visual\examples\*.tga"; DestDir: "{app}\Lib\site-packages\visual\examples\"; Components: Examples
Source: "c:\workspace\vpython-core2\docs\index.html"; DestDir: "{app}\Lib\site-packages\visual\docs\"; Components: Documentation
Source: "c:\workspace\vpython-core2\docs\visual\*.html"; DestDir: "{app}\Lib\site-packages\visual\docs\visual\"; Components: Documentation
Source: "c:\workspace\vpython-core2\docs\visual\*.txt"; DestDir: "{app}\Lib\site-packages\visual\docs\visual\"; Components: Documentation
Source: "c:\workspace\vpython-core2\docs\visual\*.pdf"; DestDir: "{app}\Lib\site-packages\visual\docs\visual\"; Components: Documentation
Source: "c:\workspace\vpython-core2\docs\visual\*.gif"; DestDir: "{app}\Lib\site-packages\visual\docs\visual\"; Components: Documentation
Source: "c:\workspace\vpython-core2\docs\visual\*.css"; DestDir: "{app}\Lib\site-packages\visual\docs\visual\"; Components: Documentation
Source: "c:\workspace\vpython-core2\docs\visual\images\*.jpg"; DestDir: "{app}\Lib\site-packages\visual\docs\visual\images"; Components: Documentation
[Components]
Name: Visual; Description: "The Visual extension module for Python"; Types: full compact custom; Flags: fixed
Name: numpy; Description: "numpy 1.5.1 {code:NumpyStatus|C:\Python31}"; Types: full; Check: CheckNumpy( 'C:\Python31' )
; FontTools, ttfquery, and Polygon are needed by the 3D text object
Name: FontTools; Description: "FontTools 2.3 {code:FontToolsStatus|C:\Python31}"; Types: full; Check: CheckFontTools( 'C:\Python31' )
Name: ttfquery; Description: "ttfquery 1.0.4 {code:ttfqueryStatus|C:\Python31}"; Types: full; Check: Checkttfquery( 'C:\Python31' )
Name: Polygon; Description: "Polygon 3.0a1 {code:PolygonStatus|C:\Python31}"; Types: full; Check: CheckPolygon( 'C:\Python31' )
Name: Documentation; Description: "Documentation for the Visual extension to Python"; Types: full
Name: Examples; Description: "Example programs"; Types: full
Name: VIDLE; Description: "VIDLE: improved version of the IDLE program editor"; Types: full custom
[Tasks]
Name: desktopicon; Description: "Create a desktop icon to start VIDLE"
[Icons]
Name: "{commondesktop}\VIDLE for VPython"; Filename: "{app}\pythonw.exe"; Parameters: "{app}\Lib\site-packages\vidle\idle.pyw"; WorkingDir: "{app}\Lib\site-packages\visual\examples"; IconFilename: "{app}\DLLs\py.ico"; Tasks: desktopicon
Name: "{commonstartmenu}\VIDLE for VPython"; Filename: "{app}\pythonw.exe"; Parameters: "{app}\Lib\site-packages\vidle\idle.pyw"; WorkingDir: "{app}\Lib\site-packages\visual\examples"; IconFilename: "{app}\DLLs\py.ico"
; commonstartmenu puts a choice on the "All Programs" list.
; commonstartup puts a choice inside "All Programs/Startup"
; commonfavorites puts a choice in Internet Explorer!
; This code file contains a ShouldSkipPage function which looks
; for an appropriate version of python.exe,
; and if it is found we skip the "select a directory" page.
[Code]
program Setup;
// Try to discover where Python is actually installed.
function MyConst(Param: String): String;
var Exist1, Exist2: Boolean;
begin
Exist1 := FileExists( ExpandConstant('{reg:HKLM\Software\Python\PythonCore\3.1\InstallPath,}\python.exe'));
if Exist1 then
Result := ExpandConstant('{reg:HKLM\Software\Python\PythonCore\3.1\InstallPath,}')
else
begin
Exist2 := FileExists( ExpandConstant('{reg:HKCU\Software\Python\PythonCore\3.1\InstallPath,}\python.exe'));
if Exist2 then
Result := ExpandConstant('{reg:HKCU\Software\Python\PythonCore\3.1\InstallPath,}')
else
Result := 'C:\'
end
end;
function ShouldSkipPage(CurPage: Integer): Boolean;
var Result1, Result2: Boolean;
begin
case CurPage of
wpSelectDir:
begin
Result1 := FileExists( ExpandConstant('{reg:HKLM\Software\Python\PythonCore\3.1\InstallPath,}\python.exe'));
Result2 := FileExists( ExpandConstant('{reg:HKCU\Software\Python\PythonCore\3.1\InstallPath,}\python.exe'));
Result := Result1 or Result2
if not Result then
MsgBox('Could not locate where Python 3.1 is installed.' #13 'You will be asked where python.exe is located.', mbInformation, MB_OK);
end
else
Result := False;
end;
end;
// Need a function to determine if numpy is already installed.
function NumpyAvailable( BasePath: String): Boolean;
begin
Result := DirExists( BasePath + '\Lib\site-packages\numpy');
end;
// Choose a modifying string for the user-visible numpy component.
function NumpyStatus( Param: String): String;
begin
if NumpyAvailable( Param) then
Result := '(found)'
else
Result := '(Numpy must be selected)'
end;
// Don't clobber an existing installation of numpy
function CheckNumpy( Param: String): Boolean;
begin
Result := not NumpyAvailable( Param);
end;
//-------------------------------
// FontTools, ttfquery, and Polygon are needed by the 3D text object
// Need a function to determine if FontTools is already installed.
function FontToolsAvailable( BasePath: String): Boolean;
begin
Result := DirExists( BasePath + '\Lib\site-packages\FontTools');
end;
// Choose a modifying string for the user-visible FontTools component.
function FontToolsStatus( Param: String): String;
begin
if FontToolsAvailable( Param) then
Result := '(found)'
else
Result := '(FontTools must be selected)'
end;
// Don't clobber an existing installation of FontTools
function CheckFontTools( Param: String): Boolean;
begin
Result := not FontToolsAvailable( Param);
end;
//-------------------------------
// Need a function to determine if ttfquery is already installed.
function ttfqueryAvailable( BasePath: String): Boolean;
begin
Result := DirExists( BasePath + '\Lib\site-packages\ttfquery');
end;
// Choose a modifying string for the user-visible ttfquery component.
function ttfqueryStatus( Param: String): String;
begin
if ttfqueryAvailable( Param) then
Result := '(found)'
else
Result := '(ttfquery must be selected)'
end;
// Don't clobber an existing installation of ttfquery
function Checkttfquery( Param: String): Boolean;
begin
Result := not ttfqueryAvailable( Param);
end;
//-------------------------------
// Need a function to determine if Polygon is already installed.
function PolygonAvailable( BasePath: String): Boolean;
begin
Result := DirExists( BasePath + '\Lib\site-packages\Polygon');
end;
// Choose a modifying string for the user-visible Polygon component.
function PolygonStatus( Param: String): String;
begin
if PolygonAvailable( Param) then
Result := '(found)'
else
Result := '(Polygon must be selected)'
end;
// Don't clobber an existing installation of Polygon
function CheckPolygon( Param: String): Boolean;
begin
Result := not PolygonAvailable( Param);
end;