]> git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/make_installer.py
Don't build the old versions of OGL or iewin by default anymore
[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 _core_.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 [Setup]
33 AppName = wxPython%(SHORTVER)s-%(CHARTYPE)s-%(PYVER)s
34 AppVerName = wxPython %(VERSION)s (%(CHARTYPE)s) for Python %(PYTHONVER)s
35 OutputBaseFilename = wxPython%(SHORTVER)s-win32-%(CHARTYPE)s-%(VERSION)s-%(PYVER)s
36 AppCopyright = Copyright © 2004 Total Control Software
37 DefaultDirName = {code:GetInstallDir|c:\DoNotInstallHere}
38 DefaultGroupName = wxPython %(VERSION)s (%(CHARTYPE)s) for Python %(PYTHONVER)s
39 AlwaysCreateUninstallIcon = no
40 AdminPrivilegesRequired = no
41 OutputDir = dist
42 WizardStyle = modern
43 UninstallStyle = modern
44 DisableStartupPrompt = true
45 Compression = bzip
46 DirExistsWarning = no
47 DisableReadyMemo = true
48 DisableReadyPage = true
49 ;;DisableDirPage = true
50 DisableProgramGroupPage = true
51 DisableAppendDir = true
52 UsePreviousAppDir = no
53 UsePreviousGroup = no
54
55 AppPublisher = Total Control Software
56 AppPublisherURL = http://wxPython.org/
57 AppSupportURL = http://wxPython.org/maillist.php
58 AppUpdatesURL = http://wxPython.org/download.php
59 AppVersion = %(VERSION)s-%(CHARTYPE)s
60
61 UninstallFilesDir = {app}\%(PKGDIR)s
62 LicenseFile = licence\licence.txt
63 CodeFile = %(IFSFILE)s
64
65 ;; WizardDebug = yes
66
67 ;;------------------------------------------------------------
68
69 [Components]
70 Name: core; Description: "wxPython modules and library"; Types: full custom; Flags: fixed
71 Name: manifest; Description: "Manifest files for XP Themed LnF"; Types: full
72 Name: pthfile; Description: "Make this install be the default wxPython"; Types: full
73
74 ;;------------------------------------------------------------
75
76 [Files]
77 %(RTDLL)s
78 Source: "%(WXDIR)s\lib\vc_dll\wx*%(WXDLLVER)s_*.dll"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
79 %(MSLU)s
80
81 Source: "wx\_core_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
82 Source: "wx\_gdi_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
83 Source: "wx\_windows_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
84 Source: "wx\_controls_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
85 Source: "wx\_misc_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
86 Source: "wx\_calendar.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
87 Source: "wx\_grid.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
88 Source: "wx\_html.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
89 Source: "wx\_wizard.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
90 Source: "wx\_gizmos.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
91 Source: "wx\_glcanvas.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
92 ;;Source: "wx\_iewin.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
93 Source: "wx\_activex.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
94 ;;Source: "wx\_ogl.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
95 Source: "wx\_stc.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
96 Source: "wx\_xrc.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
97
98
99 Source: "wx\*.py"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
100 Source: "wx\build\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\build"; Components: core
101 Source: "wx\lib\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib"; Components: core
102 Source: "wx\lib\colourchooser\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\colourchooser"; Components: core
103 Source: "wx\lib\editor\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\editor"; Components: core
104 Source: "wx\lib\editor\*.txt"; DestDir: "{app}\%(PKGDIR)s\wx\lib\editor"; Components: core
105 Source: "wx\lib\mixins\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\mixins"; Components: core
106 Source: "wx\lib\masked\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\masked"; Components: core
107 Source: "wx\lib\ogl\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\ogl"; Components: core
108 Source: "wx\lib\floatcanvas\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\floatcanvas"; Components: core
109 Source: "wx\py\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\py"; Components: core
110 Source: "wx\py\*.txt"; DestDir: "{app}\%(PKGDIR)s\wx\py"; Components: core
111 Source: "wx\py\*.ico"; DestDir: "{app}\%(PKGDIR)s\wx\py"; Components: core
112 Source: "wx\py\*.png"; DestDir: "{app}\%(PKGDIR)s\wx\py"; Components: core
113 Source: "wx\py\tests\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\py\tests"; Components: core
114 Source: "wx\tools\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\tools"; Components: core
115 Source: "wx\tools\XRCed\*.txt"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
116 Source: "wx\tools\XRCed\sawfishrc"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
117 Source: "wx\tools\XRCed\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
118 Source: "wx\tools\XRCed\*.xrc"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
119 Source: "wx\tools\XRCed\*.ico"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
120 Source: "wx\tools\XRCed\*.png"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
121 Source: "wx\tools\XRCed\*.sh"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
122 Source: "wx\tools\XRCed\src-images\*.png"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed\src-images"; Components: core
123
124
125 Source: "wxPython\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython"; Components: core
126 Source: "wxPython\lib\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\lib"; Components: core
127 Source: "wxPython\lib\colourchooser\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\lib\colourchooser"; Components: core
128 Source: "wxPython\lib\editor\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\lib\editor"; Components: core
129 Source: "wxPython\lib\mixins\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\lib\mixins"; Components: core
130 Source: "wxPython\tools\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\tools"; Components: core
131
132
133 Source: "src\winxp.manifest"; DestDir: "{code:GetPythonDir}"; DestName: "python.exe.manifest"; Flags: sharedfile; Components: manifest
134 Source: "src\winxp.manifest"; DestDir: "{code:GetPythonDir}"; DestName: "pythonw.exe.manifest"; Flags: sharedfile; Components: manifest
135 Source: "wxversion\wxversion.py"; DestDir: "{app}"; Flags: sharedfile; Components: core
136 Source: "src\wx.pth"; DestDir: "{app}"; Flags: sharedfile; Components: pthfile
137
138 %(LOCALE)s
139
140
141 Source: "scripts\*.py"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
142 Source: "scripts\helpviewer"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
143 Source: "scripts\img2png"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
144 Source: "scripts\img2py"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
145 Source: "scripts\img2xpm"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
146 Source: "scripts\pyalacarte"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
147 Source: "scripts\pyalamode"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
148 Source: "scripts\pyshell"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
149 Source: "scripts\pycrust"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
150 Source: "scripts\pywrap"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
151 Source: "scripts\pywxrc"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
152 Source: "scripts\xrced"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
153
154
155 Source: "distrib\README.win32.txt"; DestDir: "{app}\%(PKGDIR)s\docs"; Flags: isreadme; Components: core
156 Source: "licence\*.txt"; DestDir: "{app}\%(PKGDIR)s\docs\licence"; Components: core
157
158
159
160 ;;------------------------------------------------------------
161
162 [Run]
163 ;; Compile the .py files
164 Filename: "{code:GetPythonDir}\python.exe"; Parameters: "{code:GetPythonDir}\Lib\compileall.py {app}\%(PKGDIR)s"; Description: "Compile Python .py files to .pyc"; Flags: postinstall; Components: core
165
166 ;; Recreate the tool scripts to use the paths on the users machine
167 Filename: "{code:GetPythonDir}\python.exe"; Parameters: "CreateBatchFiles.py"; WorkingDir: "{code:GetPythonDir}\Scripts"; Description: "Create batch files for tool scripts"; Flags: postinstall; Components: core
168
169
170
171
172 ;;------------------------------------------------------------
173
174 [UninstallDelete]
175 Type: files; Name: "{app}\%(PKGDIR)s\wx\*.pyc";
176 Type: files; Name: "{app}\%(PKGDIR)s\wx\*.pyo";
177 Type: files; Name: "{app}\%(PKGDIR)s\wx\*.pyd";
178 Type: files; Name: "{app}\%(PKGDIR)s\wx\build\*.pyc";
179 Type: files; Name: "{app}\%(PKGDIR)s\wx\build\*.pyo";
180 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\*.pyc";
181 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\*.pyo";
182 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\colourchooser\*.pyc";
183 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\colourchooser\*.pyo";
184 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\editor\*.pyc";
185 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\editor\*.pyo";
186 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\mixins\*.pyc";
187 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\mixins\*.pyo";
188 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\masked\*.pyc";
189 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\masked\*.pyo";
190 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\ogl\*.pyc";
191 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\ogl\*.pyo";
192 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\floatcanvas\*.pyc";
193 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\floatcanvas\*.pyo";
194
195 Type: files; Name: "{app}\%(PKGDIR)s\wx\py\*.pyc";
196 Type: files; Name: "{app}\%(PKGDIR)s\wx\py\*.pyo";
197 Type: files; Name: "{app}\%(PKGDIR)s\wx\py\tests\*.pyc";
198 Type: files; Name: "{app}\%(PKGDIR)s\wx\py\tests\*.pyo";
199 Type: files; Name: "{app}\%(PKGDIR)s\wx\tools\*.pyc";
200 Type: files; Name: "{app}\%(PKGDIR)s\wx\tools\*.pyo";
201 Type: files; Name: "{app}\%(PKGDIR)s\wx\tools\XRCed\*.pyc";
202 Type: files; Name: "{app}\%(PKGDIR)s\wx\tools\XRCed\*.pyo";
203
204
205 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\*.pyc";
206 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\*.pyo";
207 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\*.pyc";
208 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\*.pyo";
209 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\colourchooser\*.pyc";
210 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\colourchooser\*.pyo";
211 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\editor\*.pyc";
212 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\editor\*.pyo";
213 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\mixins\*.pyc";
214 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\mixins\*.pyo";
215 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\tools\*.pyc";
216 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\tools\*.pyo";
217
218 %(UNINSTALL_BATCH)s
219
220 '''
221
222
223 #----------------------------------------------------------------------
224
225
226 IFS_Template = r"""
227 program Setup;
228 var
229 PythonDir : String;
230 InstallDir : String;
231
232
233 function InitializeSetup(): Boolean;
234 begin
235
236 (* -------------------------------------------------------------- *)
237 (* Figure out what to use as a default installation dir *)
238
239 if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
240 'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
241 '', PythonDir) then begin
242
243 if not RegQueryStringValue(HKEY_CURRENT_USER,
244 'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
245 '', PythonDir) then begin
246
247 MsgBox('No installation of Python %(PYTHONVER)s found in registry.' + #13 +
248 'Be sure to enter a pathname that places wxPython on the PYTHONPATH',
249 mbConfirmation, MB_OK);
250 PythonDir := 'C:\Put a directory on PYTHONPATH here\';
251 end;
252 end;
253 InstallDir := PythonDir;
254 %(IF22)s
255
256 Result := True;
257 end;
258
259
260 function GetPythonDir(Default: String): String;
261 begin
262 Result := PythonDir;
263 end;
264
265
266 function GetInstallDir(Default: String): String;
267 begin
268 Result := InstallDir;
269 end;
270
271
272
273 function UninstallOld(FileName: String): Boolean;
274 var
275 ResultCode: Integer;
276 begin
277 Result := False;
278 if FileExists(FileName) then begin
279 Result := True;
280 ResultCode := MsgBox('A prior wxPython installation was found in this directory. It' + #13 +
281 'is recommended that it be uninstalled first.' + #13#13 +
282 'Should I do it?',
283 mbConfirmation, MB_YESNO);
284 if ResultCode = IDYES then begin
285 InstExec(FileName, '/SILENT', WizardDirValue(), True, False, SW_SHOWNORMAL, ResultCode);
286
287 end;
288 end;
289 end;
290
291
292 function NextButtonClick(CurPage: Integer): Boolean;
293 var
294 FileName: string;
295 ResultCode: Integer;
296 begin
297 Result := True;
298 if CurPage <> wpSelectDir then Exit;
299 if not UninstallOld(WizardDirValue() + '\wxPython\unins000.exe') then
300 if not UninstallOld(WizardDirValue() + '\wx\unins000.exe') then
301 UninstallOld(WizardDirValue() + '\%(PKGDIR)s\unins000.exe')
302 end;
303
304
305 begin
306 end.
307
308 """
309
310 #----------------------------------------------------------------------
311
312 ISS_DocDemo_Template = r'''
313
314 [Setup]
315 AppName = wxPython%(SHORTVER)s-docs-demos
316 AppVerName = wxPython Docs and Demos %(VERSION)s
317 OutputBaseFilename = wxPython%(SHORTVER)s-win32-docs-demos-%(VERSION)s
318 AppCopyright = Copyright © 2004 Total Control Software
319 DefaultDirName = {pf}\wxPython%(SHORTVER)s Docs and Demos
320 DefaultGroupName = wxPython%(SHORTVER)s Docs Demos and Tools
321 AlwaysCreateUninstallIcon = yes
322 AdminPrivilegesRequired = no
323 OutputDir = dist
324 WizardStyle = modern
325 UninstallStyle = modern
326 DisableStartupPrompt = true
327 Compression = bzip
328 DirExistsWarning = no
329 DisableReadyMemo = true
330 DisableReadyPage = true
331 ;;DisableDirPage = true
332 DisableProgramGroupPage = no
333 DisableAppendDir = no
334 UsePreviousAppDir = no
335 UsePreviousGroup = no
336
337 AppPublisher = Total Control Software
338 AppPublisherURL = http://wxPython.org/
339 AppSupportURL = http://wxPython.org/maillist.php
340 AppUpdatesURL = http://wxPython.org/download.php
341 AppVersion = %(VERSION)s
342
343 UninstallDisplayIcon = {app}\demo\wxpdemo.ico
344 UninstallFilesDir = {app}
345 UninstallIconName = Uninstall
346 LicenseFile = licence\licence.txt
347
348 ;; WizardDebug = yes
349
350
351 ;;------------------------------------------------------------
352
353
354 [Files]
355 Source: "demo\demo.py"; DestDir: "{app}\demo"; DestName: "demo.pyw";
356 Source: "demo\*.py"; DestDir: "{app}\demo";
357 Source: "demo\*.xml"; DestDir: "{app}\demo";
358 Source: "demo\*.txt"; DestDir: "{app}\demo";
359 Source: "demo\*.ico"; DestDir: "{app}\demo";
360
361 Source: "demo\bitmaps\*.bmp"; DestDir: "{app}\demo\bitmaps";
362 Source: "demo\bitmaps\*.gif"; DestDir: "{app}\demo\bitmaps";
363 Source: "demo\bitmaps\*.jpg"; DestDir: "{app}\demo\bitmaps";
364 Source: "demo\bitmaps\*.png"; DestDir: "{app}\demo\bitmaps";
365 Source: "demo\bitmaps\*.ico"; DestDir: "{app}\demo\bitmaps";
366
367 Source: "demo\bmp_source\*.gif"; DestDir: "{app}\demo\bmp_source";
368 Source: "demo\bmp_source\*.bmp"; DestDir: "{app}\demo\bmp_source";
369 Source: "demo\bmp_source\*.jpg"; DestDir: "{app}\demo\bmp_source";
370 Source: "demo\bmp_source\*.png"; DestDir: "{app}\demo\bmp_source";
371 Source: "demo\bmp_source\*.ico"; DestDir: "{app}\demo\bmp_source";
372
373 Source: "demo\data\*.htm"; DestDir: "{app}\demo\data";
374 Source: "demo\data\*.html"; DestDir: "{app}\demo\data";
375 Source: "demo\data\*.py"; DestDir: "{app}\demo\data";
376 Source: "demo\data\*.png"; DestDir: "{app}\demo\data";
377 Source: "demo\data\*.bmp"; DestDir: "{app}\demo\data";
378 Source: "demo\data\*.dat"; DestDir: "{app}\demo\data";
379 Source: "demo\data\*.txt"; DestDir: "{app}\demo\data";
380 Source: "demo\data\*.wav"; DestDir: "{app}\demo\data";
381 Source: "demo\data\*.wdr"; DestDir: "{app}\demo\data";
382 Source: "demo\data\*.xrc"; DestDir: "{app}\demo\data";
383 Source: "demo\data\*.gif"; DestDir: "{app}\demo\data";
384 Source: "demo\data\*.swf"; DestDir: "{app}\demo\data";
385
386 ;;Source: "demo\dllwidget\*.cpp"; DestDir: "{app}\demo\dllwidget";
387 ;;Source: "demo\dllwidget\*.py"; DestDir: "{app}\demo\dllwidget";
388 ;;Source: "demo\dllwidget\Makefile"; DestDir: "{app}\demo\dllwidget";
389 ;;Source: "demo\dllwidget\makefile.*"; DestDir: "{app}\demo\dllwidget";
390
391 Source: "licence\*.txt"; DestDir: "{app}\docs\licence";
392 Source: "%(WXDIR)s\docs\htmlhelp\wx.chm"; DestDir: "{app}\docs";
393 ;;Source: "%(WXDIR)s\docs\htmlhelp\ogl.chm"; DestDir: "{app}\docs";
394 Source: "docs\README.txt"; DestDir: "{app}\docs"; Flags: isreadme;
395 Source: "docs\*.txt"; DestDir: "{app}\docs";
396 Source: "docs\*.css"; DestDir: "{app}\docs";
397 Source: "docs\*.html"; DestDir: "{app}\docs";
398 Source: "docs\*.conf"; DestDir: "{app}\docs";
399 Source: "docs\screenshots\*.png"; DestDir: "{app}\docs\screenshots";
400
401
402 Source: "samples\doodle\*.py"; DestDir: "{app}\samples\doodle";
403 Source: "samples\doodle\*.txt"; DestDir: "{app}\samples\doodle";
404 Source: "samples\doodle\*.bat"; DestDir: "{app}\samples\doodle";
405 Source: "samples\doodle\sample.ddl"; DestDir: "{app}\samples\doodle";
406 Source: "samples\doodle\superdoodle.iss"; DestDir: "{app}\samples\doodle";
407
408 Source: "samples\docview\*.py"; DestDir: "{app}\samples\docview";
409 Source: "samples\docview\activegrid\*.py"; DestDir: "{app}\samples\docview\activegrid";
410 Source: "samples\docview\activegrid\tool\*.py"; DestDir: "{app}\samples\docview\activegrid\tool";
411 Source: "samples\docview\activegrid\tool\data\*.txt"; DestDir: "{app}\samples\docview\activegrid\tool\data";
412 Source: "samples\docview\activegrid\tool\images\*.jpg"; DestDir: "{app}\samples\docview\activegrid\tool\images";
413
414 Source: "samples\embedded\*.py"; DestDir: "{app}\samples\embedded";
415 Source: "samples\embedded\*.cpp"; DestDir: "{app}\samples\embedded";
416 Source: "samples\embedded\*.txt"; DestDir: "{app}\samples\embedded";
417 Source: "samples\embedded\*.vc"; DestDir: "{app}\samples\embedded";
418 Source: "samples\embedded\*.unx"; DestDir: "{app}\samples\embedded";
419 Source: "samples\embedded\*.ico"; DestDir: "{app}\samples\embedded";
420 Source: "samples\embedded\*.xpm"; DestDir: "{app}\samples\embedded";
421 Source: "samples\embedded\*.rc"; DestDir: "{app}\samples\embedded";
422
423 Source: "samples\frogedit\*.py"; DestDir: "{app}\samples\frogedit";
424
425 Source: "samples\hangman\*.py"; DestDir: "{app}\samples\hangman";
426
427 Source: "samples\mainloop\*.py"; DestDir: "{app}\samples\mainloop";
428
429 Source: "samples\pySketch\*.py"; DestDir: "{app}\samples\pySketch";
430 Source: "samples\pySketch\images\*.bmp"; DestDir: "{app}\samples\pySketch\images";
431
432 Source: "samples\simple\*.py"; DestDir: "{app}\samples\simple";
433
434 Source: "samples\StyleEditor\*.txt"; DestDir: "{app}\samples\StyleEditor";
435 Source: "samples\StyleEditor\*.py"; DestDir: "{app}\samples\StyleEditor";
436 Source: "samples\StyleEditor\*.cfg"; DestDir: "{app}\samples\StyleEditor";
437
438 Source: "samples\wxProject\*.txt"; DestDir: "{app}\samples\wxProject";
439 Source: "samples\wxProject\*.py"; DestDir: "{app}\samples\wxProject";
440
441
442
443 Source: "scripts\pyshell"; DestDir: "{app}\scripts"; DestName: "pyshell.pyw";
444 Source: "scripts\pycrust"; DestDir: "{app}\scripts"; DestName: "pycrust.pyw";
445 Source: "scripts\pyalamode"; DestDir: "{app}\scripts"; DestName: "pyalamode.pyw";
446 Source: "scripts\pyalacarte"; DestDir: "{app}\scripts"; DestName: "pyalacarte.pyw";
447 Source: "scripts\xrced"; DestDir: "{app}\scripts"; DestName: "xrced.pyw";
448
449 Source: "wx\py\PyCrust.ico"; DestDir: "{app}\scripts";
450 Source: "wx\tools\XRCed\xrced.ico"; DestDir: "{app}\scripts";
451
452
453 ;;------------------------------------------------------------
454
455 [Icons]
456 Name: "{group}\Run the wxPython DEMO"; Filename: "{app}\demo\demo.pyw"; WorkingDir: "{app}\demo"; IconFilename: "{app}\demo\wxpdemo.ico";
457 Name: "{group}\PyCrust"; Filename: "{app}\scripts\pycrust.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\PyCrust.ico";
458 Name: "{group}\PyShell"; Filename: "{app}\scripts\pyshell.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\PyCrust.ico";
459 Name: "{group}\PyAlaMode"; Filename: "{app}\scripts\pyalamode.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\PyCrust.ico";
460 Name: "{group}\PyAlaCarte"; Filename: "{app}\scripts\pyalacarte.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\PyCrust.ico";
461 Name: "{group}\Resource Editor"; Filename: "{app}\scripts\xrced.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\xrced.ico";
462
463 Name: "{group}\Sample Apps"; Filename: "{app}\samples";
464
465 Name: "{group}\wxWidgets Reference"; Filename: "{app}\docs\wx.chm";
466 Name: "{group}\Migration Guide"; Filename: "{app}\docs\MigrationGuide.html";
467 Name: "{group}\Recent Changes"; Filename: "{app}\docs\CHANGES.html";
468 Name: "{group}\Other Docs"; Filename: "{app}\docs";
469
470
471
472
473 ;;------------------------------------------------------------
474
475 [UninstallDelete]
476 Type: files; Name: "{app}\demo\*.pyc";
477 Type: files; Name: "{app}\demo\*.pyo";
478 Type: files; Name: "{app}\demo\data\showTips";
479 Type: files; Name: "{app}\demo\data\*.pyc";
480 Type: files; Name: "{app}\demo\data\*.pyo";
481 Type: files; Name: "{app}\demo\dllwidget\*.pyc";
482 Type: files; Name: "{app}\demo\dllwidget\*.pyo";
483
484 Type: files; Name: "{app}\samples\doodle\*.pyc";
485 Type: files; Name: "{app}\samples\doodle\*.pyo";
486 Type: files; Name: "{app}\samples\embedded\*.pyc";
487 Type: files; Name: "{app}\samples\embedded\*.pyo";
488 Type: files; Name: "{app}\samples\frogedit\*.pyc";
489 Type: files; Name: "{app}\samples\frogedit\*.pyo";
490 Type: files; Name: "{app}\samples\hangman\*.pyc";
491 Type: files; Name: "{app}\samples\hangman\*.pyo";
492 Type: files; Name: "{app}\samples\hangman\*.txt";
493 Type: files; Name: "{app}\samples\mainloop\*.pyc";
494 Type: files; Name: "{app}\samples\mainloop\*.pyo";
495 Type: files; Name: "{app}\samples\pySketch\*.pyc";
496 Type: files; Name: "{app}\samples\pySketch\*.pyo";
497 Type: files; Name: "{app}\samples\simple\*.pyc";
498 Type: files; Name: "{app}\samples\simple\*.pyo";
499 Type: files; Name: "{app}\samples\StyleEditor\*.pyc";
500 Type: files; Name: "{app}\samples\StyleEditor\*.pyo";
501 Type: files; Name: "{app}\samples\wx_examples\basic\*.pyc";
502 Type: files; Name: "{app}\samples\wx_examples\basic\*.pyo";
503 Type: files; Name: "{app}\samples\wx_examples\hello\*.pyc";
504 Type: files; Name: "{app}\samples\wx_examples\hello\*.pyo";
505 Type: files; Name: "{app}\samples\wxProject\*.pyc";
506 Type: files; Name: "{app}\samples\wxProject\*.pyo";
507
508
509 '''
510
511 #----------------------------------------------------------------------
512
513 def find_DLLs():
514
515 WXDLLVER = PYTHONVER = None
516
517 proc = os.popen(r"dumpbin /imports wx\_core_.pyd", "r")
518 lines = proc.readlines()
519 proc.close()
520 for line in lines:
521 if line.startswith(" wxmsw"):
522 WXDLLVER = line[9:14]
523 if WXDLLVER.endswith('_'):
524 WXDLLVER = WXDLLVER[:-1]
525
526 if line.startswith(" python"):
527 PYTHONVER = line[10] + '.' + line[11]
528
529 #if WXDLLVER and PYTHONVER:
530 # return WXDLLVER, PYTHONVER
531
532 return WXDLLVER, PYTHONVER
533
534
535 #----------------------------------------------------------------------
536
537 locale_template = 'Source: "%s"; DestDir: "{app}\%s\%s"; Components: core'
538
539 def build_locale_string(pkgdir):
540 stringlst = []
541
542 def walk_helper(lst, dirname, files):
543 for f in files:
544 filename = os.path.join(dirname, f)
545 if not os.path.isdir(filename):
546 lst.append( locale_template % (filename, pkgdir, dirname) )
547
548 os.path.walk('wx\\locale', walk_helper, stringlst)
549 return '\n'.join(stringlst)
550
551
552 def get_system_dir():
553 for p in [r"C:\WINNT\SYSTEM32",
554 r"C:\WINDOWS\SYSTEM32",
555 ]:
556 if os.path.exists(p):
557 return p
558 raise IOError, "System dir not found"
559
560
561 def get_batch_files():
562 globs = {}
563 execfile("scripts/CreateBatchFiles.py", globs)
564 scripts = globs["scripts"]
565 scripts = ['Type: files; Name: "{code:GetPythonDir}\Scripts\%s.bat";' % i[0] for i in scripts]
566 return '\n'.join(scripts)
567
568
569 runtime_template = 'Source: "%s"; DestDir: "{code:GetPythonDir}"; CopyMode: alwaysskipifsameorolder; Flags: uninsneveruninstall; Components: core'
570
571 def get_runtime_dlls(PYVER):
572 if PYVER == "py24":
573 source = [ r"distrib\msw\msvcr71.dll",
574 r"distrib\msw\msvcp71.dll" ]
575 else:
576 source = [ r"distrib\msw\MSVCRT.dll",
577 r"distrib\msw\MSVCIRT.dll",
578 r"distrib\msw\MSVCP60.dll" ]
579 DLLs = [runtime_template % dll for dll in source]
580 return '\n'.join(DLLs)
581
582
583 #----------------------------------------------------------------------
584
585 def main():
586
587 verglob = {}
588 execfile("wx/__version__.py", verglob)
589
590 VERSION = verglob["VERSION_STRING"]
591 SHORTVER = VERSION[:3]
592
593 WXDLLVER, PYTHONVER = find_DLLs()
594
595 PYVER = "py" + PYTHONVER[0] + PYTHONVER[2]
596 WXDIR = os.environ["WXWIN"]
597 WXPYDIR = os.path.join(WXDIR, "wxPython")
598 SYSDIR = get_system_dir()
599 ISSFILE = "__wxPython.iss"
600 ISSDEMOFILE = "__wxPythonDemo.iss"
601 IFSFILE = "__wxPython.ifs"
602 UNINSTALL_BATCH = get_batch_files()
603 PKGDIR = open('src/wx.pth').read()
604 LOCALE = build_locale_string(PKGDIR)
605 RTDLL = get_runtime_dlls(PYVER)
606
607 print """Building Win32 installer for wxPython:
608 VERSION = %(VERSION)s
609 SHORTVER = %(SHORTVER)s
610 WXDLLVER = %(WXDLLVER)s
611 PYTHONVER = %(PYTHONVER)s
612 PYVER = %(PYVER)s
613 PKGDIR = %(PKGDIR)s
614 WXDIR = %(WXDIR)s
615 WXPYDIR = %(WXPYDIR)s
616 SYSDIR = %(SYSDIR)s
617 """ % vars()
618
619 if PYTHONVER >= "2.4":
620 IF22 = r"InstallDir := InstallDir + 'Lib\site-packages';"
621 elif PYTHONVER >= "2.2":
622 IF22 = r"InstallDir := InstallDir + '\Lib\site-packages';"
623 else:
624 IF22 = ""
625
626 # Starting with 2.3.3 the hybrid build is the release build too, so
627 # no need to label it that way.
628 ##if WXDLL.find("h") != -1:
629 ## PYVER = PYVER + "-hybrid"
630
631 MSLU=''
632 CHARTYPE='ansi'
633 if "UNICODE=1" in sys.argv:
634 MSLU=r'Source: "distrib\msw\unicows.dll"; DestDir: "{code:GetPythonDir}"; Components: core' % vars()
635 CHARTYPE='unicode'
636
637 f = open(ISSFILE, "w")
638 f.write(ISS_Template % vars())
639 f.close()
640
641 f = open(IFSFILE, "w")
642 f.write(IFS_Template % vars())
643 f.close()
644
645 f = open(ISSDEMOFILE, "w")
646 f.write(ISS_DocDemo_Template % vars())
647 f.close()
648
649 TOOLS = os.environ['TOOLS']
650 if TOOLS.startswith('/cygdrive'):
651 TOOLS = r"c:\TOOLS" # temporary hack until I convert everything over to bash
652 os.system(ISCC % (TOOLS, ISSFILE))
653 os.system(ISCC % (TOOLS, ISSDEMOFILE))
654
655 if not KEEP_TEMPS:
656 time.sleep(1)
657 os.remove(ISSFILE)
658 os.remove(ISSDEMOFILE)
659 os.remove(IFSFILE)
660
661
662 #----------------------------------------------------------------------
663
664 if __name__ == "__main__":
665 main()
666
667
668
669 #----------------------------------------------------------------------
670
671