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