]>
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 wxc.pyd imports and an appropriate installer
23 # TODO: Remove the registry entry upon uninstall.
28 ISCC
= r
"%s\InnoSetup2Ex\ISCC.exe %s"
30 #----------------------------------------------------------------------
33 ;;------------------------------------------------------------
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
46 UninstallStyle = modern
47 DisableStartupPrompt = true
50 DisableReadyMemo = true
51 DisableReadyPage = true
52 ;;DisableDirPage = true
53 DisableProgramGroupPage = no
54 DisableAppendDir = true
55 UsePreviousAppDir = no
58 UninstallFilesDir = {app}\wx
59 AppPublisherURL = http://wxPython.org/
60 LicenseFile = licence\licence.txt
61 CodeFile = %(IFSFILE)s
65 ;;------------------------------------------------------------
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
74 ;;------------------------------------------------------------
77 Source: "%(SYSDIR)s\MSVCRT.dll"; DestDir: "{code:GetPythonDir}"; CopyMode: alwaysskipifsameorolder; Flags: uninsneveruninstall; Components: core
78 Source: "%(SYSDIR)s\MSVCIRT.dll"; DestDir: "{code:GetPythonDir}"; CopyMode: alwaysskipifsameorolder; Flags: uninsneveruninstall; Components: core
79 Source: "%(SYSDIR)s\MSVCP60.dll"; DestDir: "{code:GetPythonDir}"; CopyMode: alwaysskipifsameorolder; Flags: uninsneveruninstall; Components: core
81 Source: "%(WXDIR)s\lib\vc_dll\wx*%(WXDLLVER)s_*.dll"; DestDir: "{app}\wx"; Components: core
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\_ogl.pyd"; DestDir: "{app}\wx"; Components: core
96 Source: "wx\_stc.pyd"; DestDir: "{app}\wx"; Components: core
97 Source: "wx\_xrc.pyd"; DestDir: "{app}\wx"; Components: core
100 Source: "wx\*.py"; DestDir: "{app}\wx"; Components: core
101 Source: "wx\build\*.py"; DestDir: "{app}\wx\build"; Components: core
102 Source: "wx\lib\*.py"; DestDir: "{app}\wx\lib"; Components: core
103 Source: "wx\lib\*.wdr"; DestDir: "{app}\wx\lib"; Components: core
104 Source: "wx\lib\colourchooser\*.py"; DestDir: "{app}\wx\lib\colourchooser"; Components: core
105 Source: "wx\lib\editor\*.py"; DestDir: "{app}\wx\lib\editor"; Components: core
106 Source: "wx\lib\editor\*.txt"; DestDir: "{app}\wx\lib\editor"; Components: core
107 Source: "wx\lib\mixins\*.py"; DestDir: "{app}\wx\lib\mixins"; Components: core
108 Source: "wx\py\*.py"; DestDir: "{app}\wx\py"; Components: core
109 Source: "wx\py\*.txt"; DestDir: "{app}\wx\py"; Components: core
110 Source: "wx\py\*.ico"; DestDir: "{app}\wx\py"; Components: core
111 Source: "wx\py\*.png"; DestDir: "{app}\wx\py"; Components: core
112 Source: "wx\py\tests\*.py"; DestDir: "{app}\wx\py\tests"; Components: core
113 Source: "wx\tools\*.py"; DestDir: "{app}\wx\tools"; Components: core
114 Source: "wx\tools\XRCed\*.txt"; DestDir: "{app}\wx\tools\XRCed"; Components: core
115 Source: "wx\tools\XRCed\sawfishrc"; DestDir: "{app}\wx\tools\XRCed"; Components: core
116 Source: "wx\tools\XRCed\*.py"; DestDir: "{app}\wx\tools\XRCed"; Components: core
117 Source: "wx\tools\XRCed\*.xrc"; DestDir: "{app}\wx\tools\XRCed"; Components: core
118 Source: "wx\tools\XRCed\*.ico"; DestDir: "{app}\wx\tools\XRCed"; Components: core
119 Source: "wx\tools\XRCed\*.png"; DestDir: "{app}\wx\tools\XRCed"; Components: core
120 Source: "wx\tools\XRCed\*.sh"; DestDir: "{app}\wx\tools\XRCed"; Components: core
121 Source: "wx\tools\XRCed\src-images\*.png"; DestDir: "{app}\wx\tools\XRCed\src-images"; Components: core
124 Source: "wxPython\*.py"; DestDir: "{app}\wxPython"; Components: core
125 Source: "wxPython\lib\*.py"; DestDir: "{app}\wxPython\lib"; Components: core
126 Source: "wxPython\lib\colourchooser\*.py"; DestDir: "{app}\wxPython\lib\colourchooser"; Components: core
127 Source: "wxPython\lib\editor\*.py"; DestDir: "{app}\wxPython\lib\editor"; Components: core
128 Source: "wxPython\lib\mixins\*.py"; DestDir: "{app}\wxPython\lib\mixins"; Components: core
129 Source: "wxPython\tools\*.py"; DestDir: "{app}\wxPython\tools"; Components: core
136 Source: "demo\*.py"; DestDir: "{app}\wx\demo"; Components: demo
137 Source: "demo\*.xml"; DestDir: "{app}\wx\demo"; Components: demo
138 Source: "demo\*.txt"; DestDir: "{app}\wx\demo"; Components: demo
139 Source: "demo\*.ico"; DestDir: "{app}\wx\demo"; Components: demo
141 Source: "demo\bitmaps\*.bmp"; DestDir: "{app}\wx\demo\bitmaps"; Components: demo
142 Source: "demo\bitmaps\*.gif"; DestDir: "{app}\wx\demo\bitmaps"; Components: demo
143 Source: "demo\bitmaps\*.jpg"; DestDir: "{app}\wx\demo\bitmaps"; Components: demo
144 Source: "demo\bitmaps\*.png"; DestDir: "{app}\wx\demo\bitmaps"; Components: demo
145 Source: "demo\bitmaps\*.ico"; DestDir: "{app}\wx\demo\bitmaps"; Components: demo
147 Source: "demo\bmp_source\*.gif"; DestDir: "{app}\wx\demo\bmp_source"; Components: demo
148 Source: "demo\bmp_source\*.bmp"; DestDir: "{app}\wx\demo\bmp_source"; Components: demo
149 Source: "demo\bmp_source\*.jpg"; DestDir: "{app}\wx\demo\bmp_source"; Components: demo
150 Source: "demo\bmp_source\*.png"; DestDir: "{app}\wx\demo\bmp_source"; Components: demo
151 Source: "demo\bmp_source\*.ico"; DestDir: "{app}\wx\demo\bmp_source"; Components: demo
153 Source: "demo\data\*.htm"; DestDir: "{app}\wx\demo\data"; Components: demo
154 Source: "demo\data\*.html"; DestDir: "{app}\wx\demo\data"; Components: demo
155 Source: "demo\data\*.py"; DestDir: "{app}\wx\demo\data"; Components: demo
156 Source: "demo\data\*.png"; DestDir: "{app}\wx\demo\data"; Components: demo
157 Source: "demo\data\*.bmp"; DestDir: "{app}\wx\demo\data"; Components: demo
158 Source: "demo\data\*.dat"; DestDir: "{app}\wx\demo\data"; Components: demo
159 Source: "demo\data\*.txt"; DestDir: "{app}\wx\demo\data"; Components: demo
160 Source: "demo\data\*.wav"; DestDir: "{app}\wx\demo\data"; Components: demo
161 Source: "demo\data\*.wdr"; DestDir: "{app}\wx\demo\data"; Components: demo
162 Source: "demo\data\*.xrc"; DestDir: "{app}\wx\demo\data"; Components: demo
163 Source: "demo\data\*.gif"; DestDir: "{app}\wx\demo\data"; Components: demo
165 ;;Source: "demo\dllwidget\*.cpp"; DestDir: "{app}\wx\demo\dllwidget"; Components: demo
166 ;;Source: "demo\dllwidget\*.py"; DestDir: "{app}\wx\demo\dllwidget"; Components: demo
167 ;;Source: "demo\dllwidget\Makefile"; DestDir: "{app}\wx\demo\dllwidget"; Components: demo
168 ;;Source: "demo\dllwidget\makefile.*"; DestDir: "{app}\wx\demo\dllwidget"; Components: demo
171 Source: "licence\*.txt"; DestDir: "{app}\wx\docs\licence"; Components: core
172 Source: "%(WXDIR)s\docs\htmlhelp\wx.chm"; DestDir: "{app}\wx\docs"; Components: docs
173 Source: "%(WXDIR)s\docs\htmlhelp\ogl.chm"; DestDir: "{app}\wx\docs"; Components: docs
174 Source: "docs\README.txt"; DestDir: "{app}\wx\docs"; Flags: isreadme; Components: core
175 Source: "docs\*.txt"; DestDir: "{app}\wx\docs"; Components: docs
176 Source: "docs\*.css"; DestDir: "{app}\wx\docs"; Components: docs
177 Source: "docs\*.html"; DestDir: "{app}\wx\docs"; Components: docs
178 Source: "docs\*.conf"; DestDir: "{app}\wx\docs"; Components: docs
179 Source: "docs\screenshots\*.png"; DestDir: "{app}\wx\docs\screenshots"; Components: docs
180 Source: "docs\xml\*.xml"; DestDir: "{app}\wx\docs\xml"; Components: docs
183 Source: "scripts\*.bat"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
184 Source: "scripts\*.py"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
185 Source: "scripts\helpviewer"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
186 Source: "scripts\img2png"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
187 Source: "scripts\img2py"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
188 Source: "scripts\img2xpm"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
189 Source: "scripts\pyalacarte"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
190 Source: "scripts\pyalamode"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
191 Source: "scripts\pyshell"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
192 Source: "scripts\pycrust"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
193 Source: "scripts\pywrap"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
194 Source: "scripts\xrced"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
195 Source: "%(WXDIR)s\lib\vc_dll\wxrc.exe"; DestDir: "{code:GetPythonDir}\Scripts"; Components: core
197 Source: "samples\doodle\*.py"; DestDir: "{app}\wx\samples\doodle"; Components: samples
198 Source: "samples\doodle\*.txt"; DestDir: "{app}\wx\samples\doodle"; Components: samples
199 Source: "samples\doodle\sample.ddl"; DestDir: "{app}\wx\samples\doodle"; Components: samples
200 Source: "samples\doodle\superdoodle.iss"; DestDir: "{app}\wx\samples\doodle"; Components: samples
202 Source: "samples\embedded\*.py"; DestDir: "{app}\wx\samples\embedded"; Components: samples
203 Source: "samples\embedded\*.cpp"; DestDir: "{app}\wx\samples\embedded"; Components: samples
204 Source: "samples\embedded\*.txt"; DestDir: "{app}\wx\samples\embedded"; Components: samples
205 Source: "samples\embedded\*.vc"; DestDir: "{app}\wx\samples\embedded"; Components: samples
206 Source: "samples\embedded\*.unx"; DestDir: "{app}\wx\samples\embedded"; Components: samples
207 Source: "samples\embedded\*.ico"; DestDir: "{app}\wx\samples\embedded"; Components: samples
208 Source: "samples\embedded\*.xpm"; DestDir: "{app}\wx\samples\embedded"; Components: samples
209 Source: "samples\embedded\*.rc"; DestDir: "{app}\wx\samples\embedded"; Components: samples
211 Source: "samples\frogedit\*.py"; DestDir: "{app}\wx\samples\frogedit"; Components: samples
213 Source: "samples\hangman\*.py"; DestDir: "{app}\wx\samples\hangman"; Components: samples
215 Source: "samples\pySketch\*.py"; DestDir: "{app}\wx\samples\pySketch"; Components: samples
216 Source: "samples\pySketch\images\*.bmp"; DestDir: "{app}\wx\samples\pySketch\images"; Components: samples
218 Source: "samples\simple\*.py"; DestDir: "{app}\wx\samples\simple"; Components: samples
220 Source: "samples\StyleEditor\*.txt"; DestDir: "{app}\wx\samples\StyleEditor"; Components: samples
221 Source: "samples\StyleEditor\*.py"; DestDir: "{app}\wx\samples\StyleEditor"; Components: samples
222 Source: "samples\StyleEditor\*.cfg"; DestDir: "{app}\wx\samples\StyleEditor"; Components: samples
224 Source: "samples\wxProject\*.txt"; DestDir: "{app}\wx\samples\wxProject"; Components: samples
225 Source: "samples\wxProject\*.py"; DestDir: "{app}\wx\samples\wxProject"; Components: samples
228 Source: "src\winxp.manifest"; DestDir: "{code:GetPythonDir}"; DestName: "python.exe.manifest"; Components: manifest
229 Source: "src\winxp.manifest"; DestDir: "{code:GetPythonDir}"; DestName: "pythonw.exe.manifest"; Components: manifest
232 ;;------------------------------------------------------------
235 ;; Compile the .py files
236 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
238 ;; Recreate the tool scripts to use the paths on the users machine
239 Filename: "{code:GetPythonDir}\python.exe"; Parameters: "CreateBatchFiles.py"; WorkingDir: "{code:GetPythonDir}\Scripts"; Description: "Create batch files for tool scripts"; Flags: postinstall; Components: core
242 ;;------------------------------------------------------------
245 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
246 Name: "{group}\PyCrust"; Filename: "{code:GetPythonDir}\pythonw.exe"; WorkingDir: "c:\"; Parameters: "{code:GetPythonDir}\Scripts\pycrust"; IconFilename: "{app}\wx\py\PyCrust.ico"; Components: core
247 Name: "{group}\PyShell"; Filename: "{code:GetPythonDir}\pythonw.exe"; WorkingDir: "c:\"; Parameters: "{code:GetPythonDir}\Scripts\pyshell"; IconFilename: "{app}\wx\py\PyCrust.ico"; Components: core
248 Name: "{group}\PyAlaMode"; Filename: "{code:GetPythonDir}\pythonw.exe"; WorkingDir: "c:\"; Parameters: "{code:GetPythonDir}\Scripts\pyalamode"; IconFilename: "{app}\wx\py\PyCrust.ico"; Components: core
249 Name: "{group}\PyAlaCarte"; Filename: "{code:GetPythonDir}\pythonw.exe"; WorkingDir: "c:\"; Parameters: "{code:GetPythonDir}\Scripts\pyalacarte"; IconFilename: "{app}\wx\py\PyCrust.ico"; Components: core
250 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
252 Name: "{group}\Sample Apps"; Filename: "{app}\wx\samples"; Components: samples
254 Name: "{group}\wxWindows Reference"; Filename: "{app}\wx\docs\wx.chm"; Components: docs
255 Name: "{group}\Migration Guide"; Filename: "{app}\wx\docs\MigrationGuide.html"; Components: docs
256 Name: "{group}\Recent Changes"; Filename: "{app}\wx\docs\CHANGES.html"; Components: docs
257 Name: "{group}\Other Docs"; Filename: "{app}\wx\docs"; Components: docs
260 ;;------------------------------------------------------------
263 Type: files; Name: "{app}\wx\*.pyc";
264 Type: files; Name: "{app}\wx\*.pyo";
265 Type: files; Name: "{app}\wx\*.pyd";
266 Type: files; Name: "{app}\wx\build\*.pyc";
267 Type: files; Name: "{app}\wx\build\*.pyo";
268 Type: files; Name: "{app}\wx\lib\*.pyc";
269 Type: files; Name: "{app}\wx\lib\*.pyo";
270 Type: files; Name: "{app}\wx\lib\colourchooser\*.pyc";
271 Type: files; Name: "{app}\wx\lib\colourchooser\*.pyo";
272 Type: files; Name: "{app}\wx\lib\editor\*.pyc";
273 Type: files; Name: "{app}\wx\lib\editor\*.pyo";
274 Type: files; Name: "{app}\wx\lib\mixins\*.pyc";
275 Type: files; Name: "{app}\wx\lib\mixins\*.pyo";
276 Type: files; Name: "{app}\wx\py\*.pyc";
277 Type: files; Name: "{app}\wx\py\*.pyo";
278 Type: files; Name: "{app}\wx\py\tests\*.pyc";
279 Type: files; Name: "{app}\wx\py\tests\*.pyo";
280 Type: files; Name: "{app}\wx\tools\*.pyc";
281 Type: files; Name: "{app}\wx\tools\*.pyo";
282 Type: files; Name: "{app}\wx\tools\XRCed\*.pyc";
283 Type: files; Name: "{app}\wx\tools\XRCed\*.pyo";
285 Type: files; Name: "{app}\wx\demo\*.pyc";
286 Type: files; Name: "{app}\wx\demo\*.pyo";
287 Type: files; Name: "{app}\wx\demo\data\showTips";
288 Type: files; Name: "{app}\wx\demo\data\*.pyc";
289 Type: files; Name: "{app}\wx\demo\data\*.pyo";
290 Type: files; Name: "{app}\wx\demo\dllwidget\*.pyc";
291 Type: files; Name: "{app}\wx\demo\dllwidget\*.pyo";
293 Type: files; Name: "{app}\wx\samples\doodle\*.pyc";
294 Type: files; Name: "{app}\wx\samples\doodle\*.pyo";
295 Type: files; Name: "{app}\wx\samples\embedded\*.pyc";
296 Type: files; Name: "{app}\wx\samples\embedded\*.pyo";
297 Type: files; Name: "{app}\wx\samples\frogedit\*.pyc";
298 Type: files; Name: "{app}\wx\samples\frogedit\*.pyo";
299 Type: files; Name: "{app}\wx\samples\hangman\*.pyc";
300 Type: files; Name: "{app}\wx\samples\hangman\*.pyo";
301 Type: files; Name: "{app}\wx\samples\hangman\*.txt";
302 Type: files; Name: "{app}\wx\samples\pySketch\*.pyc";
303 Type: files; Name: "{app}\wx\samples\pySketch\*.pyo";
304 Type: files; Name: "{app}\wx\samples\simple\*.pyc";
305 Type: files; Name: "{app}\wx\samples\simple\*.pyo";
306 Type: files; Name: "{app}\wx\samples\StyleEditor\*.pyc";
307 Type: files; Name: "{app}\wx\samples\StyleEditor\*.pyo";
308 Type: files; Name: "{app}\wx\samples\wx_examples\basic\*.pyc";
309 Type: files; Name: "{app}\wx\samples\wx_examples\basic\*.pyo";
310 Type: files; Name: "{app}\wx\samples\wx_examples\hello\*.pyc";
311 Type: files; Name: "{app}\wx\samples\wx_examples\hello\*.pyo";
312 Type: files; Name: "{app}\wx\samples\wxProject\*.pyc";
313 Type: files; Name: "{app}\wx\samples\wxProject\*.pyo";
315 Type: files; Name: "{app}\wxPython\*.pyc";
316 Type: files; Name: "{app}\wxPython\*.pyo";
317 Type: files; Name: "{app}\wxPython\lib\*.pyc";
318 Type: files; Name: "{app}\wxPython\lib\*.pyo";
319 Type: files; Name: "{app}\wxPython\lib\colourchooser\*.pyc";
320 Type: files; Name: "{app}\wxPython\lib\colourchooser\*.pyo";
321 Type: files; Name: "{app}\wxPython\lib\editor\*.pyc";
322 Type: files; Name: "{app}\wxPython\lib\editor\*.pyo";
323 Type: files; Name: "{app}\wxPython\lib\mixins\*.pyc";
324 Type: files; Name: "{app}\wxPython\lib\mixins\*.pyo";
325 Type: files; Name: "{app}\wxPython\tools\*.pyc";
326 Type: files; Name: "{app}\wxPython\tools\*.pyo";
332 #----------------------------------------------------------------------
342 function InitializeSetup(): Boolean;
345 (* -------------------------------------------------------------- *)
346 (* Figure out what to use as a default installation dir *)
348 if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
349 'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
350 '', PythonDir) then begin
352 if not RegQueryStringValue(HKEY_CURRENT_USER,
353 'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
354 '', PythonDir) then begin
356 MsgBox('No installation of Python %(PYTHONVER)s found in registry.' + #13 +
357 'Be sure to enter a pathname that places wxPython on the PYTHONPATH',
358 mbConfirmation, MB_OK);
359 PythonDir := 'C:\Put a directory on PYTHONPATH here\';
362 InstallDir := PythonDir;
369 function GetPythonDir(Default: String): String;
375 function GetInstallDir(Default: String): String;
377 Result := InstallDir;
382 function UninstallOld(FileName: String): Boolean;
387 if FileExists(FileName) then begin
389 ResultCode := MsgBox('A prior wxPython installation was found in this directory. It' + #13 +
390 'is recommended that it be uninstalled first.' + #13#13 +
392 mbConfirmation, MB_YESNO);
393 if ResultCode = IDYES then begin
394 InstExec(FileName, '/SILENT', WizardDirValue()+'\wxPython', True, False, SW_SHOWNORMAL, ResultCode);
401 function NextButtonClick(CurPage: Integer): Boolean;
407 if CurPage <> wpSelectDir then Exit;
408 if not UninstallOld(WizardDirValue() + '\wxPython\unins000.exe') then
409 UninstallOld(WizardDirValue() + '\wx\unins000.exe');
418 #----------------------------------------------------------------------
422 WXDLLVER
= PYTHONVER
= None
424 proc
= os
.popen(r
"dumpbin /imports wx\_core.pyd", "r")
425 lines
= proc
.readlines()
428 if line
.startswith(" wxbase"):
429 WXDLLVER
= line
[10:15]
430 if WXDLLVER
.endswith('_'):
431 WXDLLVER
= WXDLLVER
[:-1]
433 if line
.startswith(" python"):
434 PYTHONVER
= line
[10] + '.' + line
[11]
436 #if WXDLLVER and PYTHONVER:
437 # return WXDLLVER, PYTHONVER
439 return WXDLLVER
, PYTHONVER
442 #----------------------------------------------------------------------
444 locale_template
= 'Source: "%s"; DestDir: "{app}\%s"; Components: core'
446 def build_locale_string():
449 def walk_helper(lst
, dirname
, files
):
451 filename
= os
.path
.join(dirname
, f
)
452 if not os
.path
.isdir(filename
):
453 lst
.append( locale_template
% (filename
, dirname
) )
455 os
.path
.walk('wxPython\\locale', walk_helper
, stringlst
)
456 return '\n'.join(stringlst
)
458 def get_system_dir():
459 for p
in [r
"C:\WINNT\SYSTEM32",
460 r
"C:\WINDOWS\SYSTEM32",
462 if os
.path
.exists(p
):
464 raise IOError, "System dir not found"
467 #----------------------------------------------------------------------
472 execfile("wx/__version__.py", verglob
)
474 VERSION
= verglob
["VERSION_STRING"]
475 SHORTVER
= VERSION
[:3]
477 WXDLLVER
, PYTHONVER
= find_DLLs()
479 PYVER
= "Py" + PYTHONVER
[0] + PYTHONVER
[2]
480 WXDIR
= os
.environ
["WXWIN"]
481 WXPYDIR
= os
.path
.join(WXDIR
, "wxPython")
482 SYSDIR
= get_system_dir()
483 ISSFILE
= "__wxPython.iss"
484 IFSFILE
= "__wxPython.ifs"
485 LOCALE
= build_locale_string()
487 print """Building Win32 installer for wxPython:
488 VERSION = %(VERSION)s
489 SHORTVER = %(SHORTVER)s
490 WXDLLVER = %(WXDLLVER)s
491 PYTHONVER = %(PYTHONVER)s
494 WXPYDIR = %(WXPYDIR)s
498 if PYTHONVER
>= "2.2":
499 IF22
= r
"InstallDir := InstallDir + '\Lib\site-packages';"
503 # Starting with 2.3.3 the hybrid build is the release build too, so
504 # no need to label it that way.
505 ##if WXDLL.find("h") != -1:
506 ## PYVER = PYVER + "-hybrid"
509 if len(sys
.argv
) > 1 and sys
.argv
[1] == "UNICODE=1":
510 MSLU
=r
'Source: "%(WXDIR)s\lib\vc_dll\unicows.dll"; DestDir: "{code:GetPythonDir}"; Components: core' % vars()
512 f
= open(ISSFILE
, "w")
513 f
.write(ISS_Template
% vars())
516 f
= open(IFSFILE
, "w")
517 f
.write(IFS_Template
% vars())
520 os
.system(ISCC
% (os
.environ
['TOOLS'], ISSFILE
))
528 #----------------------------------------------------------------------
530 if __name__
== "__main__":
535 #----------------------------------------------------------------------