Skip to content

Commit

Permalink
Install msvcrt 2015 for embeddable Python 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Jul 31, 2015
1 parent bda00a1 commit ac8855b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion nsist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(self, appname, version, shortcuts, icon=DEFAULT_ICON,
self.nsi_template = nsi_template
if self.nsi_template is None:
if self.py_format == 'bundled':
self.nsi_template = 'pyapp.nsi'
self.nsi_template = 'pyapp_msvcrt.nsi'
elif self._py_version_tuple < (3, 3):
self.nsi_template = 'pyapp_w_pylauncher.nsi'
else:
Expand Down Expand Up @@ -371,6 +371,9 @@ def write_nsi(self):
self.install_files.sort(key=operator.itemgetter(1))
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):
"""Runs makensis using the specified .nsi file
Expand Down
4 changes: 3 additions & 1 deletion nsist/pyapp_msvcrt.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Section "-msvcrt"

DetailPrint "Downloading and installing MSVCRT from $0"
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"

# This WUSA exit code means a reboot is needed.
Expand All @@ -46,4 +46,6 @@ Section "-msvcrt"

skip_msvcrt:
SectionEnd

[[ super() ]]
[% endblock sections %]

0 comments on commit ac8855b

Please sign in to comment.