Browse Source

Show an error on exit codes ec & 0x80000000

Closes gh-75
Thomas Kluyver 8 years ago
parent
commit
7f2b1cbaf7
2 changed files with 10 additions and 0 deletions
  1. 2 0
      doc/releasenotes.rst
  2. 8 0
      nsist/pyapp_msvcrt.nsi

+ 2 - 0
doc/releasenotes.rst

@@ -12,6 +12,8 @@ Version 1.8
 * Installers using :ref:`bundled Python <python_bundled>` may need a Windows
 * Installers using :ref:`bundled Python <python_bundled>` may need a Windows
   update package for the Microsoft C runtime. They now download this from the
   update package for the Microsoft C runtime. They now download this from the
   `RawGit <https://rawgit.com/>`__ CDN, rather than hitting GitHub directly.
   `RawGit <https://rawgit.com/>`__ CDN, rather than hitting GitHub directly.
+* If the Windows update package fails to install, an error message will be
+  displayed.
 
 
 Version 1.7
 Version 1.7
 -----------
 -----------

+ 8 - 0
nsist/pyapp_msvcrt.nsi

@@ -54,6 +54,14 @@ Section "-msvcrt"
   # This WUSA exit code means a reboot is needed.
   # This WUSA exit code means a reboot is needed.
   ${If} $1 = 0x00240005
   ${If} $1 = 0x00240005
     SetRebootFlag true
     SetRebootFlag true
+  ${Else}
+    IntOp $0 $1 & 0x80000000
+    ${If} $0 <> 0
+      MessageBox MB_OK "Failed to install 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}
   ${EndIf}
   ${EndIf}
 
 
   skip_msvcrt:
   skip_msvcrt: