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