Changeset 44484 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jan 31, 2013 11:36:25 AM (12 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Installer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi
r44459 r44484 402 402 ; Prevent popping up usage message on (yet) unknown parameters 403 403 ; in silent mode, just skip 404 IfSilent 0+2404 IfSilent +1 +2 405 405 ${Break} 406 406 goto usage … … 473 473 begin: 474 474 475 ${LogVerbose} "Checking for old Guest Additions ..." 476 475 477 sun_check: 476 478 … … 587 589 ${EndIf} 588 590 591 IfSilent +1 +2 592 StrCpy $g_bLogEnable "true" ; Force logging in silent mode 593 594 ${LogEnable} "$g_bLogEnable" 595 IfSilent +1 +2 ; NSIS will expand ${LogVerbose} before doing relative jumps! 596 LogText "Installer runs in silent mode" 597 589 598 SetOutPath "$INSTDIR" 590 599 SetOverwrite on … … 598 607 ${LogVerbose} "Previous version: $g_strAddVerMaj.$g_strAddVerMin.$g_strAddVerBuild (Rev $g_strAddVerRev)" 599 608 ${Else} 600 ${LogVerbose} "No previous version of ${PRODUCT_NAME} detected ."609 ${LogVerbose} "No previous version of ${PRODUCT_NAME} detected" 601 610 ${EndIf} 602 611 !if $%BUILD_TARGET_ARCH% == "amd64" … … 610 619 ${LogVerbose} "Installer runs in debug mode" 611 620 !endif 621 622 ; Retrieve capabilities 623 Call CheckForCapabilities 612 624 613 625 ; … … 1049 1061 FunctionEnd 1050 1062 1051 ; This function is called when a critical error occurred 1063 ; This function is called when a critical error occurred, caused by 1064 ; the Abort command 1052 1065 Function .onInstFailed 1053 1066 1067 ${LogVerbose} "$(VBOX_ERROR_INST_FAILED)" 1054 1068 MessageBox MB_ICONSTOP $(VBOX_ERROR_INST_FAILED) /SD IDOK 1055 1069 … … 1066 1080 Function .onInstSuccess 1067 1081 1082 ${LogVerbose} "${PRODUCT_NAME} successfully installed" 1083 1068 1084 ${If} $g_bPostInstallStatus == "true" 1069 1085 ${LogToVBoxTray} "0" "${PRODUCT_NAME} successfully updated!" 1070 1086 ${EndIf} 1087 1088 SetErrorLevel 0 1071 1089 1072 1090 FunctionEnd … … 1139 1157 ${EndIf} 1140 1158 1141 IfSilent 0 +21142 StrCpy $g_bLogEnable "true" ; Force logging in silent mode1143 1144 ${LogEnable} "$g_bLogEnable"1145 IfSilent 0 +21146 ${LogVerbose} "Installer runs in silent mode"1147 1148 1159 ; Retrieve Windows version and store result in $g_strWinVersion 1149 Call GetWindowsVer 1150 1151 ; Retrieve capabilities 1152 Call CheckForCapabilities 1160 Call GetWindowsVersionEx 1161 Pop $g_strWinVersion 1153 1162 1154 1163 ; Get user Name 1155 1164 AccessControl::GetCurrentUserName 1156 1165 Pop $g_strCurUser 1157 ${LogVerbose} "Current user is: $g_strCurUser"1166 ${LogVerbose} "Current user: $g_strCurUser" 1158 1167 1159 1168 ; Only extract files? This action can be called even from non-Admin users … … 1174 1183 MessageBox MB_ICONSTOP $(VBOX_NOTICE_ARCH_X86) /SD IDOK 1175 1184 !endif 1176 Abort 1185 Abort "$(VBOX_NOTICE_ARCH_AMD64)" 1177 1186 ${EndIf} 1178 1187 … … 1274 1283 1275 1284 ; Retrieve Windows version we're running on and store it in $g_strWinVersion 1276 Call un.GetWindowsVer 1285 Call un.GetWindowsVersionEx 1286 Pop $g_strWinVersion 1277 1287 1278 1288 ; Retrieve capabilities -
trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh
r44459 r44484 137 137 !endif ; $%VBOX_WITH_CROGL% == "1" 138 138 !endif ; $%BUILD_TARGET_ARCH% == "amd64" 139 139 140 140 !if $%VBOX_WITH_WDDM_W8% == "1" 141 141 ; WDDM Video driver for Win8 … … 277 277 !insertmacro CheckArchitecture "un." 278 278 279 !macro GetWindowsVer un 280 Function ${un}GetWindowsVer 281 282 ; Check if we are running on w2k or above 283 ; For other windows versions (>XP) it may be necessary to change winver.nsh 279 ; 280 ; Macro for retrieving the Windows version this installer is running on. 281 ; 282 ; @return Stack: Windows version string. Empty on error / 283 ; if not able to identify. 284 ; 285 !macro GetWindowsVersionEx un 286 Function ${un}GetWindowsVersionEx 287 288 Push $0 289 Push $1 290 291 ; Check if we are running on Windows 2000 or above 292 ; For other windows versions (> XP) it may be necessary to change winver.nsh 284 293 Call ${un}GetWindowsVersion 285 Pop $ R3; Windows Version286 287 Push $ R3; The windows version string288 Push "NT" ; String to search for. Win 2k family returns no string containing 'NT'294 Pop $0 ; Windows Version 295 296 Push $0 ; The windows version string 297 Push "NT" ; String to search for. W2K+ returns no string containing "NT" 289 298 Call ${un}StrStr 290 Pop $R0 291 StrCmp $R0 '' nt5plus ; Not NT 3.XX or 4.XX 292 293 ; Ok we know it is NT. Must be a string like NT X.XX 294 Push $R3 ; The windows version string 295 Push "4." ; String to search for 296 Call ${un}StrStr 297 Pop $R0 298 StrCmp $R0 "" nt5plus nt4 ; If empty -> not NT 4 299 300 nt5plus: ; Windows 2000+ (XP, Vista, ...) 301 302 StrCpy $g_strWinVersion $R3 303 goto exit 304 305 nt4: ; NT 4.0 306 307 StrCpy $g_strWinVersion "NT4" 308 goto exit 309 310 exit: 311 312 FunctionEnd 313 !macroend 314 !insertmacro GetWindowsVer "" 315 !insertmacro GetWindowsVer "un." 299 Pop $1 300 301 ${If} $1 == "" ; If empty -> not NT 3.XX or 4.XX 302 StrCpy $g_strWinVersion $0 ; Use original version string 303 ${Else} 304 ; Ok we know it is NT. Must be a string like NT X.XX 305 Push $0 ; The windows version string 306 Push "4." ; String to search for 307 Call ${un}StrStr 308 Pop $1 309 ${If} $1 == "" ; If empty -> not NT 4 310 ;; @todo NT <= 3.x ? 311 StrCpy $g_strWinVersion $0 ; Use original version string 312 ${Else} 313 StrCpy $g_strWinVersion "NT4" 314 ${EndIf} 315 ${EndIf} 316 317 Pop $1 318 Exch $0 319 320 FunctionEnd 321 !macroend 322 !insertmacro GetWindowsVersionEx "" 323 !insertmacro GetWindowsVersionEx "un." 316 324 317 325 !macro GetAdditionsVersion un … … 415 423 ${LogVerbose} "Stopping attempt #$3" 416 424 !endif 417 425 418 426 ${If} $g_strWinVersion == "NT4" 419 427 StrCpy $2 "VBoxServiceNT.exe" … … 748 756 749 757 ; 750 ; Macro for copying a file only if the source file is verified 758 ; Macro for copying a file only if the source file is verified 751 759 ; to be from a certain vendor and architecture. 752 760 ; @return Stack: "0" if copied, "1" if not, "2" on error / not found. … … 761 769 Push "${Architecture}" 762 770 Push "${Vendor}" 763 Push "${FileSrc}" 771 Push "${FileSrc}" 764 772 Call ${un}VerifyFile 765 773 Pop $0 … … 837 845 ; Note: Not finding a file (like *d3d8.dll) on Windows Vista/7 is fine; 838 846 ; it simply is not present there. 839 840 ; Note 2: On 64-bit systems there are no 64-bit *d3d8 DLLs, only 32-bit ones 847 848 ; Note 2: On 64-bit systems there are no 64-bit *d3d8 DLLs, only 32-bit ones 841 849 ; in SysWOW64 (or in system32 on 32-bit systems). 842 850 … … 848 856 ${EndIf} 849 857 !endif 850 858 851 859 ${VerifyFileEx} "${un}" "$SYSDIR\d3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" 852 860 Pop $0 -
trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsExternal.nsh
r44459 r44484 1 1 ; $Id$ 2 2 ;; @file 3 ; VBoxGuestAdditionExternal.nsh - Utility function for invoking external 3 ; VBoxGuestAdditionExternal.nsh - Utility function for invoking external 4 4 ; applications. 5 5 ; … … 32 32 Push $0 33 33 Push $1 34 34 35 35 !define _macroLoc ${__LINE__} 36 36 37 37 ${LogVerbose} "Executing: ${cmdline}" 38 IfSilent 0 +639 nsExec::ExecTo Stack"${cmdline}"38 IfSilent silent_${_macroLoc} +1 39 nsExec::ExecToLog "${cmdline}" 40 40 Pop $0 ; Return value (exit code) 41 Pop $1 ; Stdout/stderr output (up to ${NSIS_MAX_STRLEN})42 ${LogVerbose} "$1"43 41 goto done_${_macroLoc} 44 45 nsExec::ExecToLog "${cmdline}" 42 43 silent_${_macroLoc}: 44 45 nsExec::ExecToStack "${cmdline}" 46 46 Pop $0 ; Return value (exit code) 47 Pop $1 ; Stdout/stderr output (up to ${NSIS_MAX_STRLEN}) 48 ${LogVerbose} "$1" 47 49 goto done_${_macroLoc} 48 50 49 51 done_${_macroLoc}: 50 52 51 ${LogVerbose} "Execution returned : $0"53 ${LogVerbose} "Execution returned exit code: $0" 52 54 IntCmp $0 0 +1 error_${_macroLoc} error_${_macroLoc} ; Check ret value (0=OK, 1=Error) 53 55 goto return_${_macroLoc} 54 56 55 57 error_${_macroLoc}: 56 58 57 59 ${If} ${optional} == "false" 58 ${LogVerbose} "Error excuting $\"${cmdline}$\" ( Return value: $0) -- aborting installation"59 Abort 60 ${LogVerbose} "Error excuting $\"${cmdline}$\" (exit code: $0) -- aborting installation" 61 Abort "Error excuting $\"${cmdline}$\" (exit code: $0) -- aborting installation" 60 62 ${Else} 61 63 ${LogVerbose} "Warning: Executing $\"${cmdline}$\" returned with exit code $0" 62 64 ${EndIf} 63 65 goto return_${_macroLoc} 64 66 65 67 return_${_macroLoc}: 66 68 67 69 Pop $1 68 70 Pop $0 69 71 70 72 !undef _macroLoc 71 73 -
trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsLog.nsh
r44352 r44484 39 39 !macro _logVerbose text 40 40 41 LogText 41 LogText "${text}" 42 42 IfSilent +2 43 43 DetailPrint "${text}"
Note:
See TracChangeset
for help on using the changeset viewer.