Mercurial > cpython-lru_cache-weakref
annotate Lib/distutils/command/bdist_msi.py @ 54294:dba767bc3155 legacy-trunk
remove mention of old ctypes version
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 23 May 2009 20:59:09 +0000 |
| parents | c83a172ee931 |
| children | 9c744dfcf4de |
| rev | line source |
|---|---|
| 54245 | 1 # -*- coding: utf-8 -*- |
| 2 # Copyright (C) 2005, 2006 Martin von Löwis | |
| 36845 | 3 # Licensed to PSF under a Contributor Agreement. |
| 4 # The bdist_wininst command proper | |
| 5 # based on bdist_wininst | |
| 6 """ | |
| 7 Implements the bdist_msi command. | |
| 8 """ | |
| 9 | |
|
45468
1d84bf5f9478
Patch #2167 from calvin: Remove unused imports
Christian Heimes <christian@cheimes.de>
parents:
42684
diff
changeset
|
10 import sys, os |
| 36845 | 11 from distutils.core import Command |
| 12 from distutils.dir_util import remove_tree | |
| 13 from distutils.sysconfig import get_python_version | |
| 14 from distutils.version import StrictVersion | |
| 15 from distutils.errors import DistutilsOptionError | |
|
46331
a93d2919ea59
Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents:
45468
diff
changeset
|
16 from distutils.util import get_platform |
| 36845 | 17 from distutils import log |
| 18 import msilib | |
|
38072
ee98ecf05773
Rename parameters to match the documentation (which
Martin v. Löwis <martin@v.loewis.de>
parents:
36905
diff
changeset
|
19 from msilib import schema, sequence, text |
| 36845 | 20 from msilib import Directory, Feature, Dialog, add_data |
| 21 | |
| 22 class PyDialog(Dialog): | |
| 23 """Dialog class with a fixed layout: controls at the top, then a ruler, | |
| 24 then a list of buttons: back, next, cancel. Optionally a bitmap at the | |
| 25 left.""" | |
| 26 def __init__(self, *args, **kw): | |
| 27 """Dialog(database, name, x, y, w, h, attributes, title, first, | |
| 28 default, cancel, bitmap=true)""" | |
| 29 Dialog.__init__(self, *args) | |
| 30 ruler = self.h - 36 | |
| 31 bmwidth = 152*ruler/328 | |
| 32 #if kw.get("bitmap", True): | |
| 33 # self.bitmap("Bitmap", 0, 0, bmwidth, ruler, "PythonWin") | |
| 34 self.line("BottomLine", 0, ruler, self.w, 0) | |
| 35 | |
| 36 def title(self, title): | |
| 37 "Set the title text of the dialog at the top." | |
| 38 # name, x, y, w, h, flags=Visible|Enabled|Transparent|NoPrefix, | |
| 39 # text, in VerdanaBold10 | |
| 40 self.text("Title", 15, 10, 320, 60, 0x30003, | |
| 41 r"{\VerdanaBold10}%s" % title) | |
| 42 | |
| 43 def back(self, title, next, name = "Back", active = 1): | |
| 44 """Add a back button with a given title, the tab-next button, | |
| 45 its name in the Control table, possibly initially disabled. | |
| 46 | |
| 47 Return the button, so that events can be associated""" | |
| 48 if active: | |
| 49 flags = 3 # Visible|Enabled | |
| 50 else: | |
| 51 flags = 1 # Visible | |
| 52 return self.pushbutton(name, 180, self.h-27 , 56, 17, flags, title, next) | |
| 53 | |
| 54 def cancel(self, title, next, name = "Cancel", active = 1): | |
| 55 """Add a cancel button with a given title, the tab-next button, | |
| 56 its name in the Control table, possibly initially disabled. | |
| 57 | |
| 58 Return the button, so that events can be associated""" | |
| 59 if active: | |
| 60 flags = 3 # Visible|Enabled | |
| 61 else: | |
| 62 flags = 1 # Visible | |
| 63 return self.pushbutton(name, 304, self.h-27, 56, 17, flags, title, next) | |
| 64 | |
| 65 def next(self, title, next, name = "Next", active = 1): | |
| 66 """Add a Next button with a given title, the tab-next button, | |
| 67 its name in the Control table, possibly initially disabled. | |
| 68 | |
| 69 Return the button, so that events can be associated""" | |
| 70 if active: | |
| 71 flags = 3 # Visible|Enabled | |
| 72 else: | |
| 73 flags = 1 # Visible | |
| 74 return self.pushbutton(name, 236, self.h-27, 56, 17, flags, title, next) | |
| 75 | |
| 76 def xbutton(self, name, title, next, xpos): | |
| 77 """Add a button with a given title, the tab-next button, | |
| 78 its name in the Control table, giving its x position; the | |
| 79 y-position is aligned with the other buttons. | |
| 80 | |
| 81 Return the button, so that events can be associated""" | |
| 82 return self.pushbutton(name, int(self.w*xpos - 28), self.h-27, 56, 17, 3, title, next) | |
| 83 | |
| 84 class bdist_msi (Command): | |
| 85 | |
| 86 description = "create a Microsoft Installer (.msi) binary distribution" | |
| 87 | |
| 88 user_options = [('bdist-dir=', None, | |
| 89 "temporary directory for creating the distribution"), | |
|
46331
a93d2919ea59
Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents:
45468
diff
changeset
|
90 ('plat-name=', 'p', |
|
a93d2919ea59
Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents:
45468
diff
changeset
|
91 "platform name to embed in generated filenames " |
|
a93d2919ea59
Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents:
45468
diff
changeset
|
92 "(default: %s)" % get_platform()), |
| 36845 | 93 ('keep-temp', 'k', |
| 94 "keep the pseudo-installation tree around after " + | |
| 95 "creating the distribution archive"), | |
| 96 ('target-version=', None, | |
| 97 "require a specific python version" + | |
| 98 " on the target system"), | |
| 99 ('no-target-compile', 'c', | |
| 100 "do not compile .py to .pyc on the target system"), | |
| 101 ('no-target-optimize', 'o', | |
| 102 "do not compile .py to .pyo (optimized)" | |
| 103 "on the target system"), | |
| 104 ('dist-dir=', 'd', | |
| 105 "directory to put final built distributions in"), | |
| 106 ('skip-build', None, | |
| 107 "skip rebuilding everything (for testing/debugging)"), | |
| 108 ('install-script=', None, | |
| 109 "basename of installation script to be run after" | |
| 110 "installation or before deinstallation"), | |
| 111 ('pre-install-script=', None, | |
| 112 "Fully qualified filename of a script to be run before " | |
| 113 "any files are installed. This script need not be in the " | |
| 114 "distribution"), | |
| 115 ] | |
| 116 | |
| 117 boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize', | |
| 118 'skip-build'] | |
| 119 | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
120 all_versions = ['2.0', '2.1', '2.2', '2.3', '2.4', |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
121 '2.5', '2.6', '2.7', '2.8', '2.9', |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
122 '3.0', '3.1', '3.2', '3.3', '3.4', |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
123 '3.5', '3.6', '3.7', '3.8', '3.9'] |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
124 other_version = 'X' |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
125 |
| 36845 | 126 def initialize_options (self): |
| 127 self.bdist_dir = None | |
|
46331
a93d2919ea59
Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents:
45468
diff
changeset
|
128 self.plat_name = None |
| 36845 | 129 self.keep_temp = 0 |
| 130 self.no_target_compile = 0 | |
| 131 self.no_target_optimize = 0 | |
| 132 self.target_version = None | |
| 133 self.dist_dir = None | |
| 134 self.skip_build = 0 | |
| 135 self.install_script = None | |
| 136 self.pre_install_script = None | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
137 self.versions = None |
| 36845 | 138 |
| 139 def finalize_options (self): | |
| 140 if self.bdist_dir is None: | |
| 141 bdist_base = self.get_finalized_command('bdist').bdist_base | |
| 142 self.bdist_dir = os.path.join(bdist_base, 'msi') | |
| 143 short_version = get_python_version() | |
| 144 if self.target_version: | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
145 self.versions = [self.target_version] |
| 36845 | 146 if not self.skip_build and self.distribution.has_ext_modules()\ |
| 147 and self.target_version != short_version: | |
| 148 raise DistutilsOptionError, \ | |
| 149 "target version can only be %s, or the '--skip_build'" \ | |
| 150 " option must be specified" % (short_version,) | |
| 151 else: | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
152 self.versions = list(self.all_versions) |
| 36845 | 153 |
|
46331
a93d2919ea59
Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents:
45468
diff
changeset
|
154 self.set_undefined_options('bdist', |
|
a93d2919ea59
Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents:
45468
diff
changeset
|
155 ('dist_dir', 'dist_dir'), |
|
a93d2919ea59
Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents:
45468
diff
changeset
|
156 ('plat_name', 'plat_name'), |
|
a93d2919ea59
Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents:
45468
diff
changeset
|
157 ) |
| 36845 | 158 |
| 159 if self.pre_install_script: | |
| 160 raise DistutilsOptionError, "the pre-install-script feature is not yet implemented" | |
| 161 | |
| 162 if self.install_script: | |
| 163 for script in self.distribution.scripts: | |
| 164 if self.install_script == os.path.basename(script): | |
| 165 break | |
| 166 else: | |
| 167 raise DistutilsOptionError, \ | |
| 168 "install_script '%s' not found in scripts" % \ | |
| 169 self.install_script | |
| 170 self.install_script_key = None | |
| 171 # finalize_options() | |
| 172 | |
| 173 | |
| 174 def run (self): | |
| 175 if not self.skip_build: | |
| 176 self.run_command('build') | |
| 177 | |
| 178 install = self.reinitialize_command('install', reinit_subcommands=1) | |
| 179 install.prefix = self.bdist_dir | |
| 180 install.skip_build = self.skip_build | |
| 181 install.warn_dir = 0 | |
| 182 | |
| 183 install_lib = self.reinitialize_command('install_lib') | |
| 184 # we do not want to include pyc or pyo files | |
| 185 install_lib.compile = 0 | |
| 186 install_lib.optimize = 0 | |
| 187 | |
| 188 if self.distribution.has_ext_modules(): | |
| 189 # If we are building an installer for a Python version other | |
| 190 # than the one we are currently running, then we need to ensure | |
| 191 # our build_lib reflects the other Python version rather than ours. | |
| 192 # Note that for target_version!=sys.version, we must have skipped the | |
| 193 # build step, so there is no issue with enforcing the build of this | |
| 194 # version. | |
| 195 target_version = self.target_version | |
| 196 if not target_version: | |
| 197 assert self.skip_build, "Should have already checked this" | |
| 198 target_version = sys.version[0:3] | |
|
46331
a93d2919ea59
Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents:
45468
diff
changeset
|
199 plat_specifier = ".%s-%s" % (self.plat_name, target_version) |
| 36845 | 200 build = self.get_finalized_command('build') |
| 201 build.build_lib = os.path.join(build.build_base, | |
| 202 'lib' + plat_specifier) | |
| 203 | |
| 204 log.info("installing to %s", self.bdist_dir) | |
| 205 install.ensure_finalized() | |
| 206 | |
| 207 # avoid warning of 'install_lib' about installing | |
| 208 # into a directory not in sys.path | |
| 209 sys.path.insert(0, os.path.join(self.bdist_dir, 'PURELIB')) | |
| 210 | |
| 211 install.run() | |
| 212 | |
| 213 del sys.path[0] | |
| 214 | |
| 215 self.mkpath(self.dist_dir) | |
| 216 fullname = self.distribution.get_fullname() | |
| 217 installer_name = self.get_installer_filename(fullname) | |
| 218 installer_name = os.path.abspath(installer_name) | |
| 219 if os.path.exists(installer_name): os.unlink(installer_name) | |
| 220 | |
| 221 metadata = self.distribution.metadata | |
| 222 author = metadata.author | |
| 223 if not author: | |
| 224 author = metadata.maintainer | |
| 225 if not author: | |
| 226 author = "UNKNOWN" | |
| 227 version = metadata.get_version() | |
| 228 # ProductVersion must be strictly numeric | |
| 229 # XXX need to deal with prerelease versions | |
| 230 sversion = "%d.%d.%d" % StrictVersion(version).version | |
| 231 # Prefix ProductName with Python x.y, so that | |
| 232 # it sorts together with the other Python packages | |
| 233 # in Add-Remove-Programs (APR) | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
234 fullname = self.distribution.get_fullname() |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
235 if self.target_version: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
236 product_name = "Python %s %s" % (self.target_version, fullname) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
237 else: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
238 product_name = "Python %s" % (fullname) |
| 36845 | 239 self.db = msilib.init_database(installer_name, schema, |
|
36905
ca29dda563b7
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
36845
diff
changeset
|
240 product_name, msilib.gen_uuid(), |
| 36845 | 241 sversion, author) |
| 242 msilib.add_tables(self.db, sequence) | |
| 243 props = [('DistVersion', version)] | |
| 244 email = metadata.author_email or metadata.maintainer_email | |
| 245 if email: | |
| 246 props.append(("ARPCONTACT", email)) | |
| 247 if metadata.url: | |
| 248 props.append(("ARPURLINFOABOUT", metadata.url)) | |
| 249 if props: | |
| 250 add_data(self.db, 'Property', props) | |
| 251 | |
| 252 self.add_find_python() | |
| 253 self.add_files() | |
| 254 self.add_scripts() | |
| 255 self.add_ui() | |
| 256 self.db.Commit() | |
| 257 | |
| 258 if hasattr(self.distribution, 'dist_files'): | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
259 tup = 'bdist_msi', self.target_version or 'any', fullname |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
260 self.distribution.dist_files.append(tup) |
| 36845 | 261 |
| 262 if not self.keep_temp: | |
| 263 remove_tree(self.bdist_dir, dry_run=self.dry_run) | |
| 264 | |
| 265 def add_files(self): | |
| 266 db = self.db | |
| 267 cab = msilib.CAB("distfiles") | |
| 268 rootdir = os.path.abspath(self.bdist_dir) | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
269 |
| 36845 | 270 root = Directory(db, cab, None, rootdir, "TARGETDIR", "SourceDir") |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
271 f = Feature(db, "Python", "Python", "Everything", |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
272 0, 1, directory="TARGETDIR") |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
273 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
274 items = [(f, root, '')] |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
275 for version in self.versions + [self.other_version]: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
276 target = "TARGETDIR" + version |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
277 name = default = "Python" + version |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
278 desc = "Everything" |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
279 if version is self.other_version: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
280 title = "Python from another location" |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
281 level = 2 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
282 else: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
283 title = "Python %s from registry" % version |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
284 level = 1 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
285 f = Feature(db, name, title, desc, 1, level, directory=target) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
286 dir = Directory(db, cab, root, rootdir, target, default) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
287 items.append((f, dir, version)) |
| 36845 | 288 db.Commit() |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
289 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
290 seen = {} |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
291 for feature, dir, version in items: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
292 todo = [dir] |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
293 while todo: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
294 dir = todo.pop() |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
295 for file in os.listdir(dir.absolute): |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
296 afile = os.path.join(dir.absolute, file) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
297 if os.path.isdir(afile): |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
298 short = "%s|%s" % (dir.make_short(file), file) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
299 default = file + version |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
300 newdir = Directory(db, cab, dir, file, default, short) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
301 todo.append(newdir) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
302 else: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
303 if not dir.component: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
304 dir.start_component(dir.logical, feature, 0) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
305 if afile not in seen: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
306 key = seen[afile] = dir.add_file(file) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
307 if file==self.install_script: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
308 if self.install_script_key: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
309 raise DistutilsOptionError( |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
310 "Multiple files with name %s" % file) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
311 self.install_script_key = '[#%s]' % key |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
312 else: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
313 key = seen[afile] |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
314 add_data(self.db, "DuplicateFile", |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
315 [(key + version, dir.component, key, None, dir.logical)]) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
316 |
|
36905
ca29dda563b7
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
36845
diff
changeset
|
317 |
| 36845 | 318 cab.commit(db) |
| 319 | |
| 320 def add_find_python(self): | |
| 321 """Adds code to the installer to compute the location of Python. | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
322 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
323 Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
324 registry for each version of Python. |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
325 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
326 Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined, |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
327 else from PYTHON.MACHINE.X.Y. |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
328 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
329 Properties PYTHONX.Y will be set to TARGETDIRX.Y\\python.exe""" |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
330 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
331 start = 402 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
332 for ver in self.versions: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
333 install_path = r"SOFTWARE\Python\PythonCore\%s\InstallPath" % ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
334 machine_reg = "python.machine." + ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
335 user_reg = "python.user." + ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
336 machine_prop = "PYTHON.MACHINE." + ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
337 user_prop = "PYTHON.USER." + ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
338 machine_action = "PythonFromMachine" + ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
339 user_action = "PythonFromUser" + ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
340 exe_action = "PythonExe" + ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
341 target_dir_prop = "TARGETDIR" + ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
342 exe_prop = "PYTHON" + ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
343 add_data(self.db, "RegLocator", |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
344 [(machine_reg, 2, install_path, None, 2), |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
345 (user_reg, 1, install_path, None, 2)]) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
346 add_data(self.db, "AppSearch", |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
347 [(machine_prop, machine_reg), |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
348 (user_prop, user_reg)]) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
349 add_data(self.db, "CustomAction", |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
350 [(machine_action, 51+256, target_dir_prop, "[" + machine_prop + "]"), |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
351 (user_action, 51+256, target_dir_prop, "[" + user_prop + "]"), |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
352 (exe_action, 51+256, exe_prop, "[" + target_dir_prop + "]\\python.exe"), |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
353 ]) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
354 add_data(self.db, "InstallExecuteSequence", |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
355 [(machine_action, machine_prop, start), |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
356 (user_action, user_prop, start + 1), |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
357 (exe_action, None, start + 2), |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
358 ]) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
359 add_data(self.db, "InstallUISequence", |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
360 [(machine_action, machine_prop, start), |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
361 (user_action, user_prop, start + 1), |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
362 (exe_action, None, start + 2), |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
363 ]) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
364 add_data(self.db, "Condition", |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
365 [("Python" + ver, 0, "NOT TARGETDIR" + ver)]) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
366 start += 4 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
367 assert start < 500 |
| 36845 | 368 |
| 369 def add_scripts(self): | |
| 370 if self.install_script: | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
371 start = 6800 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
372 for ver in self.versions + [self.other_version]: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
373 install_action = "install_script." + ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
374 exe_prop = "PYTHON" + ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
375 add_data(self.db, "CustomAction", |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
376 [(install_action, 50, exe_prop, self.install_script_key)]) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
377 add_data(self.db, "InstallExecuteSequence", |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
378 [(install_action, "&Python%s=3" % ver, start)]) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
379 start += 1 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
380 # XXX pre-install scripts are currently refused in finalize_options() |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
381 # but if this feature is completed, it will also need to add |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
382 # entries for each version as the above code does |
| 36845 | 383 if self.pre_install_script: |
| 384 scriptfn = os.path.join(self.bdist_dir, "preinstall.bat") | |
| 385 f = open(scriptfn, "w") | |
| 386 # The batch file will be executed with [PYTHON], so that %1 | |
| 387 # is the path to the Python interpreter; %0 will be the path | |
| 388 # of the batch file. | |
| 389 # rem =""" | |
| 390 # %1 %0 | |
| 391 # exit | |
| 392 # """ | |
| 393 # <actual script> | |
| 394 f.write('rem ="""\n%1 %0\nexit\n"""\n') | |
| 395 f.write(open(self.pre_install_script).read()) | |
| 396 f.close() | |
| 397 add_data(self.db, "Binary", | |
| 398 [("PreInstall", msilib.Binary(scriptfn)) | |
| 399 ]) | |
| 400 add_data(self.db, "CustomAction", | |
| 401 [("PreInstall", 2, "PreInstall", None) | |
| 402 ]) | |
| 403 add_data(self.db, "InstallExecuteSequence", | |
| 404 [("PreInstall", "NOT Installed", 450)]) | |
| 405 | |
| 406 | |
| 407 def add_ui(self): | |
| 408 db = self.db | |
| 409 x = y = 50 | |
| 410 w = 370 | |
| 411 h = 300 | |
| 412 title = "[ProductName] Setup" | |
| 413 | |
| 414 # see "Dialog Style Bits" | |
| 415 modal = 3 # visible | modal | |
| 416 modeless = 1 # visible | |
| 417 track_disk_space = 32 | |
| 418 | |
| 419 # UI customization properties | |
| 420 add_data(db, "Property", | |
| 421 # See "DefaultUIFont Property" | |
| 422 [("DefaultUIFont", "DlgFont8"), | |
| 423 # See "ErrorDialog Style Bit" | |
| 424 ("ErrorDialog", "ErrorDlg"), | |
| 425 ("Progress1", "Install"), # modified in maintenance type dlg | |
| 426 ("Progress2", "installs"), | |
| 427 ("MaintenanceForm_Action", "Repair"), | |
| 428 # possible values: ALL, JUSTME | |
| 429 ("WhichUsers", "ALL") | |
| 430 ]) | |
| 431 | |
| 432 # Fonts, see "TextStyle Table" | |
| 433 add_data(db, "TextStyle", | |
| 434 [("DlgFont8", "Tahoma", 9, None, 0), | |
| 435 ("DlgFontBold8", "Tahoma", 8, None, 1), #bold | |
| 436 ("VerdanaBold10", "Verdana", 10, None, 1), | |
| 437 ("VerdanaRed9", "Verdana", 9, 255, 0), | |
| 438 ]) | |
| 439 | |
| 440 # UI Sequences, see "InstallUISequence Table", "Using a Sequence Table" | |
| 441 # Numbers indicate sequence; see sequence.py for how these action integrate | |
| 442 add_data(db, "InstallUISequence", | |
| 443 [("PrepareDlg", "Not Privileged or Windows9x or Installed", 140), | |
| 444 ("WhichUsersDlg", "Privileged and not Windows9x and not Installed", 141), | |
| 445 # In the user interface, assume all-users installation if privileged. | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
446 ("SelectFeaturesDlg", "Not Installed", 1230), |
| 36845 | 447 # XXX no support for resume installations yet |
| 448 #("ResumeDlg", "Installed AND (RESUME OR Preselected)", 1240), | |
| 449 ("MaintenanceTypeDlg", "Installed AND NOT RESUME AND NOT Preselected", 1250), | |
| 450 ("ProgressDlg", None, 1280)]) | |
| 451 | |
|
38072
ee98ecf05773
Rename parameters to match the documentation (which
Martin v. Löwis <martin@v.loewis.de>
parents:
36905
diff
changeset
|
452 add_data(db, 'ActionText', text.ActionText) |
|
ee98ecf05773
Rename parameters to match the documentation (which
Martin v. Löwis <martin@v.loewis.de>
parents:
36905
diff
changeset
|
453 add_data(db, 'UIText', text.UIText) |
| 36845 | 454 ##################################################################### |
| 455 # Standard dialogs: FatalError, UserExit, ExitDialog | |
| 456 fatal=PyDialog(db, "FatalError", x, y, w, h, modal, title, | |
| 457 "Finish", "Finish", "Finish") | |
| 458 fatal.title("[ProductName] Installer ended prematurely") | |
| 459 fatal.back("< Back", "Finish", active = 0) | |
| 460 fatal.cancel("Cancel", "Back", active = 0) | |
| 461 fatal.text("Description1", 15, 70, 320, 80, 0x30003, | |
| 462 "[ProductName] setup ended prematurely because of an error. Your system has not been modified. To install this program at a later time, please run the installation again.") | |
| 463 fatal.text("Description2", 15, 155, 320, 20, 0x30003, | |
| 464 "Click the Finish button to exit the Installer.") | |
| 465 c=fatal.next("Finish", "Cancel", name="Finish") | |
| 466 c.event("EndDialog", "Exit") | |
| 467 | |
| 468 user_exit=PyDialog(db, "UserExit", x, y, w, h, modal, title, | |
| 469 "Finish", "Finish", "Finish") | |
| 470 user_exit.title("[ProductName] Installer was interrupted") | |
| 471 user_exit.back("< Back", "Finish", active = 0) | |
| 472 user_exit.cancel("Cancel", "Back", active = 0) | |
| 473 user_exit.text("Description1", 15, 70, 320, 80, 0x30003, | |
| 474 "[ProductName] setup was interrupted. Your system has not been modified. " | |
| 475 "To install this program at a later time, please run the installation again.") | |
| 476 user_exit.text("Description2", 15, 155, 320, 20, 0x30003, | |
| 477 "Click the Finish button to exit the Installer.") | |
| 478 c = user_exit.next("Finish", "Cancel", name="Finish") | |
| 479 c.event("EndDialog", "Exit") | |
| 480 | |
| 481 exit_dialog = PyDialog(db, "ExitDialog", x, y, w, h, modal, title, | |
| 482 "Finish", "Finish", "Finish") | |
| 483 exit_dialog.title("Completing the [ProductName] Installer") | |
| 484 exit_dialog.back("< Back", "Finish", active = 0) | |
| 485 exit_dialog.cancel("Cancel", "Back", active = 0) | |
| 486 exit_dialog.text("Description", 15, 235, 320, 20, 0x30003, | |
| 487 "Click the Finish button to exit the Installer.") | |
| 488 c = exit_dialog.next("Finish", "Cancel", name="Finish") | |
| 489 c.event("EndDialog", "Return") | |
| 490 | |
| 491 ##################################################################### | |
| 492 # Required dialog: FilesInUse, ErrorDlg | |
| 493 inuse = PyDialog(db, "FilesInUse", | |
| 494 x, y, w, h, | |
| 495 19, # KeepModeless|Modal|Visible | |
| 496 title, | |
| 497 "Retry", "Retry", "Retry", bitmap=False) | |
| 498 inuse.text("Title", 15, 6, 200, 15, 0x30003, | |
| 499 r"{\DlgFontBold8}Files in Use") | |
| 500 inuse.text("Description", 20, 23, 280, 20, 0x30003, | |
| 501 "Some files that need to be updated are currently in use.") | |
| 502 inuse.text("Text", 20, 55, 330, 50, 3, | |
| 503 "The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.") | |
| 504 inuse.control("List", "ListBox", 20, 107, 330, 130, 7, "FileInUseProcess", | |
| 505 None, None, None) | |
| 506 c=inuse.back("Exit", "Ignore", name="Exit") | |
| 507 c.event("EndDialog", "Exit") | |
| 508 c=inuse.next("Ignore", "Retry", name="Ignore") | |
| 509 c.event("EndDialog", "Ignore") | |
| 510 c=inuse.cancel("Retry", "Exit", name="Retry") | |
| 511 c.event("EndDialog","Retry") | |
| 512 | |
| 513 # See "Error Dialog". See "ICE20" for the required names of the controls. | |
| 514 error = Dialog(db, "ErrorDlg", | |
| 515 50, 10, 330, 101, | |
| 516 65543, # Error|Minimize|Modal|Visible | |
| 517 title, | |
| 518 "ErrorText", None, None) | |
| 519 error.text("ErrorText", 50,9,280,48,3, "") | |
| 520 #error.control("ErrorIcon", "Icon", 15, 9, 24, 24, 5242881, None, "py.ico", None, None) | |
| 521 error.pushbutton("N",120,72,81,21,3,"No",None).event("EndDialog","ErrorNo") | |
| 522 error.pushbutton("Y",240,72,81,21,3,"Yes",None).event("EndDialog","ErrorYes") | |
| 523 error.pushbutton("A",0,72,81,21,3,"Abort",None).event("EndDialog","ErrorAbort") | |
| 524 error.pushbutton("C",42,72,81,21,3,"Cancel",None).event("EndDialog","ErrorCancel") | |
| 525 error.pushbutton("I",81,72,81,21,3,"Ignore",None).event("EndDialog","ErrorIgnore") | |
| 526 error.pushbutton("O",159,72,81,21,3,"Ok",None).event("EndDialog","ErrorOk") | |
| 527 error.pushbutton("R",198,72,81,21,3,"Retry",None).event("EndDialog","ErrorRetry") | |
| 528 | |
| 529 ##################################################################### | |
| 530 # Global "Query Cancel" dialog | |
| 531 cancel = Dialog(db, "CancelDlg", 50, 10, 260, 85, 3, title, | |
| 532 "No", "No", "No") | |
| 533 cancel.text("Text", 48, 15, 194, 30, 3, | |
| 534 "Are you sure you want to cancel [ProductName] installation?") | |
| 535 #cancel.control("Icon", "Icon", 15, 15, 24, 24, 5242881, None, | |
| 536 # "py.ico", None, None) | |
| 537 c=cancel.pushbutton("Yes", 72, 57, 56, 17, 3, "Yes", "No") | |
| 538 c.event("EndDialog", "Exit") | |
| 539 | |
| 540 c=cancel.pushbutton("No", 132, 57, 56, 17, 3, "No", "Yes") | |
| 541 c.event("EndDialog", "Return") | |
| 542 | |
| 543 ##################################################################### | |
| 544 # Global "Wait for costing" dialog | |
| 545 costing = Dialog(db, "WaitForCostingDlg", 50, 10, 260, 85, modal, title, | |
| 546 "Return", "Return", "Return") | |
| 547 costing.text("Text", 48, 15, 194, 30, 3, | |
| 548 "Please wait while the installer finishes determining your disk space requirements.") | |
| 549 c = costing.pushbutton("Return", 102, 57, 56, 17, 3, "Return", None) | |
| 550 c.event("EndDialog", "Exit") | |
| 551 | |
| 552 ##################################################################### | |
| 553 # Preparation dialog: no user input except cancellation | |
| 554 prep = PyDialog(db, "PrepareDlg", x, y, w, h, modeless, title, | |
| 555 "Cancel", "Cancel", "Cancel") | |
| 556 prep.text("Description", 15, 70, 320, 40, 0x30003, | |
| 557 "Please wait while the Installer prepares to guide you through the installation.") | |
| 558 prep.title("Welcome to the [ProductName] Installer") | |
| 559 c=prep.text("ActionText", 15, 110, 320, 20, 0x30003, "Pondering...") | |
| 560 c.mapping("ActionText", "Text") | |
| 561 c=prep.text("ActionData", 15, 135, 320, 30, 0x30003, None) | |
| 562 c.mapping("ActionData", "Text") | |
| 563 prep.back("Back", None, active=0) | |
| 564 prep.next("Next", None, active=0) | |
| 565 c=prep.cancel("Cancel", None) | |
| 566 c.event("SpawnDialog", "CancelDlg") | |
| 567 | |
| 568 ##################################################################### | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
569 # Feature (Python directory) selection |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
570 seldlg = PyDialog(db, "SelectFeaturesDlg", x, y, w, h, modal, title, |
| 36845 | 571 "Next", "Next", "Cancel") |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
572 seldlg.title("Select Python Installations") |
| 36845 | 573 |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
574 seldlg.text("Hint", 15, 30, 300, 20, 3, |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
575 "Select the Python locations where %s should be installed." |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
576 % self.distribution.get_fullname()) |
| 36845 | 577 |
| 578 seldlg.back("< Back", None, active=0) | |
| 579 c = seldlg.next("Next >", "Cancel") | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
580 order = 1 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
581 c.event("[TARGETDIR]", "[SourceDir]", ordering=order) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
582 for version in self.versions + [self.other_version]: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
583 order += 1 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
584 c.event("[TARGETDIR]", "[TARGETDIR%s]" % version, |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
585 "FEATURE_SELECTED AND &Python%s=3" % version, |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
586 ordering=order) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
587 c.event("SpawnWaitDialog", "WaitForCostingDlg", ordering=order + 1) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
588 c.event("EndDialog", "Return", ordering=order + 2) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
589 c = seldlg.cancel("Cancel", "Features") |
| 36845 | 590 c.event("SpawnDialog", "CancelDlg") |
| 591 | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
592 c = seldlg.control("Features", "SelectionTree", 15, 60, 300, 120, 3, |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
593 "FEATURE", None, "PathEdit", None) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
594 c.event("[FEATURE_SELECTED]", "1") |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
595 ver = self.other_version |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
596 install_other_cond = "FEATURE_SELECTED AND &Python%s=3" % ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
597 dont_install_other_cond = "FEATURE_SELECTED AND &Python%s<>3" % ver |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
598 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
599 c = seldlg.text("Other", 15, 200, 300, 15, 3, |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
600 "Provide an alternate Python location") |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
601 c.condition("Enable", install_other_cond) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
602 c.condition("Show", install_other_cond) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
603 c.condition("Disable", dont_install_other_cond) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
604 c.condition("Hide", dont_install_other_cond) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
605 |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
606 c = seldlg.control("PathEdit", "PathEdit", 15, 215, 300, 16, 1, |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
607 "TARGETDIR" + ver, None, "Next", None) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
608 c.condition("Enable", install_other_cond) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
609 c.condition("Show", install_other_cond) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
610 c.condition("Disable", dont_install_other_cond) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
611 c.condition("Hide", dont_install_other_cond) |
| 36845 | 612 |
| 613 ##################################################################### | |
| 614 # Disk cost | |
| 615 cost = PyDialog(db, "DiskCostDlg", x, y, w, h, modal, title, | |
| 616 "OK", "OK", "OK", bitmap=False) | |
| 617 cost.text("Title", 15, 6, 200, 15, 0x30003, | |
| 618 "{\DlgFontBold8}Disk Space Requirements") | |
| 619 cost.text("Description", 20, 20, 280, 20, 0x30003, | |
| 620 "The disk space required for the installation of the selected features.") | |
| 621 cost.text("Text", 20, 53, 330, 60, 3, | |
| 622 "The highlighted volumes (if any) do not have enough disk space " | |
| 623 "available for the currently selected features. You can either " | |
| 624 "remove some files from the highlighted volumes, or choose to " | |
| 625 "install less features onto local drive(s), or select different " | |
| 626 "destination drive(s).") | |
| 627 cost.control("VolumeList", "VolumeCostList", 20, 100, 330, 150, 393223, | |
| 628 None, "{120}{70}{70}{70}{70}", None, None) | |
| 629 cost.xbutton("OK", "Ok", None, 0.5).event("EndDialog", "Return") | |
| 630 | |
| 631 ##################################################################### | |
| 632 # WhichUsers Dialog. Only available on NT, and for privileged users. | |
| 633 # This must be run before FindRelatedProducts, because that will | |
| 634 # take into account whether the previous installation was per-user | |
| 635 # or per-machine. We currently don't support going back to this | |
| 636 # dialog after "Next" was selected; to support this, we would need to | |
| 637 # find how to reset the ALLUSERS property, and how to re-run | |
| 638 # FindRelatedProducts. | |
| 639 # On Windows9x, the ALLUSERS property is ignored on the command line | |
| 640 # and in the Property table, but installer fails according to the documentation | |
| 641 # if a dialog attempts to set ALLUSERS. | |
| 642 whichusers = PyDialog(db, "WhichUsersDlg", x, y, w, h, modal, title, | |
| 643 "AdminInstall", "Next", "Cancel") | |
| 644 whichusers.title("Select whether to install [ProductName] for all users of this computer.") | |
| 645 # A radio group with two options: allusers, justme | |
| 646 g = whichusers.radiogroup("AdminInstall", 15, 60, 260, 50, 3, | |
| 647 "WhichUsers", "", "Next") | |
| 648 g.add("ALL", 0, 5, 150, 20, "Install for all users") | |
| 649 g.add("JUSTME", 0, 25, 150, 20, "Install just for me") | |
| 650 | |
| 651 whichusers.back("Back", None, active=0) | |
| 652 | |
| 653 c = whichusers.next("Next >", "Cancel") | |
| 654 c.event("[ALLUSERS]", "1", 'WhichUsers="ALL"', 1) | |
|
38072
ee98ecf05773
Rename parameters to match the documentation (which
Martin v. Löwis <martin@v.loewis.de>
parents:
36905
diff
changeset
|
655 c.event("EndDialog", "Return", ordering = 2) |
| 36845 | 656 |
| 657 c = whichusers.cancel("Cancel", "AdminInstall") | |
| 658 c.event("SpawnDialog", "CancelDlg") | |
| 659 | |
| 660 ##################################################################### | |
| 661 # Installation Progress dialog (modeless) | |
| 662 progress = PyDialog(db, "ProgressDlg", x, y, w, h, modeless, title, | |
| 663 "Cancel", "Cancel", "Cancel", bitmap=False) | |
| 664 progress.text("Title", 20, 15, 200, 15, 0x30003, | |
| 665 "{\DlgFontBold8}[Progress1] [ProductName]") | |
| 666 progress.text("Text", 35, 65, 300, 30, 3, | |
| 667 "Please wait while the Installer [Progress2] [ProductName]. " | |
| 668 "This may take several minutes.") | |
| 669 progress.text("StatusLabel", 35, 100, 35, 20, 3, "Status:") | |
| 670 | |
| 671 c=progress.text("ActionText", 70, 100, w-70, 20, 3, "Pondering...") | |
| 672 c.mapping("ActionText", "Text") | |
| 673 | |
| 674 #c=progress.text("ActionData", 35, 140, 300, 20, 3, None) | |
| 675 #c.mapping("ActionData", "Text") | |
| 676 | |
| 677 c=progress.control("ProgressBar", "ProgressBar", 35, 120, 300, 10, 65537, | |
| 678 None, "Progress done", None, None) | |
| 679 c.mapping("SetProgress", "Progress") | |
| 680 | |
| 681 progress.back("< Back", "Next", active=False) | |
| 682 progress.next("Next >", "Cancel", active=False) | |
| 683 progress.cancel("Cancel", "Back").event("SpawnDialog", "CancelDlg") | |
| 684 | |
| 685 ################################################################### | |
| 686 # Maintenance type: repair/uninstall | |
| 687 maint = PyDialog(db, "MaintenanceTypeDlg", x, y, w, h, modal, title, | |
| 688 "Next", "Next", "Cancel") | |
| 689 maint.title("Welcome to the [ProductName] Setup Wizard") | |
| 690 maint.text("BodyText", 15, 63, 330, 42, 3, | |
| 691 "Select whether you want to repair or remove [ProductName].") | |
| 692 g=maint.radiogroup("RepairRadioGroup", 15, 108, 330, 60, 3, | |
| 693 "MaintenanceForm_Action", "", "Next") | |
| 694 #g.add("Change", 0, 0, 200, 17, "&Change [ProductName]") | |
| 695 g.add("Repair", 0, 18, 200, 17, "&Repair [ProductName]") | |
| 696 g.add("Remove", 0, 36, 200, 17, "Re&move [ProductName]") | |
| 697 | |
| 698 maint.back("< Back", None, active=False) | |
| 699 c=maint.next("Finish", "Cancel") | |
| 700 # Change installation: Change progress dialog to "Change", then ask | |
| 701 # for feature selection | |
| 702 #c.event("[Progress1]", "Change", 'MaintenanceForm_Action="Change"', 1) | |
| 703 #c.event("[Progress2]", "changes", 'MaintenanceForm_Action="Change"', 2) | |
| 704 | |
| 705 # Reinstall: Change progress dialog to "Repair", then invoke reinstall | |
| 706 # Also set list of reinstalled features to "ALL" | |
| 707 c.event("[REINSTALL]", "ALL", 'MaintenanceForm_Action="Repair"', 5) | |
| 708 c.event("[Progress1]", "Repairing", 'MaintenanceForm_Action="Repair"', 6) | |
| 709 c.event("[Progress2]", "repairs", 'MaintenanceForm_Action="Repair"', 7) | |
| 710 c.event("Reinstall", "ALL", 'MaintenanceForm_Action="Repair"', 8) | |
| 711 | |
| 712 # Uninstall: Change progress to "Remove", then invoke uninstall | |
| 713 # Also set list of removed features to "ALL" | |
| 714 c.event("[REMOVE]", "ALL", 'MaintenanceForm_Action="Remove"', 11) | |
| 715 c.event("[Progress1]", "Removing", 'MaintenanceForm_Action="Remove"', 12) | |
| 716 c.event("[Progress2]", "removes", 'MaintenanceForm_Action="Remove"', 13) | |
| 717 c.event("Remove", "ALL", 'MaintenanceForm_Action="Remove"', 14) | |
| 718 | |
| 719 # Close dialog when maintenance action scheduled | |
| 720 c.event("EndDialog", "Return", 'MaintenanceForm_Action<>"Change"', 20) | |
| 721 #c.event("NewDialog", "SelectFeaturesDlg", 'MaintenanceForm_Action="Change"', 21) | |
| 722 | |
| 723 maint.cancel("Cancel", "RepairRadioGroup").event("SpawnDialog", "CancelDlg") | |
| 724 | |
| 725 def get_installer_filename(self, fullname): | |
| 726 # Factored out to allow overriding in subclasses | |
|
53763
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
727 if self.target_version: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
728 base_name = "%s.%s-py%s.msi" % (fullname, self.plat_name, |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
729 self.target_version) |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
730 else: |
|
2416f166de4b
Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.)
Steven Bethard <steven.bethard@gmail.com>
parents:
46331
diff
changeset
|
731 base_name = "%s.%s.msi" % (fullname, self.plat_name) |
|
46331
a93d2919ea59
Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents:
45468
diff
changeset
|
732 installer_name = os.path.join(self.dist_dir, base_name) |
| 36845 | 733 return installer_name |
