浏览代码

Install msvcrt 2015 for embeddable Python 3.5

Thomas Kluyver 9 年之前
父节点
当前提交
ac8855b170
共有 2 个文件被更改,包括 7 次插入2 次删除
  1. 4 1
      nsist/__init__.py
  2. 3 1
      nsist/pyapp_msvcrt.nsi

+ 4 - 1
nsist/__init__.py

@@ -120,7 +120,7 @@ class InstallerBuilder(object):
         self.nsi_template = nsi_template
         self.nsi_template = nsi_template
         if self.nsi_template is None:
         if self.nsi_template is None:
             if self.py_format == 'bundled':
             if self.py_format == 'bundled':
-                self.nsi_template = 'pyapp.nsi'
+                self.nsi_template = 'pyapp_msvcrt.nsi'
             elif self._py_version_tuple < (3, 3):
             elif self._py_version_tuple < (3, 3):
                 self.nsi_template = 'pyapp_w_pylauncher.nsi'
                 self.nsi_template = 'pyapp_w_pylauncher.nsi'
             else:
             else:
@@ -371,6 +371,9 @@ if __name__ == '__main__':
         self.install_files.sort(key=operator.itemgetter(1))
         self.install_files.sort(key=operator.itemgetter(1))
         nsis_writer.write(self.nsi_file)
         nsis_writer.write(self.nsi_file)
 
 
+        if self.nsi_template == 'pyapp_msvcrt.nsi':
+            shutil.copy2(pjoin(_PKGDIR, 'windowsversion.nsh'), self.build_dir)
+
     def run_nsis(self):
     def run_nsis(self):
         """Runs makensis using the specified .nsi file
         """Runs makensis using the specified .nsi file
         
         

+ 3 - 1
nsist/pyapp_msvcrt.nsi

@@ -36,7 +36,7 @@ Section "-msvcrt"
 
 
   DetailPrint "Downloading and installing MSVCRT from $0"
   DetailPrint "Downloading and installing MSVCRT from $0"
   NSISdl::download $0 msvcrt.msu
   NSISdl::download $0 msvcrt.msu
-  ExecWait 'wusa /quiet /norestart "$INSTDIR\msvcrt.msu"' $1
+  ExecWait 'start /wait wusa /quiet /norestart "$INSTDIR\msvcrt.msu"' $1
   Delete "$INSTDIR\msvcrt.msu"
   Delete "$INSTDIR\msvcrt.msu"
 
 
   # This WUSA exit code means a reboot is needed.
   # This WUSA exit code means a reboot is needed.
@@ -46,4 +46,6 @@ Section "-msvcrt"
 
 
   skip_msvcrt:
   skip_msvcrt:
 SectionEnd
 SectionEnd
+
+[[ super() ]]
 [% endblock sections %]
 [% endblock sections %]