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