VirtualBox

Changeset 96686 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 10, 2022 11:36:01 PM (2 years ago)
Author:
vboxsync
Message:

Add/Nt/Installer: Added some comments, cleanups and a slickedit NSIS config. bugref:10261

Location:
trunk/src/VBox/Additions/WINNT/Installer
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi

    r96656 r96686  
    604604FunctionEnd
    605605
     606;
    606607; Main Files
     608;
    607609Section $(VBOX_COMPONENT_MAIN) SEC01
    608610
     
    649651  ; Which OS are we using?
    650652  ; @todo Use logic lib here
    651 !if $%KBUILD_TARGET_ARCH% == "x86"       ; 32-bit
    652   StrCmp $g_strWinVersion "NT4" nt4     ; Windows NT 4.0
    653 !endif
    654   StrCmp $g_strWinVersion "2000" w2k    ; Windows 2000
    655   StrCmp $g_strWinVersion "XP" w2k      ; Windows XP
    656   StrCmp $g_strWinVersion "2003" w2k    ; Windows 2003 Server
    657   StrCmp $g_strWinVersion "Vista" vista ; Windows Vista
    658   StrCmp $g_strWinVersion "7" vista     ; Windows 7
    659   StrCmp $g_strWinVersion "8" vista     ; Windows 8
    660   StrCmp $g_strWinVersion "8_1" vista   ; Windows 8.1 / Windows 2012 Server R2
    661   StrCmp $g_strWinVersion "10" vista    ; Windows 10
     653!if $%KBUILD_TARGET_ARCH% == "x86"                  ; 32-bit
     654  StrCmp $g_strWinVersion "NT4"   nt4               ; Windows NT 4.0
     655!endif
     656  StrCmp $g_strWinVersion "2000"  w2k_xp_w2k3       ; Windows 2000
     657  StrCmp $g_strWinVersion "XP"    w2k_xp_w2k3       ; Windows XP
     658  StrCmp $g_strWinVersion "2003"  w2k_xp_w2k3       ; Windows 2003 Server
     659  StrCmp $g_strWinVersion "Vista" vista_and_later  ; Windows Vista
     660  StrCmp $g_strWinVersion "7"     vista_and_later   ; Windows 7
     661  StrCmp $g_strWinVersion "8"     vista_and_later   ; Windows 8
     662  StrCmp $g_strWinVersion "8_1"   vista_and_later   ; Windows 8.1 / Windows 2012 Server R2
     663  StrCmp $g_strWinVersion "10"    vista_and_later   ; Windows 10
    662664
    663665  ${If} $g_bForceInstall == "true"
    664     Goto vista ; Assume newer OS than we know of ...
    665   ${EndIf}
    666 
    667   Goto notsupported
     666    Goto vista_and_later ; Assume newer OS than we know of ...
     667  ${EndIf}
     668
     669  MessageBox MB_ICONSTOP $(VBOX_PLATFORM_UNSUPPORTED) /SD IDOK
     670  goto exit
    668671
    669672!if $%KBUILD_TARGET_ARCH% == "x86"       ; 32-bit
     
    687690!endif
    688691
    689 w2k: ; Windows 2000 and XP ...
     692  ;
     693  ; Windows 2000, XP and Windows Server 2003 / XP64
     694  ;
     695w2k_xp_w2k3:
    690696
    691697  ; Copy some common files ...
     
    695701  goto success
    696702
    697 vista: ; Windows Vista / Windows 7 / Windows 8(.1)
     703  ;
     704  ; Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 and related server products.
     705  ;
     706vista_and_later:
    698707
    699708  ; Check requirments; this function can abort the installation if necessary!
     
    703712  Call Common_CopyFiles
    704713
    705   Call W2K_Main     ; First install stuff from Windows 2000 / XP
    706   Call Vista_Main   ; ... and some specific stuff for Vista / Windows 7
     714  Call W2K_Main     ; First install stuff for Windows 2000, XP, W2K3/XP64 ...
     715  Call Vista_Main   ; ... and some specific stuff for Vista and later.
    707716  goto success
    708 
    709 notsupported:
    710 
    711   MessageBox MB_ICONSTOP $(VBOX_PLATFORM_UNSUPPORTED) /SD IDOK
    712   goto exit
    713717
    714718success:
     
    728732SectionEnd
    729733
     734;;
    730735; Auto-logon support (section is hidden at the moment -- only can be enabled via command line switch)
     736;
    731737Section /o -$(VBOX_COMPONENT_AUTOLOGON) SEC02
    732738
     
    872878    ${If} $g_bCapWDDM == "true"
    873879      StrCpy $g_bWithWDDM "true"
    874       Goto exit
    875880    ${EndIf}
    876881
     
    886891
    887892  ${EndIf}
    888   Goto exit
    889 
    890 exit:
    891893
    892894  Pop $0
     
    930932FunctionEnd
    931933
     934;;
    932935; This function is called at the very beginning of installer execution
     936;
    933937Function .onInit
    934938
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh

    r96605 r96686  
    5353
    5454!ifndef UNINSTALLER_ONLY
     55;;
     56; Extract files to the install dir + arch.
     57;
    5558Function ExtractFiles
    5659
     
    185188!endif ; UNINSTALLER_ONLY
    186189
     190;;
     191; Checks that the installer target architecture matches the host,
     192; i.e. that we're not trying to install 32-bit binaries on a 64-bit
     193; host from WOW64 mode.
     194;
    187195!macro CheckArchitecture un
    188196Function ${un}CheckArchitecture
    189197
    190   Push $0
     198  Push $0   ;; @todo r=bird: Why ??
    191199
    192200  System::Call "kernel32::GetCurrentProcess() i .s"
     
    343351    nsExec::Exec '"$SYSDIR\net.exe" stop VBoxService'
    344352  ${Else}
    345     nsExec::Exec '"$SYSDIR\SC.exe" stop VBoxService'
     353    nsExec::Exec '"$SYSDIR\sc.exe" stop VBoxService'
    346354  ${EndIf}
    347355  Sleep "1000"           ; Wait a bit
     
    470478!insertmacro AbortShutdown "un."
    471479
     480;;
     481; Sets $g_bCapDllCache, $g_bCapXPDM, $g_bWithWDDM and $g_bCapWDDM.
     482;
    472483!macro CheckForCapabilities un
    473484Function ${un}CheckForCapabilities
     
    480491
    481492  ; Does the guest have a DLL cache?
    482   ${If}   $g_strWinVersion == "NT4"
     493  ${If}   $g_strWinVersion == "NT4"     ; bird: NT4 doesn't have a DLL cache, WTP is 5.0 <= NtVersion < 6.0.
    483494  ${OrIf} $g_strWinVersion == "2000"
    484495  ${OrIf} $g_strWinVersion == "XP"
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsExternal.nsh

    r96407 r96686  
    2626;
    2727
     28;;
     29; Macro for executing external applications.
    2830;
    29 ; Macro for executing external applications. Uses the nsExec plugin
    30 ; in different styles, depending on whether this installer runs in silent mode
    31 ; or not. If the external program reports an exit code other than 0 the installer
    32 ; will be aborted.
     31; Uses the nsExec plugin in different styles, depending on whether this
     32; installer runs in silent mode or not. If the external program reports an exit
     33; code other than 0 the installer will be aborted.
    3334;
    3435; @param   Command line (full qualified and quoted).
     
    3839;
    3940!macro _cmdExecute cmdline optional
    40 
     41  ; Save $0 & $1
    4142  Push $0
    4243  Push $1
    4344
    44   !define _macroLoc ${__LINE__}
    45 
     45  ;
     46  ; Execute the command, putting the exit code in $0 when done.
     47  ;
    4648  ${LogVerbose} "Executing: ${cmdline}"
    47   IfSilent silent_${_macroLoc} +1
     49  ${If} ${Silent}
     50    nsExec::ExecToStack "${cmdline}"
     51    Pop $0 ; Return value (exit code)
     52    Pop $1 ; Stdout/stderr output (up to ${NSIS_MAX_STRLEN})
     53    ${LogVerbose} "$1"
     54  ${Else}
    4855    nsExec::ExecToLog "${cmdline}"
    4956    Pop $0 ; Return value (exit code)
    50     goto done_${_macroLoc}
    51 
    52 silent_${_macroLoc}:
    53 
    54   nsExec::ExecToStack "${cmdline}"
    55   Pop $0 ; Return value (exit code)
    56   Pop $1 ; Stdout/stderr output (up to ${NSIS_MAX_STRLEN})
    57   ${LogVerbose} "$1"
    58   goto done_${_macroLoc}
    59 
    60 done_${_macroLoc}:
     57  ${EndIf}
    6158
    6259  ${LogVerbose} "Execution returned exit code: $0"
    63   IntCmp $0 0 +1 error_${_macroLoc} error_${_macroLoc} ; Check ret value (0=OK, 1=Error)
    64   goto return_${_macroLoc}
    6560
    66 error_${_macroLoc}:
     61  ;
     62  ; Check if it failed and take action according to the 2nd argument.
     63  ;
     64  ${If} $0 <> 0
     65    ${If} ${optional} == "false"
     66      ${LogVerbose} "Error excuting $\"${cmdline}$\" (exit code: $0) -- aborting installation"
     67      Abort "Error excuting $\"${cmdline}$\" (exit code: $0) -- aborting installation"
     68    ${Else}
     69      ${LogVerbose} "Warning: Executing $\"${cmdline}$\" returned with exit code $0"
     70    ${EndIf}
     71  ${EndIf}
    6772
    68   ${If} ${optional} == "false"
    69     ${LogVerbose} "Error excuting $\"${cmdline}$\" (exit code: $0) -- aborting installation"
    70     Abort "Error excuting $\"${cmdline}$\" (exit code: $0) -- aborting installation"
    71   ${Else}
    72     ${LogVerbose} "Warning: Executing $\"${cmdline}$\" returned with exit code $0"
    73   ${EndIf}
    74   goto return_${_macroLoc}
    75 
    76 return_${_macroLoc}:
    77 
     73  ; Restore $0 and $1.
    7874  Pop $1
    7975  Pop $0
    80 
    81   !undef _macroLoc
    82 
    8376!macroend
    8477!define CmdExecute "!insertmacro _cmdExecute"
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh

    r96407 r96686  
    238238  ; Guest driver files
    239239  FILE "$%PATH_OUT%\bin\additions\VBoxTray.exe"
    240   FILE "$%PATH_OUT%\bin\additions\VBoxControl.exe" ; Not used by W2K and up, but required by the .INF file
    241 
     240  FILE "$%PATH_OUT%\bin\additions\VBoxControl.exe"
     241
     242  ; Misc
    242243!ifdef VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST
    243244  FILE "$%PATH_OUT%\bin\additions\VBoxAudioTest.exe"
     
    307308    !endif ; $%KBUILD_TARGET_ARCH% == "amd64"
    308309
    309     Goto doneCr
    310310  ${EndIf}
    311311!endif ; $%VBOX_WITH_WDDM% == "1"
    312 
    313 doneCr:
    314312
    315313  Pop $0
     
    373371  ${EndIf}
    374372
     373  ;
     374  ; Mouse driver.
     375  ;
    375376  ${If} $g_bNoMouseDrv == "false"
    376377    ${LogVerbose} "Installing mouse driver ..."
     
    383384  ${EndIf}
    384385
     386  ;
    385387  ; Create the VBoxService service
    386388  ; No need to stop/remove the service here! Do this only on uninstallation!
     389  ;
    387390  ${LogVerbose} "Installing VirtualBox service ..."
    388391  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxService$\" $\"VirtualBox Guest Additions Service$\" 16 2 $\"%SystemRoot%\System32\VBoxService.exe$\" $\"Base$\"" "false"
     
    391394  WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxService" "Description" "Manages VM runtime information, time synchronization, remote sysprep execution and miscellaneous utilities for guest operating systems."
    392395
    393 sf:
    394 
     396
     397  ;
     398  ; Shared folders.
     399  ;
    395400  ${LogVerbose} "Installing Shared Folders service ..."
    396401
     
    413418  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add VBoxSF $g_iSfOrder" "false"
    414419
    415   Goto done
    416 
    417 done:
    418420
    419421  Pop $0
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette