Skip to content

Commit

Permalink
Check if MSU download succeeded
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Jul 31, 2015
1 parent ac8855b commit 1599bf3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
5 changes: 5 additions & 0 deletions examples/console/installer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@ entry_point=guessnumber:main
# We need to set this to get a console:
console=true

[Python]
version=3.5.0b4
bitness=64
format=bundled

[Include]
packages=guessnumber
19 changes: 15 additions & 4 deletions nsist/pyapp_msvcrt.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,21 @@ Section "-msvcrt"
IfFileExists "$SYSDIR\ucrtbase.dll" skip_msvcrt
StrCmp $0 "--" skip_msvcrt

DetailPrint "Downloading and installing MSVCRT from $0"
NSISdl::download $0 msvcrt.msu
ExecWait 'start /wait wusa /quiet /norestart "$INSTDIR\msvcrt.msu"' $1
Delete "$INSTDIR\msvcrt.msu"
DetailPrint "Need to install MSVCRT 2015. This may take a few minutes."
DetailPrint "Downloading $0"
NSISdl::download "$0" "$INSTDIR\msvcrt.msu"
Pop $2
DetailPrint "Download finished ($2)"
${If} $2 == "success"
DetailPrint "Running wusa to install update package"
ExecWait 'wusa "$INSTDIR\msvcrt.msu" /quiet /norestart' $1
Delete "$INSTDIR\msvcrt.msu"
${Else}
MessageBox MB_OK "Failed to download important update! \
${PRODUCT_NAME} will not run until you install the Visual C++ \
redistributable for Visual Studio 2015.\
$\n$\nhttp://www.microsoft.com/en-us/download/details.aspx?id=48145"
${EndIf}

# This WUSA exit code means a reboot is needed.
${If} $1 = 0x00240005
Expand Down

0 comments on commit 1599bf3

Please sign in to comment.