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