From 3fcc4d3b17c2fc68d697f85a2184d1a9e2dce137 Mon Sep 17 00:00:00 2001 From: iliapolo Date: Sat, 7 Dec 2019 15:23:52 +0200 Subject: [PATCH] Copy the executable to the path expected by the installer before running it --- pyci/api/package/packager.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyci/api/package/packager.py b/pyci/api/package/packager.py index aeec616..ea91e0c 100644 --- a/pyci/api/package/packager.py +++ b/pyci/api/package/packager.py @@ -462,6 +462,13 @@ def nsis(self, binary_path, makensis_path = os.path.join(temp_dir, 'nsis-3.04', 'makensis.exe') command = '{} -DVERSION={} {}'.format(makensis_path, version, installer_path) + # The installer expects the binary to be located in the working directory + # and be named {{ name }}.exe. + # See installer.nsi.jinja#L85 + expected_binary_path = os.path.join(temp_dir, '{}.exe'.format(name)) + self._debug('Copying binary to expected location: {}'.format(expected_binary_path)) + shutil.copyfile(src=binary_path, dst=expected_binary_path) + self._debug('Creating installer...') self._runner.run(command, cwd=temp_dir)