contrib/packaging/hgpackaging/inno.py
changeset 43514 10454e788111
parent 43076 2372284d9457
child 43515 7bd88d0d6a82
--- a/contrib/packaging/hgpackaging/inno.py	Wed Oct 23 18:37:36 2019 -0700
+++ b/contrib/packaging/hgpackaging/inno.py	Wed Oct 23 18:39:08 2019 -0700
@@ -15,7 +15,6 @@
 from .py2exe import build_py2exe
 from .util import find_vc_runtime_files
 
-
 EXTRA_PACKAGES = {
     'dulwich',
     'keyring',
@@ -43,11 +42,16 @@
         raise Exception('%s does not exist' % iscc_exe)
 
     vc_x64 = r'\x64' in os.environ.get('LIB', '')
+    arch = 'x64' if vc_x64 else 'x86'
+    inno_source_dir = source_dir / 'contrib' / 'packaging' / 'inno'
+    inno_build_dir = build_dir / ('inno-%s' % arch)
 
     requirements_txt = (
         source_dir / 'contrib' / 'packaging' / 'inno' / 'requirements.txt'
     )
 
+    inno_build_dir.mkdir(parents=True, exist_ok=True)
+
     build_py2exe(
         source_dir,
         build_dir,
@@ -71,6 +75,10 @@
 
     print('creating installer')
 
+    # Copy Inno files into place.
+    for p in ('mercurial.iss', 'modpath.iss'):
+        shutil.copyfile(inno_source_dir / p, inno_build_dir / p)
+
     args = [str(iscc_exe)]
 
     if vc_x64:
@@ -80,6 +88,6 @@
         args.append('/dVERSION=%s' % version)
 
     args.append('/Odist')
-    args.append('contrib/packaging/inno/mercurial.iss')
+    args.append(str(inno_build_dir / 'mercurial.iss'))
 
     subprocess.run(args, cwd=str(source_dir), check=True)