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