Nmap Development mailing list archives

[PATCH] Nmap.nsi and Microsoft Visual C++ 2008 Redistributable


From: jah <jah () zadkiel plus com>
Date: Wed, 15 Jul 2009 22:44:19 +0100

Hi folks,

Tom Sellers reported an issue with Nmap windows installer reporting that
the Microsoft Visual C++ 2008 Redistributable Package failed to install,
but that it did seem to install OK despite the error and that Nmap
seemed to work OK.
I've reproduced this on a clean XP VM.  The error message is:
"Microsoft Visual C++ 2008 Redistributable Package (x86) failed to
install (C:\Program Files\Nmap\vcredist_x86.exe). Please ensure your
system meets the minimum requirements before running the installer again."
This error dialog is from Nmaps installer and is shown regardless of
whether the package installs successfully or not (in my case and Tom's
too by the sounds of it the package IS successfully installed).  The
reason for the error is that, after invoking the redistributable
installer, the nsis installer attempts to check whether installation was
successful by reading a windows registry key pertaining to version
9.0.21022 of the redist package - yet the redist package installed was
the upgraded version 9.0.30729.17 which happened in r13075.

If version 9.0.21022 is present, this test will pass and there's no
error message - this would be the case if you've had a previous version
of Nmap installed and accounts for the fact that no-one's noticed before
now.  If version 9.0.21022  is not present, there's an error message
even when version 9.0.30729.17 is present, thus Nmap may work fine
despite the message.

Attached is a patch to update the nsis script with the new registry
details which I've tested on XP SP2 and SP3.

Regards,

jah
--- Nmap.nsi.orig       2009-07-15 21:43:27.015625000 +0100
+++ Nmap.nsi    2009-07-15 22:16:43.515625000 +0100
@@ -175,8 +175,8 @@
   WriteRegStr HKCU "Software\Nmap" "" $INSTDIR 
 
   ;Check if VC++ 2008 runtimes are already installed:
-    ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4}" 
"DisplayName"
-    StrCmp $0 "Microsoft Visual C++ 2008 Redistributable - x86 9.0.21022" create_uninstaller vcredist_silent_install
+    ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9A25302D-30C0-39D9-BD6F-21E6EC160475}" 
"DisplayName"
+    StrCmp $0 "Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.17" create_uninstaller vcredist_silent_install
 
   ;If VC++ 2008 runtimes are not installed...
   vcredist_silent_install:
@@ -184,8 +184,8 @@
     File ..\vcredist_x86.exe
     ExecWait '"$INSTDIR\vcredist_x86.exe" /q' $0
     ;Check for successful installation of our vcredist_x86.exe...
-    ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4}" 
"DisplayName"
-    StrCmp $0 "Microsoft Visual C++ 2008 Redistributable - x86 9.0.21022" vcredist_success vcredist_not_present
+    ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9A25302D-30C0-39D9-BD6F-21E6EC160475}" 
"DisplayName"
+    StrCmp $0 "Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.17" vcredist_success vcredist_not_present
     vcredist_not_present:
       DetailPrint "Microsoft Visual C++ 2008 Redistributable failed to install"
       IfSilent create_uninstaller vcredist_messagebox

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Current thread: