]>
git.saurik.com Git - wxWidgets.git/blob - 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
8 # Created: 30-April-2001
10 # Copyright: (c) 2003 by Total Control Software
11 # Licence: wxWindows license
12 #----------------------------------------------------------------------
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
26 ISCC
= r
"%s\InnoSetup2Ex\ISCC.exe %s"
28 #----------------------------------------------------------------------
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
43 UninstallStyle = modern
44 DisableStartupPrompt = true
47 DisableReadyMemo = true
48 DisableReadyPage = true
49 ;;DisableDirPage = true
50 DisableProgramGroupPage = true
51 DisableAppendDir = true
52 UsePreviousAppDir = no
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
61 UninstallFilesDir = {app}\%(PKGDIR)s
62 LicenseFile = licence\licence.txt
63 CodeFile = %(IFSFILE)s
67 ;;------------------------------------------------------------
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
74 ;;------------------------------------------------------------
78 Source: "%(WXDIR)s\lib\vc_dll\wx*%(WXDLLVER)s_*.dll"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
81 Source: "wx\_activex.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
82 Source: "wx\_calendar.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
83 Source: "wx\_controls_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
84 Source: "wx\_core_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
85 Source: "wx\_gdi_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
86 Source: "wx\_animate.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
87 Source: "wx\_gizmos.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
88 Source: "wx\_glcanvas.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
89 Source: "wx\_grid.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
90 Source: "wx\_html.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
91 Source: "wx\_media.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
92 Source: "wx\_misc_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
93 Source: "wx\_stc.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
94 Source: "wx\_webkit.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
95 Source: "wx\_windows_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
96 Source: "wx\_wizard.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
97 Source: "wx\_xrc.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
98 ;;Source: "wx\_iewin.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
99 ;;Source: "wx\_ogl.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
102 Source: "wx\*.py"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
103 Source: "wx\build\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\build"; Components: core
104 Source: "wx\lib\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib"; Components: core
105 Source: "wx\lib\analogclock\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\analogclock"; Components: core
106 Source: "wx\lib\analogclock\lib_setup\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\analogclock\lib_setup"; Components: core
107 Source: "wx\lib\colourchooser\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\colourchooser"; Components: core
108 Source: "wx\lib\editor\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\editor"; Components: core
109 Source: "wx\lib\editor\*.txt"; DestDir: "{app}\%(PKGDIR)s\wx\lib\editor"; Components: core
110 Source: "wx\lib\mixins\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\mixins"; Components: core
111 Source: "wx\lib\masked\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\masked"; Components: core
112 Source: "wx\lib\ogl\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\ogl"; Components: core
113 Source: "wx\lib\floatcanvas\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\floatcanvas"; Components: core
114 Source: "wx\py\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\py"; Components: core
115 Source: "wx\py\*.txt"; DestDir: "{app}\%(PKGDIR)s\wx\py"; Components: core
116 Source: "wx\py\*.ico"; DestDir: "{app}\%(PKGDIR)s\wx\py"; Components: core
117 Source: "wx\py\*.png"; DestDir: "{app}\%(PKGDIR)s\wx\py"; Components: core
118 Source: "wx\py\tests\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\py\tests"; Components: core
119 Source: "wx\tools\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\tools"; Components: core
120 Source: "wx\tools\XRCed\*.txt"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
121 Source: "wx\tools\XRCed\sawfishrc"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
122 Source: "wx\tools\XRCed\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
123 Source: "wx\tools\XRCed\*.xrc"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
124 Source: "wx\tools\XRCed\*.ico"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
125 Source: "wx\tools\XRCed\*.png"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
126 Source: "wx\tools\XRCed\*.sh"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
127 Source: "wx\tools\XRCed\src-images\*.png"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed\src-images"; Components: core
130 Source: "wxPython\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython"; Components: core
131 Source: "wxPython\lib\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\lib"; Components: core
132 Source: "wxPython\lib\colourchooser\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\lib\colourchooser"; Components: core
133 Source: "wxPython\lib\editor\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\lib\editor"; Components: core
134 Source: "wxPython\lib\mixins\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\lib\mixins"; Components: core
135 Source: "wxPython\tools\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\tools"; Components: core
138 Source: "src\winxp.manifest"; DestDir: "{code:GetPythonDir}"; DestName: "python.exe.manifest"; Flags: sharedfile; Components: manifest
139 Source: "src\winxp.manifest"; DestDir: "{code:GetPythonDir}"; DestName: "pythonw.exe.manifest"; Flags: sharedfile; Components: manifest
140 Source: "wxversion\wxversion.py"; DestDir: "{app}"; Flags: sharedfile; Components: core
141 Source: "src\wx.pth"; DestDir: "{app}"; Flags: sharedfile; Components: pthfile
146 Source: "scripts\*.py"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
147 Source: "scripts\helpviewer"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
148 Source: "scripts\img2png"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
149 Source: "scripts\img2py"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
150 Source: "scripts\img2xpm"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
151 Source: "scripts\pyalacarte"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
152 Source: "scripts\pyalamode"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
153 Source: "scripts\pyshell"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
154 Source: "scripts\pycrust"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
155 Source: "scripts\pywrap"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
156 Source: "scripts\pywxrc"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
157 Source: "scripts\xrced"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
160 Source: "distrib\README.win32.txt"; DestDir: "{app}\%(PKGDIR)s\docs"; Flags: isreadme; Components: core
161 Source: "licence\*.txt"; DestDir: "{app}\%(PKGDIR)s\docs\licence"; Components: core
162 Source: "docs\CHANGES.*"; DestDir: "{app}\%(PKGDIR)s\docs"; Components: core
163 Source: "docs\MigrationGuide.*"; DestDir: "{app}\%(PKGDIR)s\docs"; Components: core
164 Source: "docs\default.css"; DestDir: "{app}\%(PKGDIR)s\docs"; Components: core
168 ;;------------------------------------------------------------
171 ;; Compile the .py files
172 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
174 ;; Recreate the tool scripts to use the paths on the users machine
175 Filename: "{code:GetPythonDir}\python.exe"; Parameters: "CreateBatchFiles.py"; WorkingDir: "{code:GetPythonDir}\Scripts"; Description: "Create batch files for tool scripts"; Flags: postinstall; Components: core
180 ;;------------------------------------------------------------
183 Type: files; Name: "{app}\%(PKGDIR)s\wx\*.pyc";
184 Type: files; Name: "{app}\%(PKGDIR)s\wx\*.pyo";
185 Type: files; Name: "{app}\%(PKGDIR)s\wx\*.pyd";
186 Type: files; Name: "{app}\%(PKGDIR)s\wx\build\*.pyc";
187 Type: files; Name: "{app}\%(PKGDIR)s\wx\build\*.pyo";
188 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\*.pyc";
189 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\*.pyo";
190 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\analogclock\*.pyc";
191 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\analogclock\*.pyo";
192 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\analogclock\lib_setup\*.pyc";
193 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\analogclock\lib_setup\*.pyo";
194 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\colourchooser\*.pyc";
195 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\colourchooser\*.pyo";
196 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\editor\*.pyc";
197 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\editor\*.pyo";
198 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\mixins\*.pyc";
199 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\mixins\*.pyo";
200 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\masked\*.pyc";
201 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\masked\*.pyo";
202 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\ogl\*.pyc";
203 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\ogl\*.pyo";
204 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\floatcanvas\*.pyc";
205 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\floatcanvas\*.pyo";
207 Type: files; Name: "{app}\%(PKGDIR)s\wx\py\*.pyc";
208 Type: files; Name: "{app}\%(PKGDIR)s\wx\py\*.pyo";
209 Type: files; Name: "{app}\%(PKGDIR)s\wx\py\tests\*.pyc";
210 Type: files; Name: "{app}\%(PKGDIR)s\wx\py\tests\*.pyo";
211 Type: files; Name: "{app}\%(PKGDIR)s\wx\tools\*.pyc";
212 Type: files; Name: "{app}\%(PKGDIR)s\wx\tools\*.pyo";
213 Type: files; Name: "{app}\%(PKGDIR)s\wx\tools\XRCed\*.pyc";
214 Type: files; Name: "{app}\%(PKGDIR)s\wx\tools\XRCed\*.pyo";
217 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\*.pyc";
218 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\*.pyo";
219 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\*.pyc";
220 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\*.pyo";
221 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\colourchooser\*.pyc";
222 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\colourchooser\*.pyo";
223 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\editor\*.pyc";
224 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\editor\*.pyo";
225 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\mixins\*.pyc";
226 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\mixins\*.pyo";
227 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\tools\*.pyc";
228 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\tools\*.pyo";
235 #----------------------------------------------------------------------
245 function InitializeSetup(): Boolean;
248 (* -------------------------------------------------------------- *)
249 (* Figure out what to use as a default installation dir *)
251 if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
252 'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
253 '', PythonDir) then begin
255 if not RegQueryStringValue(HKEY_CURRENT_USER,
256 'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
257 '', PythonDir) then begin
259 MsgBox('No installation of Python %(PYTHONVER)s found in registry.' + #13 +
260 'Be sure to enter a pathname that places wxPython on the PYTHONPATH',
261 mbConfirmation, MB_OK);
262 PythonDir := 'C:\Put a directory on PYTHONPATH here\';
265 InstallDir := PythonDir;
272 function GetPythonDir(Default: String): String;
278 function GetInstallDir(Default: String): String;
280 Result := InstallDir;
285 function UninstallOld(FileName: String): Boolean;
290 if FileExists(FileName) then begin
292 ResultCode := MsgBox('A prior wxPython installation was found in this directory. It' + #13 +
293 'is recommended that it be uninstalled first.' + #13#13 +
295 mbConfirmation, MB_YESNO);
296 if ResultCode = IDYES then begin
297 InstExec(FileName, '/SILENT', WizardDirValue(), True, False, SW_SHOWNORMAL, ResultCode);
304 function NextButtonClick(CurPage: Integer): Boolean;
310 if CurPage <> wpSelectDir then Exit;
311 if not UninstallOld(WizardDirValue() + '\wxPython\unins000.exe') then
312 if not UninstallOld(WizardDirValue() + '\wx\unins000.exe') then
313 UninstallOld(WizardDirValue() + '\%(PKGDIR)s\unins000.exe')
322 #----------------------------------------------------------------------
324 ISS_DocDemo_Template
= r
'''
327 AppName = wxPython%(SHORTVER)s-docs-demos
328 AppVerName = wxPython Docs and Demos %(VERSION)s
329 OutputBaseFilename = wxPython%(SHORTVER)s-win32-docs-demos-%(VERSION)s
330 AppCopyright = Copyright © 2004 Total Control Software
331 DefaultDirName = {pf}\wxPython%(SHORTVER)s Docs and Demos
332 DefaultGroupName = wxPython%(SHORTVER)s Docs Demos and Tools
333 AlwaysCreateUninstallIcon = yes
334 AdminPrivilegesRequired = no
337 UninstallStyle = modern
338 DisableStartupPrompt = true
340 DirExistsWarning = no
341 DisableReadyMemo = true
342 DisableReadyPage = true
343 ;;DisableDirPage = true
344 DisableProgramGroupPage = no
345 DisableAppendDir = no
346 UsePreviousAppDir = no
347 UsePreviousGroup = no
349 AppPublisher = Total Control Software
350 AppPublisherURL = http://wxPython.org/
351 AppSupportURL = http://wxPython.org/maillist.php
352 AppUpdatesURL = http://wxPython.org/download.php
353 AppVersion = %(VERSION)s
355 UninstallDisplayIcon = {app}\demo\wxpdemo.ico
356 UninstallFilesDir = {app}
357 UninstallIconName = Uninstall
358 LicenseFile = licence\licence.txt
363 ;;------------------------------------------------------------
367 Source: "demo\demo.py"; DestDir: "{app}\demo"; DestName: "demo.pyw";
368 Source: "demo\*.py"; DestDir: "{app}\demo";
369 Source: "demo\*.xml"; DestDir: "{app}\demo";
370 Source: "demo\*.txt"; DestDir: "{app}\demo";
371 Source: "demo\*.ico"; DestDir: "{app}\demo";
373 Source: "demo\bitmaps\*.bmp"; DestDir: "{app}\demo\bitmaps";
374 Source: "demo\bitmaps\*.gif"; DestDir: "{app}\demo\bitmaps";
375 Source: "demo\bitmaps\*.jpg"; DestDir: "{app}\demo\bitmaps";
376 Source: "demo\bitmaps\*.png"; DestDir: "{app}\demo\bitmaps";
378 Source: "demo\bmp_source\*.gif"; DestDir: "{app}\demo\bmp_source";
379 Source: "demo\bmp_source\*.bmp"; DestDir: "{app}\demo\bmp_source";
380 Source: "demo\bmp_source\*.jpg"; DestDir: "{app}\demo\bmp_source";
381 Source: "demo\bmp_source\*.png"; DestDir: "{app}\demo\bmp_source";
382 Source: "demo\bmp_source\*.ico"; DestDir: "{app}\demo\bmp_source";
384 Source: "demo\data\*.htm"; DestDir: "{app}\demo\data";
385 Source: "demo\data\*.html"; DestDir: "{app}\demo\data";
386 Source: "demo\data\*.py"; DestDir: "{app}\demo\data";
387 Source: "demo\data\*.png"; DestDir: "{app}\demo\data";
388 Source: "demo\data\*.bmp"; DestDir: "{app}\demo\data";
389 Source: "demo\data\*.dat"; DestDir: "{app}\demo\data";
390 Source: "demo\data\*.txt"; DestDir: "{app}\demo\data";
391 Source: "demo\data\*.wav"; DestDir: "{app}\demo\data";
392 Source: "demo\data\*.wdr"; DestDir: "{app}\demo\data";
393 Source: "demo\data\*.xrc"; DestDir: "{app}\demo\data";
394 Source: "demo\data\*.swf"; DestDir: "{app}\demo\data";
395 Source: "demo\data\*.mpg"; DestDir: "{app}\demo\data";
397 ;;Source: "demo\dllwidget\*.cpp"; DestDir: "{app}\demo\dllwidget";
398 ;;Source: "demo\dllwidget\*.py"; DestDir: "{app}\demo\dllwidget";
399 ;;Source: "demo\dllwidget\Makefile"; DestDir: "{app}\demo\dllwidget";
400 ;;Source: "demo\dllwidget\makefile.*"; DestDir: "{app}\demo\dllwidget";
402 Source: "licence\*.txt"; DestDir: "{app}\docs\licence";
403 Source: "%(WXDIR)s\docs\htmlhelp\wx.chm"; DestDir: "{app}\docs";
404 ;;Source: "%(WXDIR)s\docs\htmlhelp\ogl.chm"; DestDir: "{app}\docs";
405 Source: "docs\README.txt"; DestDir: "{app}\docs"; Flags: isreadme;
406 Source: "docs\*.txt"; DestDir: "{app}\docs";
407 Source: "docs\*.css"; DestDir: "{app}\docs";
408 Source: "docs\*.html"; DestDir: "{app}\docs";
409 Source: "docs\*.conf"; DestDir: "{app}\docs";
410 Source: "docs\screenshots\*.png"; DestDir: "{app}\docs\screenshots";
413 Source: "samples\doodle\*.py"; DestDir: "{app}\samples\doodle";
414 Source: "samples\doodle\*.txt"; DestDir: "{app}\samples\doodle";
415 Source: "samples\doodle\*.bat"; DestDir: "{app}\samples\doodle";
416 Source: "samples\doodle\sample.ddl"; DestDir: "{app}\samples\doodle";
417 Source: "samples\doodle\superdoodle.iss"; DestDir: "{app}\samples\doodle";
419 Source: "samples\docview\*.py"; DestDir: "{app}\samples\docview";
420 Source: "samples\pydocview\*.py"; DestDir: "{app}\samples\pydocview";
421 Source: "samples\pydocview\*.png"; DestDir: "{app}\samples\pydocview";
422 Source: "samples\pydocview\*.txt"; DestDir: "{app}\samples\pydocview";
424 Source: "samples\ide\*.py"; DestDir: "{app}\samples\ide";
425 Source: "samples\ide\activegrid\*.py"; DestDir: "{app}\samples\ide\activegrid";
426 Source: "samples\ide\activegrid\tool\*.py"; DestDir: "{app}\samples\ide\activegrid\tool";
427 Source: "samples\ide\activegrid\tool\data\*.txt"; DestDir: "{app}\samples\ide\activegrid\tool\data";
428 Source: "samples\ide\activegrid\util\*.py"; DestDir: "{app}\samples\ide\activegrid\util";
430 Source: "samples\embedded\*.py"; DestDir: "{app}\samples\embedded";
431 Source: "samples\embedded\*.cpp"; DestDir: "{app}\samples\embedded";
432 Source: "samples\embedded\*.txt"; DestDir: "{app}\samples\embedded";
433 Source: "samples\embedded\*.vc"; DestDir: "{app}\samples\embedded";
434 Source: "samples\embedded\*.unx"; DestDir: "{app}\samples\embedded";
435 Source: "samples\embedded\*.ico"; DestDir: "{app}\samples\embedded";
436 Source: "samples\embedded\*.xpm"; DestDir: "{app}\samples\embedded";
437 Source: "samples\embedded\*.rc"; DestDir: "{app}\samples\embedded";
439 Source: "samples\frogedit\*.py"; DestDir: "{app}\samples\frogedit";
441 Source: "samples\hangman\*.py"; DestDir: "{app}\samples\hangman";
443 Source: "samples\mainloop\*.py"; DestDir: "{app}\samples\mainloop";
445 Source: "samples\pySketch\*.py"; DestDir: "{app}\samples\pySketch";
446 Source: "samples\pySketch\images\*.bmp"; DestDir: "{app}\samples\pySketch\images";
448 Source: "samples\simple\*.py"; DestDir: "{app}\samples\simple";
450 Source: "samples\StyleEditor\*.txt"; DestDir: "{app}\samples\StyleEditor";
451 Source: "samples\StyleEditor\*.py"; DestDir: "{app}\samples\StyleEditor";
452 Source: "samples\StyleEditor\*.cfg"; DestDir: "{app}\samples\StyleEditor";
454 Source: "samples\wxProject\*.txt"; DestDir: "{app}\samples\wxProject";
455 Source: "samples\wxProject\*.py"; DestDir: "{app}\samples\wxProject";
459 Source: "scripts\pyshell"; DestDir: "{app}\scripts"; DestName: "pyshell.pyw";
460 Source: "scripts\pycrust"; DestDir: "{app}\scripts"; DestName: "pycrust.pyw";
461 Source: "scripts\pyalamode"; DestDir: "{app}\scripts"; DestName: "pyalamode.pyw";
462 Source: "scripts\pyalacarte"; DestDir: "{app}\scripts"; DestName: "pyalacarte.pyw";
463 Source: "scripts\xrced"; DestDir: "{app}\scripts"; DestName: "xrced.pyw";
465 Source: "wx\py\PyCrust.ico"; DestDir: "{app}\scripts";
466 Source: "wx\tools\XRCed\xrced.ico"; DestDir: "{app}\scripts";
469 ;;------------------------------------------------------------
472 Name: "{group}\Run the wxPython DEMO"; Filename: "{app}\demo\demo.pyw"; WorkingDir: "{app}\demo"; IconFilename: "{app}\demo\wxpdemo.ico";
473 Name: "{group}\PyCrust"; Filename: "{app}\scripts\pycrust.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\PyCrust.ico";
474 Name: "{group}\PyShell"; Filename: "{app}\scripts\pyshell.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\PyCrust.ico";
475 Name: "{group}\PyAlaMode"; Filename: "{app}\scripts\pyalamode.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\PyCrust.ico";
476 Name: "{group}\PyAlaCarte"; Filename: "{app}\scripts\pyalacarte.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\PyCrust.ico";
477 Name: "{group}\Resource Editor"; Filename: "{app}\scripts\xrced.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\xrced.ico";
479 Name: "{group}\Sample Apps"; Filename: "{app}\samples";
481 Name: "{group}\wxWidgets Reference"; Filename: "{app}\docs\wx.chm";
482 Name: "{group}\Migration Guide"; Filename: "{app}\docs\MigrationGuide.html";
483 Name: "{group}\Recent Changes"; Filename: "{app}\docs\CHANGES.html";
484 Name: "{group}\Other Docs"; Filename: "{app}\docs";
489 ;;------------------------------------------------------------
492 Type: files; Name: "{app}\demo\*.pyc";
493 Type: files; Name: "{app}\demo\*.pyo";
494 Type: files; Name: "{app}\demo\data\showTips";
495 Type: files; Name: "{app}\demo\data\*.pyc";
496 Type: files; Name: "{app}\demo\data\*.pyo";
497 Type: files; Name: "{app}\demo\dllwidget\*.pyc";
498 Type: files; Name: "{app}\demo\dllwidget\*.pyo";
500 Type: files; Name: "{app}\samples\doodle\*.pyc";
501 Type: files; Name: "{app}\samples\doodle\*.pyo";
502 Type: files; Name: "{app}\samples\embedded\*.pyc";
503 Type: files; Name: "{app}\samples\embedded\*.pyo";
504 Type: files; Name: "{app}\samples\frogedit\*.pyc";
505 Type: files; Name: "{app}\samples\frogedit\*.pyo";
506 Type: files; Name: "{app}\samples\hangman\*.pyc";
507 Type: files; Name: "{app}\samples\hangman\*.pyo";
508 Type: files; Name: "{app}\samples\hangman\*.txt";
509 Type: files; Name: "{app}\samples\mainloop\*.pyc";
510 Type: files; Name: "{app}\samples\mainloop\*.pyo";
511 Type: files; Name: "{app}\samples\pySketch\*.pyc";
512 Type: files; Name: "{app}\samples\pySketch\*.pyo";
513 Type: files; Name: "{app}\samples\simple\*.pyc";
514 Type: files; Name: "{app}\samples\simple\*.pyo";
515 Type: files; Name: "{app}\samples\StyleEditor\*.pyc";
516 Type: files; Name: "{app}\samples\StyleEditor\*.pyo";
517 Type: files; Name: "{app}\samples\wx_examples\basic\*.pyc";
518 Type: files; Name: "{app}\samples\wx_examples\basic\*.pyo";
519 Type: files; Name: "{app}\samples\wx_examples\hello\*.pyc";
520 Type: files; Name: "{app}\samples\wx_examples\hello\*.pyo";
521 Type: files; Name: "{app}\samples\wxProject\*.pyc";
522 Type: files; Name: "{app}\samples\wxProject\*.pyo";
524 Type: files; Name: "{app}\samples\ide\*.pyc";
525 Type: files; Name: "{app}\samples\ide\activegrid\*.pyc";
526 Type: files; Name: "{app}\samples\ide\activegrid\tool\*.pyc";
527 Type: files; Name: "{app}\samples\ide\activegrid\util\*.pyc";
528 Type: files; Name: "{app}\samples\ide\*.pyo";
529 Type: files; Name: "{app}\samples\ide\activegrid\*.pyo";
530 Type: files; Name: "{app}\samples\ide\activegrid\tool\*.pyo";
531 Type: files; Name: "{app}\samples\ide\activegrid\util\*.pyo";
533 Type: files; Name: "{app}\samples\docview\*.pyc";
534 Type: files; Name: "{app}\samples\pydocview\*.pyc";
535 Type: files; Name: "{app}\samples\docview\*.pyo";
536 Type: files; Name: "{app}\samples\pydocview\*.pyo";
541 #----------------------------------------------------------------------
545 WXDLLVER
= PYTHONVER
= None
547 proc
= os
.popen(r
"dumpbin /imports wx\_core_.pyd", "r")
548 lines
= proc
.readlines()
551 if line
.startswith(" wxmsw"):
552 WXDLLVER
= line
[9:14].split('_')[0]
554 if line
.startswith(" python"):
555 PYTHONVER
= line
[10] + '.' + line
[11]
557 return WXDLLVER
, PYTHONVER
560 #----------------------------------------------------------------------
562 locale_template
= 'Source: "%s"; DestDir: "{app}\%s\%s"; Components: core'
564 def build_locale_string(pkgdir
):
567 def walk_helper(lst
, dirname
, files
):
569 filename
= os
.path
.join(dirname
, f
)
570 if not os
.path
.isdir(filename
):
571 lst
.append( locale_template
% (filename
, pkgdir
, dirname
) )
573 os
.path
.walk('wx\\locale', walk_helper
, stringlst
)
574 return '\n'.join(stringlst
)
577 def get_system_dir():
578 for p
in [r
"C:\WINNT\SYSTEM32",
579 r
"C:\WINDOWS\SYSTEM32",
581 if os
.path
.exists(p
):
583 raise IOError, "System dir not found"
586 def get_batch_files():
588 execfile("scripts/CreateBatchFiles.py", globs
)
589 scripts
= globs
["scripts"]
590 scripts
= ['Type: files; Name: "{code:GetPythonDir}\Scripts\%s.bat";' % i
[0] for i
in scripts
]
591 return '\n'.join(scripts
)
594 runtime_template
= 'Source: "%s"; DestDir: "{code:GetPythonDir}"; CopyMode: alwaysskipifsameorolder; Flags: uninsneveruninstall; Components: core'
596 def get_runtime_dlls(PYVER
):
598 source
= [ r
"distrib\msw\msvcr71.dll",
599 r
"distrib\msw\msvcp71.dll" ]
601 source
= [ r
"distrib\msw\MSVCRT.dll",
602 r
"distrib\msw\MSVCIRT.dll",
603 r
"distrib\msw\MSVCP60.dll" ]
604 DLLs
= [runtime_template
% dll
for dll
in source
]
605 return '\n'.join(DLLs
)
608 #----------------------------------------------------------------------
613 execfile("wx/__version__.py", verglob
)
615 VERSION
= verglob
["VERSION_STRING"]
616 SHORTVER
= VERSION
[:3]
618 WXDLLVER
, PYTHONVER
= find_DLLs()
620 PYVER
= "py" + PYTHONVER
[0] + PYTHONVER
[2]
621 WXDIR
= os
.environ
["WXWIN"]
622 WXPYDIR
= os
.path
.join(WXDIR
, "wxPython")
623 SYSDIR
= get_system_dir()
624 ISSFILE
= "__wxPython.iss"
625 ISSDEMOFILE
= "__wxPythonDemo.iss"
626 IFSFILE
= "__wxPython.ifs"
627 UNINSTALL_BATCH
= get_batch_files()
628 PKGDIR
= open('src/wx.pth').read()
629 LOCALE
= build_locale_string(PKGDIR
)
630 RTDLL
= get_runtime_dlls(PYVER
)
632 print """Building Win32 installer for wxPython:
633 VERSION = %(VERSION)s
634 SHORTVER = %(SHORTVER)s
635 WXDLLVER = %(WXDLLVER)s
636 PYTHONVER = %(PYTHONVER)s
640 WXPYDIR = %(WXPYDIR)s
644 if PYTHONVER
>= "2.4":
645 IF22
= r
"InstallDir := InstallDir + 'Lib\site-packages';"
646 elif PYTHONVER
>= "2.2":
647 IF22
= r
"InstallDir := InstallDir + '\Lib\site-packages';"
651 # Starting with 2.3.3 the hybrid build is the release build too, so
652 # no need to label it that way.
653 ##if WXDLL.find("h") != -1:
654 ## PYVER = PYVER + "-hybrid"
658 if "UNICODE=1" in sys
.argv
:
659 MSLU
=r
'Source: "distrib\msw\unicows.dll"; DestDir: "{code:GetPythonDir}"; Components: core' % vars()
662 f
= open(ISSFILE
, "w")
663 f
.write(ISS_Template
% vars())
666 f
= open(IFSFILE
, "w")
667 f
.write(IFS_Template
% vars())
670 f
= open(ISSDEMOFILE
, "w")
671 f
.write(ISS_DocDemo_Template
% vars())
674 TOOLS
= os
.environ
['TOOLS']
675 if TOOLS
.startswith('/cygdrive'):
676 TOOLS
= r
"c:\TOOLS" # temporary hack until I convert everything over to bash
677 os
.system(ISCC
% (TOOLS
, ISSFILE
))
678 os
.system(ISCC
% (TOOLS
, ISSDEMOFILE
))
683 os
.remove(ISSDEMOFILE
)
687 #----------------------------------------------------------------------
689 if __name__
== "__main__":
694 #----------------------------------------------------------------------