|
@@ -96,7 +96,7 @@ class InstallerBuilder(object):
|
|
|
py_format='bundled', inc_msvcrt=True, build_dir=DEFAULT_BUILD_DIR,
|
|
|
installer_name=None, nsi_template=None,
|
|
|
exclude=None, pypi_wheel_reqs=None, extra_wheel_sources=None,
|
|
|
- commands=None):
|
|
|
+ commands=None, license=None):
|
|
|
self.appname = appname
|
|
|
self.version = version
|
|
|
self.publisher = publisher
|
|
@@ -108,6 +108,7 @@ class InstallerBuilder(object):
|
|
|
self.pypi_wheel_reqs = pypi_wheel_reqs or []
|
|
|
self.extra_wheel_sources = extra_wheel_sources or []
|
|
|
self.commands = commands or {}
|
|
|
+ self.license = license
|
|
|
|
|
|
# Python options
|
|
|
self.py_version = py_version
|
|
@@ -282,7 +283,7 @@ if __name__ == '__main__':
|
|
|
copy to the build directory. Prepare target and parameters for these
|
|
|
shortcuts.
|
|
|
|
|
|
- Also copies shortcut icons
|
|
|
+ Also copies shortcut icons, and, if specified, the license file.
|
|
|
"""
|
|
|
files = set()
|
|
|
for scname, sc in self.shortcuts.items():
|
|
@@ -315,6 +316,12 @@ if __name__ == '__main__':
|
|
|
sc['icon'] = os.path.basename(sc['icon'])
|
|
|
files.add(sc['icon'])
|
|
|
|
|
|
+ # Copy license
|
|
|
+ if self.license:
|
|
|
+ shutil.copy2(self.license, self.build_dir)
|
|
|
+ license_file_name = os.path.basename(self.license)
|
|
|
+ self.install_files.append((license_file_name, '$INSTDIR'))
|
|
|
+
|
|
|
self.install_files.extend([(f, '$INSTDIR') for f in files])
|
|
|
|
|
|
def prepare_packages(self):
|