According to
authorGerald Combs <gerald@wireshark.org>
Fri, 20 Jul 2012 17:56:16 +0000 (17:56 -0000)
committerGerald Combs <gerald@wireshark.org>
Fri, 20 Jul 2012 17:56:16 +0000 (17:56 -0000)
http://blogs.msdn.com/b/astebner/archive/2010/10/20/10078468.aspx

and bug 7507 the Visual C++ 2010 redistributable installer might want
to reboot the system. Tell it not to do that and request a reboot at
the end of the installation process if needed.

svn path=/trunk/; revision=43864

packaging/nsis/Makefile.nmake
packaging/nsis/wireshark.nsi

index d174a8c01afcacf5cefbfbc72574ae3efae893bc..b16b4fec3581787e95d84b7fe8ae896bc84c18de 100644 (file)
@@ -92,7 +92,9 @@ NSIS_FLAGS=\
        /DMAKEDIR=$(MAKEDIR) \
        /DSTAGING_DIR=$(STAGING_DIR) \
        /DWIRESHARK_TARGET_PLATFORM=$(WIRESHARK_TARGET_PLATFORM) \
+       /DTARGET_MACHINE=$(TARGET_MACHINE) \
        /DMSVC_VARIANT=$(MSVC_VARIANT) \
+       /DMSC_VER_REQUIRED=$(MSC_VER_REQUIRED) \
        /DWIRESHARK_LIB_DIR=$(WIRESHARK_LIB_DIR) \
 !IFDEF MSVCR_DLL
        /DMSVCR_DLL="$(MSVCR_DLL)" \
index 9fde73c4ddb00c95fc6a50e57a9912fc29865891..66bbe0070ceb36ffd217a4dfbefd650f5fc8b078 100644 (file)
@@ -275,6 +275,8 @@ FunctionEnd
 Var WINPCAP_UNINSTALL ;declare variable for holding the value of a registry key
 ;Var WIRESHARK_UNINSTALL ;declare variable for holding the value of a registry key
 
+Var VCREDIST_FLAGS ; silent vs passive, norestart
+
 Section "-Required"
 ;-------------------------------------------
 
@@ -354,16 +356,26 @@ File "..\..\ipmap.html"
 !ifdef VCREDIST_EXE
 ; vcredist_x86.exe (MSVC V8) - copy and execute the redistributable installer
 File "${VCREDIST_EXE}"
-!if ${WIRESHARK_TARGET_PLATFORM} == "win32"
 ; If the user already has the redistributable installed they will see a
 ; Big Ugly Dialog by default, asking if they want to uninstall or repair.
 ; Ideally we should add a checkbox for this somewhere. In the meantime,
-; just do a silent install.
-ExecWait '"$INSTDIR\vcredist_x86.exe" /q' $0
-!else
-ExecWait '"$INSTDIR\vcredist_x64.exe" /q' $0
-!endif ; WIRESHARK_TARGET_PLATFORM
-DetailPrint "vcredist_x86 returned $0"
+; just do a "passive+norestart" install for MSVC 2010 and later and a
+; "silent" install otherwise.
+
+; http://blogs.msdn.com/b/astebner/archive/2010/10/20/10078468.aspx
+!searchparse /noerrors ${MSVC_VER_REQUIRED} "1400" VCREDIST_OLD_FLAGS "1500" VCREDIST_OLD_FLAGS
+!ifdef VCREDIST_OLD_FLAGS
+StrCpy $VCREDIST_FLAGS "/q"
+!else ; VCREDIST_OLD_FLAGS
+StrCpy $VCREDIST_FLAGS "/q /norestart"
+!endif ; VCREDIST_OLD_FLAGS
+
+ExecWait '"$INSTDIR\vcredist_${TARGET_MACHINE}.exe" $VCREDIST_FLAGS' $0
+DetailPrint "vcredist_${TARGET_MACHINE} returned $0"
+IntCmp $0 3010 redistReboot redistNoReboot
+redistReboot:
+SetRebootFlag true
+redistNoReboot:
 !else
 !ifdef MSVCR_DLL
 ; msvcr*.dll (MSVC V7 or V7.1) - simply copy the dll file