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