]> git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/make_installer.py
added newline conversion
[wxWidgets.git] / wxPython / distrib / make_installer.py
1 # -*- coding: iso-8859-1 -*-
2 #----------------------------------------------------------------------
3 # Name: make_installer.py
4 # Purpose: A script to create the wxPython windows installer
5 #
6 # Author: Robin Dunn
7 #
8 # Created: 30-April-2001
9 # RCS-ID: $Id$
10 # Copyright: (c) 2003 by Total Control Software
11 # Licence: wxWindows license
12 #----------------------------------------------------------------------
13
14 """
15 This script will generate a setup script for InnoSetup and then run it
16 to make the installer executable. If all goes right the proper versions
17 of Python and wxWindows (including hybrid/final settings) will all be
18 calculated based on what wxc.pyd imports and an appropriate installer
19 will be created.
20 """
21
22
23 import sys, os, time
24
25 KEEP_TEMPS = 0
26 ISCC = r"%s\InnoSetup2Ex\ISCC.exe %s"
27
28 #----------------------------------------------------------------------
29
30 ISS_Template = r'''
31 ;;------------------------------------------------------------
32
33 [Setup]
34 AppName = wxPython
35 AppVerName = wxPython %(VERSION)s for Python %(PYTHONVER)s
36 OutputBaseFilename = wxPythonWIN32-%(VERSION)s-%(PYVER)s
37 AppCopyright = Copyright © 2003 Total Control Software
38 DefaultDirName = {code:GetInstallDir|c:\DoNotInstallHere}
39 DefaultGroupName = wxPython %(SHORTVER)s for Python %(PYTHONVER)s
40 AlwaysCreateUninstallIcon = yes
41 AdminPrivilegesRequired = no
42 OutputDir = dist
43 WizardStyle = modern
44 UninstallStyle = modern
45 DisableStartupPrompt = true
46 Compression = bzip
47 DirExistsWarning = no
48 DisableReadyMemo = true
49 DisableReadyPage = true
50 ;;DisableDirPage = true
51 DisableProgramGroupPage = no
52 DisableAppendDir = true
53 UsePreviousAppDir = no
54 UsePreviousGroup = no
55
56 UninstallFilesDir = {app}\wxPython
57 AppPublisherURL = http://wxPython.org/
58 LicenseFile = licence\licence.txt
59 CodeFile = %(IFSFILE)s
60
61 ;;WizardDebug = yes
62
63 ;;------------------------------------------------------------
64
65 ;;[Dirs]
66 ;;Name: "{app}\"
67
68 ;;------------------------------------------------------------
69
70 [Components]
71 Name: core; Description: "wxPython modules and library"; Types: full compact custom; Flags: fixed
72 Name: docs; Description: "Documentation"; Types: full
73 Name: demo; Description: "Demo application"; Types: full
74 Name: samples; Description: "Sample applications"; Types: full
75
76
77 ;;------------------------------------------------------------
78
79 [Files]
80 Source: "%(SYSDIR)s\MSVCRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Check: IsSysInstall; Components: core
81 Source: "%(SYSDIR)s\MSVCIRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Check: IsSysInstall; Components: core
82 Source: "%(SYSDIR)s\MSVCP60.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Check: IsSysInstall; Components: core
83 Source: "%(SYSDIR)s\MSVCRT.dll"; DestDir: "{code:GetPythonDir}"; CopyMode: alwaysskipifsameorolder; Flags: uninsneveruninstall; Check: IsNotSysInstall; Components: core
84 Source: "%(SYSDIR)s\MSVCIRT.dll"; DestDir: "{code:GetPythonDir}"; CopyMode: alwaysskipifsameorolder; Flags: uninsneveruninstall; Check: IsNotSysInstall; Components: core
85 Source: "%(SYSDIR)s\MSVCP60.dll"; DestDir: "{code:GetPythonDir}"; CopyMode: alwaysskipifsameorolder; Flags: uninsneveruninstall; Check: IsNotSysInstall; Components: core
86
87 Source: "%(WXDIR)s\lib\%(WXDLL)s"; DestDir: "{app}\wxPython"; Components: core
88 %(MSLU)s
89 Source: "wxPython\wxc.pyd"; DestDir: "{app}\wxPython"; Components: core
90 Source: "wxPython\gridc.pyd"; DestDir: "{app}\wxPython"; Components: core
91 Source: "wxPython\helpc.pyd"; DestDir: "{app}\wxPython"; Components: core
92 Source: "wxPython\htmlc.pyd"; DestDir: "{app}\wxPython"; Components: core
93 Source: "wxPython\calendarc.pyd"; DestDir: "{app}\wxPython"; Components: core
94 Source: "wxPython\wizardc.pyd"; DestDir: "{app}\wxPython"; Components: core
95 Source: "wxPython\glcanvasc.pyd"; DestDir: "{app}\wxPython"; Components: core
96 Source: "wxPython\oglc.pyd"; DestDir: "{app}\wxPython"; Components: core
97 Source: "wxPython\stc_c.pyd"; DestDir: "{app}\wxPython"; Components: core
98 Source: "wxPython\xrcc.pyd"; DestDir: "{app}\wxPython"; Components: core
99 Source: "wxPython\gizmosc.pyd"; DestDir: "{app}\wxPython"; Components: core
100 Source: "wxPython\iewinc.pyd"; DestDir: "{app}\wxPython"; Components: core
101 Source: "wxPython\dllwidget_c.pyd"; DestDir: "{app}\wxPython"; Components: core
102
103 Source: "wxPython\*.py"; DestDir: "{app}\wxPython"; Components: core
104 Source: "wxPython\lib\*.py"; DestDir: "{app}\wxPython\lib"; Components: core
105 Source: "wxPython\lib\*.wdr"; DestDir: "{app}\wxPython\lib"; Components: core
106 Source: "wxPython\lib\editor\*.py"; DestDir: "{app}\wxPython\lib\editor"; Components: core
107 Source: "wxPython\lib\editor\*.txt"; DestDir: "{app}\wxPython\lib\editor"; Components: core
108 Source: "wxPython\lib\mixins\*.py"; DestDir: "{app}\wxPython\lib\mixins"; Components: core
109 Source: "wxPython\lib\PyCrust\*.py"; DestDir: "{app}\wxPython\lib\PyCrust"; Components: core
110 Source: "wxPython\lib\colourchooser\*.py"; DestDir: "{app}\wxPython\lib\colourchooser"; Components: core
111 Source: "wxPython\lib\colourchooser\*.py"; DestDir: "{app}\wxPython\lib\colourchooser"; Components: core
112 Source: "wxPython\py\*.py"; DestDir: "{app}\wxPython\py"; Components: core
113 Source: "wxPython\py\*.txt"; DestDir: "{app}\wxPython\py"; Components: core
114 Source: "wxPython\py\*.ico"; DestDir: "{app}\wxPython\py"; Components: core
115 Source: "wxPython\py\*.png"; DestDir: "{app}\wxPython\py"; Components: core
116 Source: "wxPython\py\tests\*.py"; DestDir: "{app}\wxPython\py\tests"; Components: core
117 Source: "wxPython\py\wxd\*.py"; DestDir: "{app}\wxPython\py\wxd"; Components: core
118
119 Source: "wx\*.py"; DestDir: "{app}\wx"; Components: core
120 Source: "wx\lib\*.py"; DestDir: "{app}\wx\lib"; Components: core
121 Source: "wx\lib\colourchooser\*.py"; DestDir: "{app}\wx\lib\colourchooser"; Components: core
122 Source: "wx\lib\editor\*.py"; DestDir: "{app}\wx\lib\editor"; Components: core
123 Source: "wx\lib\mixins\*.py"; DestDir: "{app}\wx\lib\mixins"; Components: core
124 Source: "wx\py\*.py"; DestDir: "{app}\wx\py"; Components: core
125 Source: "wx\tools\*.py"; DestDir: "{app}\wx\tools"; Components: core
126 Source: "wx\tools\XRCed\*.py"; DestDir: "{app}\wx\tools\XRCed"; Components: core
127
128
129 %(LOCALE)s
130
131 Source: "demo\*.py"; DestDir: "{app}\wxPython\demo"; Components: demo
132 Source: "demo\*.xml"; DestDir: "{app}\wxPython\demo"; Components: demo
133 Source: "demo\*.txt"; DestDir: "{app}\wxPython\demo"; Components: demo
134 Source: "demo\*.ico"; DestDir: "{app}\wxPython\demo"; Components: demo
135 Source: "demo\*.wdr"; DestDir: "{app}\wxPython\demo"; Components: demo
136
137 Source: "demo\bitmaps\*.gif"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
138 Source: "demo\bitmaps\*.bmp"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
139 Source: "demo\bitmaps\*.jpg"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
140 Source: "demo\bitmaps\*.png"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
141 Source: "demo\bitmaps\*.ico"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
142
143 Source: "demo\bmp_source\*.gif"; DestDir: "{app}\wxPython\demo\bmp_source"; Components: demo
144 Source: "demo\bmp_source\*.bmp"; DestDir: "{app}\wxPython\demo\bmp_source"; Components: demo
145 ;;Source: "demo\bmp_source\*.jpg"; DestDir: "{app}\wxPython\demo\bmp_source"; Components: demo
146 Source: "demo\bmp_source\*.png"; DestDir: "{app}\wxPython\demo\bmp_source"; Components: demo
147 Source: "demo\bmp_source\*.ico"; DestDir: "{app}\wxPython\demo\bmp_source"; Components: demo
148
149 Source: "demo\data\*.htm"; DestDir: "{app}\wxPython\demo\data"; Components: demo
150 Source: "demo\data\*.html"; DestDir: "{app}\wxPython\demo\data"; Components: demo
151 Source: "demo\data\*.py"; DestDir: "{app}\wxPython\demo\data"; Components: demo
152 Source: "demo\data\*.png"; DestDir: "{app}\wxPython\demo\data"; Components: demo
153 Source: "demo\data\*.bmp"; DestDir: "{app}\wxPython\demo\data"; Components: demo
154 Source: "demo\data\*.i"; DestDir: "{app}\wxPython\demo\data"; Components: demo
155 Source: "demo\data\*.dat"; DestDir: "{app}\wxPython\demo\data"; Components: demo
156 Source: "demo\data\*.txt"; DestDir: "{app}\wxPython\demo\data"; Components: demo
157 Source: "demo\data\*.wav"; DestDir: "{app}\wxPython\demo\data"; Components: demo
158 Source: "demo\data\*.wdr"; DestDir: "{app}\wxPython\demo\data"; Components: demo
159 Source: "demo\data\*.xrc"; DestDir: "{app}\wxPython\demo\data"; Components: demo
160 Source: "demo\data\*.gif"; DestDir: "{app}\wxPython\demo\data"; Components: demo
161
162 Source: "demo\dllwidget\*.cpp"; DestDir: "{app}\wxPython\demo\dllwidget"; Components: demo
163 Source: "demo\dllwidget\*.py"; DestDir: "{app}\wxPython\demo\dllwidget"; Components: demo
164 Source: "demo\dllwidget\Makefile"; DestDir: "{app}\wxPython\demo\dllwidget"; Components: demo
165 Source: "demo\dllwidget\makefile.*"; DestDir: "{app}\wxPython\demo\dllwidget"; Components: demo
166
167 Source: "README.txt"; DestDir: "{app}\wxPython\docs"; Flags: isreadme; Components: core
168 Source: "CHANGES.txt"; DestDir: "{app}\wxPython\docs"; Components: core
169 Source: "licence\*.txt"; DestDir: "{app}\wxPython\docs\licence"; Components: core
170 Source: "%(WXDIR)s\docs\htmlhelp\wx.chm"; DestDir: "{app}\wxPython\docs"; Components: docs
171 Source: "%(WXDIR)s\docs\htmlhelp\ogl.chm"; DestDir: "{app}\wxPython\docs"; Components: docs
172 Source: "docs\*.txt"; DestDir: "{app}\wxPython\docs"; Components: docs
173 Source: "docs\*.css"; DestDir: "{app}\wxPython\docs"; Components: docs
174 Source: "docs\*.html"; DestDir: "{app}\wxPython\docs"; Components: docs
175 Source: "docs\*.conf"; DestDir: "{app}\wxPython\docs"; Components: docs
176 Source: "docs\screenshots\*.png"; DestDir: "{app}\wxPython\docs\screenshots"; Components: docs
177
178 Source: "wxPython\tools\*.py"; DestDir: "{app}\wxPython\tools"; Components: core
179 Source: "wxPython\tools\XRCed\*.txt"; DestDir: "{app}\wxPython\tools\XRCed"; Components: core
180 Source: "wxPython\tools\XRCed\sawfishrc"; DestDir: "{app}\wxPython\tools\XRCed"; Components: core
181 Source: "wxPython\tools\XRCed\*.py"; DestDir: "{app}\wxPython\tools\XRCed"; Components: core
182 Source: "wxPython\tools\XRCed\*.xrc"; DestDir: "{app}\wxPython\tools\XRCed"; Components: core
183 Source: "wxPython\tools\XRCed\*.ico"; DestDir: "{app}\wxPython\tools\XRCed"; Components: core
184 Source: "wxPython\tools\XRCed\*.png"; DestDir: "{app}\wxPython\tools\XRCed"; Components: core
185 Source: "wxPython\tools\XRCed\*.sh"; DestDir: "{app}\wxPython\tools\XRCed"; Components: core
186 Source: "wxPython\tools\XRCed\src-images\*.png"; DestDir: "{app}\wxPython\tools\XRCed\src-images"; Components: core
187
188 Source: "scripts\*.bat"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
189 Source: "scripts\*.py"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
190 Source: "scripts\helpviewer"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
191 Source: "scripts\img2png"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
192 Source: "scripts\img2py"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
193 Source: "scripts\img2xpm"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
194 Source: "scripts\pyalacarte"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
195 Source: "scripts\pyalamode"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
196 Source: "scripts\pyshell"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
197 Source: "scripts\pycrust"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
198 Source: "scripts\pywrap"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
199 Source: "scripts\xrced"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
200
201 Source: "samples\doodle\*.py"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples
202 Source: "samples\doodle\*.txt"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples
203 Source: "samples\doodle\sample.ddl"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples
204 Source: "samples\doodle\superdoodle.iss"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples
205
206 Source: "samples\wxProject\*.txt"; DestDir: "{app}\wxPython\samples\wxProject"; Components: samples
207 Source: "samples\wxProject\*.py"; DestDir: "{app}\wxPython\samples\wxProject"; Components: samples
208
209 Source: "samples\StyleEditor\*.txt"; DestDir: "{app}\wxPython\samples\StyleEditor"; Components: samples
210 Source: "samples\StyleEditor\*.py"; DestDir: "{app}\wxPython\samples\StyleEditor"; Components: samples
211 Source: "samples\StyleEditor\*.cfg"; DestDir: "{app}\wxPython\samples\StyleEditor"; Components: samples
212
213 Source: "samples\pySketch\*.py"; DestDir: "{app}\wxPython\samples\pySketch"; Components: samples
214 Source: "samples\pySketch\images\*.bmp"; DestDir: "{app}\wxPython\samples\pySketch\images"; Components: samples
215
216 Source: "samples\frogedit\*.py"; DestDir: "{app}\wxPython\samples\frogedit"; Components: samples
217
218 Source: "samples\hangman\*.py"; DestDir: "{app}\wxPython\samples\hangman"; Components: samples
219
220 Source: "samples\embedded\*.py"; DestDir: "{app}\wxPython\samples\embedded"; Components: samples
221 Source: "samples\embedded\*.cpp"; DestDir: "{app}\wxPython\samples\embedded"; Components: samples
222 Source: "samples\embedded\*.txt"; DestDir: "{app}\wxPython\samples\embedded"; Components: samples
223 Source: "samples\embedded\*.vc"; DestDir: "{app}\wxPython\samples\embedded"; Components: samples
224 Source: "samples\embedded\*.unx"; DestDir: "{app}\wxPython\samples\embedded"; Components: samples
225 Source: "samples\embedded\*.ico"; DestDir: "{app}\wxPython\samples\embedded"; Components: samples
226 Source: "samples\embedded\*.xpm"; DestDir: "{app}\wxPython\samples\embedded"; Components: samples
227
228 Source: "samples\wx_examples\basic\*.py"; DestDir: "{app}\wxPython\samples\wx_examples\basic"; Components: samples
229 Source: "samples\wx_examples\hello\*.py"; DestDir: "{app}\wxPython\samples\wx_examples\hello"; Components: samples
230 Source: "samples\wx_examples\hello\*.jpg"; DestDir: "{app}\wxPython\samples\wx_examples\hello"; Components: samples
231
232 Source: "src\winxp.manifest"; DestDir: "{code:GetPythonDir}"; DestName: "python.exe.manifest"; Components: core
233 Source: "src\winxp.manifest"; DestDir: "{code:GetPythonDir}"; DestName: "pythonw.exe.manifest"; Components: core
234
235
236 ;;------------------------------------------------------------
237
238 [Run]
239 ;; Compile the .py files
240 Filename: "{code:GetPythonDir}\python.exe"; Parameters: "{code:GetPythonDir}\Lib\compileall.py {app}\wxPython {app}\wx"; Description: "Compile Python .py files to .pyc"; Flags: postinstall; Components: core
241
242 ;; Recreate the tool scripts to use the paths on the users machine
243 Filename: "{code:GetPythonDir}\python.exe"; Parameters: "CreateBatchFiles.py"; WorkingDir: "{code:GetPythonDir}\Scripts"; Description: "Create batch files for tool scripts"; Flags: postinstall; Components: core
244
245
246 ;;------------------------------------------------------------
247
248 [Icons]
249 Name: "{group}\Run the wxPython DEMO"; Filename: "{code:GetPythonDir}\pythonw.exe"; WorkingDir: "{app}\wxPython\demo"; Parameters: "demo.py"; IconFilename: "{app}\wxPython\demo\wxpdemo.ico"; Components: core
250 Name: "{group}\PyCrust"; Filename: "{code:GetPythonDir}\pythonw.exe"; WorkingDir: "c:\"; Parameters: "{code:GetPythonDir}\Scripts\pycrust"; IconFilename: "{app}\wxPython\py\PyCrust.ico"; Components: core
251 Name: "{group}\PyShell"; Filename: "{code:GetPythonDir}\pythonw.exe"; WorkingDir: "c:\"; Parameters: "{code:GetPythonDir}\Scripts\pyshell"; IconFilename: "{app}\wxPython\py\PyCrust.ico"; Components: core
252 Name: "{group}\PyAlaMode"; Filename: "{code:GetPythonDir}\pythonw.exe"; WorkingDir: "c:\"; Parameters: "{code:GetPythonDir}\Scripts\pyalamode"; IconFilename: "{app}\wxPython\py\PyCrust.ico"; Components: core
253 Name: "{group}\PyAlaCarte"; Filename: "{code:GetPythonDir}\pythonw.exe"; WorkingDir: "c:\"; Parameters: "{code:GetPythonDir}\Scripts\pyalacarte"; IconFilename: "{app}\wxPython\py\PyCrust.ico"; Components: core
254 Name: "{group}\wxWindows Reference"; Filename: "{app}\wxPython\docs\wx.chm"; Components: docs
255 Name: "{group}\wxOGL Reference"; Filename: "{app}\wxPython\docs\ogl.chm"; Components: docs
256 Name: "{group}\licence.txt"; Filename: "{app}\wxPython\docs\licence\licence.txt"; Components: core
257 Name: "{group}\README.txt"; Filename: "{app}\wxPython\docs\README.txt"; Components: core
258 Name: "{group}\CHANGES.txt"; Filename: "{app}\wxPython\docs\CHANGES.txt"; Components: core
259 Name: "{group}\Sample Apps"; Filename: "{app}\wxPython\samples"; Components: samples
260 Name: "{group}\Resource Editor"; Filename: "{code:GetPythonDir}\pythonw.exe"; WorkingDir: "c:\"; Parameters: "{code:GetPythonDir}\Scripts\xrced"; IconFilename: "{app}\wxPython\Tools\XRCed\xrced.ico"; Components: core
261 Name: "{group}\wxPython Docs"; Filename: "{app}\wxPython\docs\wxPythonDocs.html"; Components: docs
262
263
264 ;;------------------------------------------------------------
265
266 [UninstallDelete]
267 Type: files; Name: "{app}\wxPython\*.pyc";
268 Type: files; Name: "{app}\wxPython\*.pyo";
269 Type: files; Name: "{app}\wxPython\*.pyd";
270 Type: files; Name: "{app}\wxPython\lib\*.pyc";
271 Type: files; Name: "{app}\wxPython\lib\*.pyo";
272 Type: files; Name: "{app}\wxPython\lib\editor\*.pyc";
273 Type: files; Name: "{app}\wxPython\lib\editor\*.pyo";
274 Type: files; Name: "{app}\wxPython\lib\mixins\*.pyc";
275 Type: files; Name: "{app}\wxPython\lib\mixins\*.pyo";
276 Type: files; Name: "{app}\wxPython\lib\PyCrust\*.pyc";
277 Type: files; Name: "{app}\wxPython\lib\PyCrust\*.pyo";
278 Type: files; Name: "{app}\wxPython\lib\colourchooser\*.pyc";
279 Type: files; Name: "{app}\wxPython\lib\colourchooser\*.pyo";
280 Type: files; Name: "{app}\wxPython\py\*.pyc";
281 Type: files; Name: "{app}\wxPython\py\*.pyo";
282 Type: files; Name: "{app}\wxPython\py\tests\*.pyc";
283 Type: files; Name: "{app}\wxPython\py\tests\*.pyo";
284 Type: files; Name: "{app}\wxPython\py\wxd\*.pyc";
285 Type: files; Name: "{app}\wxPython\py\wxd\*.pyo";
286 Type: files; Name: "{app}\wxPython\tools\*.pyc";
287 Type: files; Name: "{app}\wxPython\tools\*.pyo";
288 Type: files; Name: "{app}\wxPython\tools\XRCed\*.pyc";
289 Type: files; Name: "{app}\wxPython\tools\XRCed\*.pyo";
290 Type: files; Name: "{app}\wxPython\demo\*.pyc";
291 Type: files; Name: "{app}\wxPython\demo\*.pyo";
292 Type: files; Name: "{app}\wxPython\demo\data\showTips";
293 Type: files; Name: "{app}\wxPython\tools\*.pyc";
294 Type: files; Name: "{app}\wxPython\tools\*.pyo";
295 Type: files; Name: "{app}\wxPython\tools\XRCed\*.pyc";
296 Type: files; Name: "{app}\wxPython\tools\XRCed\*.pyo";
297 Type: files; Name: "{app}\wxPython\samples\doodle\*.pyc";
298 Type: files; Name: "{app}\wxPython\samples\doodle\*.pyo";
299 Type: files; Name: "{app}\wxPython\samples\wxProject\*.pyc";
300 Type: files; Name: "{app}\wxPython\samples\wxProject\*.pyo";
301 Type: files; Name: "{app}\wxPython\samples\StyleEditor\*.pyc";
302 Type: files; Name: "{app}\wxPython\samples\StyleEditor\*.pyo";
303 Type: files; Name: "{app}\wxPython\samples\frogedit\*.pyc";
304 Type: files; Name: "{app}\wxPython\samples\frogedit\*.pyo";
305 Type: files; Name: "{app}\wxPython\samples\hangman\*.pyc";
306 Type: files; Name: "{app}\wxPython\samples\hangman\*.pyo";
307 Type: files; Name: "{app}\wxPython\samples\hangman\*.txt";
308 Type: files; Name: "{app}\wxPython\samples\wx_examples\basic\*.pyc";
309 Type: files; Name: "{app}\wxPython\samples\wx_examples\basic\*.pyo";
310 Type: files; Name: "{app}\wxPython\samples\wx_examples\hello\*.pyc";
311 Type: files; Name: "{app}\wxPython\samples\wx_examples\hello\*.pyo";
312 Type: files; Name: "{app}\wxPython\demo\data\*.pyc";
313 Type: files; Name: "{app}\wxPython\demo\data\*.pyo";
314 Type: files; Name: "{app}\wxPython\demo\dllwidget\*.pyc";
315 Type: files; Name: "{app}\wxPython\demo\dllwidget\*.pyo";
316 Type: files; Name: "{app}\wxPython\samples\embedded\*.pyc";
317 Type: files; Name: "{app}\wxPython\samples\embedded\*.pyo";
318 Type: files; Name: "{app}\wxPython\samples\pySketch\*.pyc";
319 Type: files; Name: "{app}\wxPython\samples\pySketch\*.pyo";
320 Type: files; Name: "{app}\wx\*.pyc";
321 Type: files; Name: "{app}\wx\*.pyo";
322 Type: files; Name: "{app}\wx\lib\*.pyc";
323 Type: files; Name: "{app}\wx\lib\*.pyo";
324 Type: files; Name: "{app}\wx\lib\colourchooser\*.pyc";
325 Type: files; Name: "{app}\wx\lib\colourchooser\*.pyo";
326 Type: files; Name: "{app}\wx\lib\editor\*.pyc";
327 Type: files; Name: "{app}\wx\lib\editor\*.pyo";
328 Type: files; Name: "{app}\wx\lib\mixins\*.pyc";
329 Type: files; Name: "{app}\wx\lib\mixins\*.pyo";
330 Type: files; Name: "{app}\wx\py\*.pyc";
331 Type: files; Name: "{app}\wx\py\*.pyo";
332 Type: files; Name: "{app}\wx\tools\*.pyc";
333 Type: files; Name: "{app}\wx\tools\*.pyo";
334 Type: files; Name: "{app}\wx\tools\XRCed\*.pyc";
335 Type: files; Name: "{app}\wx\tools\XRCed\*.pyo";
336
337
338
339
340 '''
341
342
343 #----------------------------------------------------------------------
344
345
346 IFS_Template = r"""
347 program Setup;
348 var
349 PythonDir : String;
350 InstallDir : String;
351 sysInstall : Boolean;
352
353
354 function InitializeSetup(): Boolean;
355 begin
356
357 (* -------------------------------------------------------------- *)
358 (* Figure out what to use as a default installation dir *)
359
360 if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
361 'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
362 '', PythonDir) then begin
363
364 if not RegQueryStringValue(HKEY_CURRENT_USER,
365 'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
366 '', PythonDir) then begin
367
368 MsgBox('No installation of Python %(PYTHONVER)s found in registry.' + #13 +
369 'Be sure to enter a pathname that places wxPython on the PYTHONPATH',
370 mbConfirmation, MB_OK);
371 PythonDir := 'C:\Put a directory on PYTHONPATH here\';
372 end;
373 end;
374 InstallDir := PythonDir;
375 %(IF22)s
376
377
378 (* -------------------------------------------------------------- *)
379 (* And now where to put the system DLLs *)
380
381 sysInstall := False;
382
383 (* Check if Python has a regkey in HKLM, if so it installed the DLLs in the SYSTEM dir *)
384 if RegValueExists(HKEY_LOCAL_MACHINE,
385 'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath', '') then begin
386 sysInstall := True;
387 end;
388
389 (* If so, ensure that the user can write to HKLM *)
390 if sysInstall and not RegWriteStringValue(HKEY_LOCAL_MACHINE,
391 'Software\Python\PythonCore\%(PYTHONVER)s\Modules\wxPython',
392 '', '%(VERSION)s') then begin
393 (* if not then revert to installing to the Python dir *)
394 sysInstall := False;
395 (* and put the regkey in HKCU *)
396 RegWriteStringValue(HKEY_CURRENT_USER,
397 'Software\Python\PythonCore\%(PYTHONVER)s\Modules\wxPython',
398 '', '%(VERSION)s');
399 end;
400
401 Result := true;
402 end;
403
404
405 function IsSysInstall(): Boolean;
406 begin
407 Result := sysInstall;
408 end;
409 function IsNotSysInstall(): Boolean;
410 begin
411 Result := not sysInstall;
412 end;
413
414
415
416 function GetDLLDir(Default: String): String;
417 begin
418 if sysInstall then begin
419 Result := Default;
420 end else begin
421 Result := PythonDir;
422 end;
423 end;
424
425
426 function GetPythonDir(Default: String): String;
427 begin
428 Result := PythonDir;
429 end;
430
431
432 function GetInstallDir(Default: String): String;
433 begin
434 Result := InstallDir;
435 end;
436
437
438
439 function NextButtonClick(CurPage: Integer): Boolean;
440 var
441 FileName: string;
442 ResultCode: Integer;
443 begin
444 Result := True;
445 if CurPage <> wpSelectDir then Exit;
446 FileName := WizardDirValue() + '\wxPython\unins000.exe';
447 if FileExists(FileName) then begin
448 ResultCode := MsgBox('A prior wxPython installation was found in this directory. It' + #13 +
449 'is recommended that it be uninstalled first.' + #13#13 +
450 'Should I do it?',
451 mbConfirmation, MB_YESNO);
452 if ResultCode = IDYES then begin
453 InstExec(FileName, '/SILENT', WizardDirValue()+'\wxPython', True, False, SW_SHOWNORMAL, ResultCode);
454
455 end;
456 end;
457 end;
458
459
460 begin
461 end.
462
463 """
464
465 #----------------------------------------------------------------------
466
467 def find_DLLs():
468
469 WXDLL = PYTHONVER = None
470
471 proc = os.popen(r"dumpbin /imports wxPython\wxc.pyd", "r")
472 lines = proc.readlines()
473 proc.close()
474 for line in lines:
475 if line[:6] == " wx":
476 WXDLL = line.strip()
477
478 if line[:10] == " python":
479 PYTHONVER = line[10] + '.' + line[11]
480
481 if WXDLL and PYTHONVER:
482 return WXDLL, PYTHONVER
483
484
485 #----------------------------------------------------------------------
486
487 locale_template = 'Source: "%s"; DestDir: "{app}\%s"; Components: core'
488
489 def build_locale_string():
490 stringlst = []
491
492 def walk_helper(lst, dirname, files):
493 for f in files:
494 filename = os.path.join(dirname, f)
495 if not os.path.isdir(filename):
496 lst.append( locale_template % (filename, dirname) )
497
498 os.path.walk('wxPython\\locale', walk_helper, stringlst)
499 return '\n'.join(stringlst)
500
501 def get_system_dir():
502 for p in [r"C:\WINNT\SYSTEM32",
503 r"C:\WINDOWS\SYSTEM32",
504 ]:
505 if os.path.exists(p):
506 return p
507 raise IOError, "System dir not found"
508
509
510 #----------------------------------------------------------------------
511
512 def main():
513
514 verglob = {}
515 execfile("wxPython/__version__.py", verglob)
516
517 VERSION = verglob["wxVERSION_STRING"]
518 SHORTVER = VERSION[:3]
519
520 WXDLL, PYTHONVER = find_DLLs()
521
522 PYVER = "Py" + PYTHONVER[0] + PYTHONVER[2]
523 WXDIR = os.environ["WXWIN"]
524 WXPYDIR = os.path.join(WXDIR, "wxPython")
525 SYSDIR = get_system_dir()
526 ISSFILE = "__wxPython.iss"
527 IFSFILE = "__wxPython.ifs"
528 LOCALE = build_locale_string()
529
530 if PYTHONVER >= "2.2":
531 IF22 = r"InstallDir := InstallDir + '\Lib\site-packages';"
532 else:
533 IF22 = ""
534
535 # Starting with 2.3.3 the hybrid build is the release build too, so
536 # no need to label it that way.
537 ##if WXDLL.find("h") != -1:
538 ## PYVER = PYVER + "-hybrid"
539
540 MSLU=''
541 if len(sys.argv) > 1 and sys.argv[1] == "UNICODE=1":
542 MSLU=r'Source: "%(WXDIR)s\lib\unicows.dll"; DestDir: "{code:GetPythonDir}"; Components: core' % vars()
543
544 f = open(ISSFILE, "w")
545 f.write(ISS_Template % vars())
546 f.close()
547
548 f = open(IFSFILE, "w")
549 f.write(IFS_Template % vars())
550 f.close()
551
552 os.system(ISCC % (os.environ['TOOLS'], ISSFILE))
553
554 if not KEEP_TEMPS:
555 time.sleep(1)
556 os.remove(ISSFILE)
557 os.remove(IFSFILE)
558
559
560 #----------------------------------------------------------------------
561
562 if __name__ == "__main__":
563 main()
564
565
566
567 #----------------------------------------------------------------------
568
569