VirtualBox

Changeset 44459 in vbox for trunk/src/VBox/Additions/WINNT


Ignore:
Timestamp:
Jan 30, 2013 11:23:57 AM (12 years ago)
Author:
vboxsync
Message:

Windows Guest Additions installer: Invoke external calls via own function to also log stdout/stderr output into installer log files.

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

Legend:

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

    r44420 r44459  
    241241; Platform parts of this installer
    242242!include "VBoxGuestAdditionsLog.nsh"
     243!include "VBoxGuestAdditionsExternal.nsh"
    243244!include "VBoxGuestAdditionsCommon.nsh"
    244245!if $%BUILD_TARGET_ARCH% == "x86"       ; 32-bit only
     
    757758
    758759  ${If} ${FileExists} "$g_strSystemDir\takeown.exe"
    759     nsExec::ExecToLog '"$g_strSystemDir\takeown.exe" /F "$0"'
    760     Pop $1 ; Ret value
    761     ${LogVerbose} "WRP: Taking ownership for $0 returned: $1"
     760    ${CmdExecute} "$\"$g_strSystemDir\takeown.exe$\" /F $\"$0$\"" "true"
    762761  ${Else}
    763762    ${LogVerbose} "WRP: Warning: takeown.exe not found, skipping"
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh

    r44352 r44459  
    483483Function ${un}AbortShutdown
    484484
    485   Push $0
    486 
    487   ; Try to abort the shutdown
    488   nsExec::ExecToLog '"$g_strSystemDir\shutdown.exe" -a' $0
    489 
    490   Pop $0
     485  ${If} ${FileExists} "$g_strSystemDir\shutdown.exe"
     486    ; Try to abort the shutdown
     487    ${CmdExecute} "$\"$g_strSystemDir\shutdown.exe$\" -a" "true"
     488  ${Else}
     489    ${LogVerbose} "Shutting down not supported: Binary $\"$g_strSystemDir\shutdown.exe$\" not found"
     490  ${EndIf}
    491491
    492492FunctionEnd
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsNT4.nsh

    r44417 r44459  
    140140
    141141  ; Install guest driver
    142   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service create "VBoxGuest" "VBoxGuest Support Driver" 1 1 "$SYSDIR\drivers\VBoxGuestNT.sys" "Base"'
     142  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxGuest$\" $\"VBoxGuest Support Driver$\" 1 1 $\"$SYSDIR\drivers\VBoxGuestNT.sys$\" $\"Base$\"" "false"
    143143
    144144  ; Bugfix: Set "Start" to 1, otherwise, VBoxGuest won't start on boot-up!
     
    151151
    152152  ; Video driver
    153   nsExec::ExecToLog '"$INSTDIR\VBoxGuestDrvInst.exe" /i'
    154   Pop $0                      ; Ret value
    155   IntCmp $0 0 +1 error error  ; Check ret value (0=OK, 1=Error)
     153  ${CmdExecute} "$\"$INSTDIR\VBoxGuestDrvInst.exe$\" /i" "false"
    156154
    157155  ${LogVerbose} "Installing VirtualBox service ..."
     
    159157  ; Create the VBoxService service
    160158  ; No need to stop/remove the service here! Do this only on uninstallation!
    161   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service create "VBoxService" "VirtualBox Guest Additions Service" 16 2 "system32\VBoxServiceNT.exe" "Base"'
     159  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxService$\" $\"VirtualBox Guest Additions Service$\" 16 2 $\"system32\VBoxServiceNT.exe$\" $\"Base$\"" "false"
    162160
    163161   ; Create the Shared Folders service ...
     
    177175
    178176  ; Add the shared folders network provider
    179   ;nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add VBoxSF'
    180   ;Pop $0                      ; Ret value
    181   ;IntCmp $0 0 +1 error error  ; Check ret value (0=OK, 1=Error)
     177  ;${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add VBoxSF" "false"
    182178
    183179  Goto done
     
    227223
    228224  ; Remove the guest driver service
    229   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxGuest'
     225  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxGuest" "true"
    230226  Delete /REBOOTOK "$SYSDIR\drivers\VBoxGuestNT.sys"
    231227
    232228  ; Delete the VBoxService service
    233229  Call ${un}StopVBoxService
    234   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxService'
    235   Pop $0    ; Ret value
     230  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxService" "true"
    236231  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
    237232  Delete /REBOOTOK "$SYSDIR\VBoxServiceNT.exe"
     
    248243
    249244  ; Delete the VBoxVideo service
    250   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxVideo'
     245  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideo" "true"
    251246
    252247  ; Delete the VBox video driver files
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh

    r44417 r44459  
    129129
    130130  ; Write the new value in the adapter config (VBoxVideo.sys) using hex values in binary format
    131   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD'
    132   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD'
    133   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD'
     131  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD" "false"
     132  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD" "false"
     133  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD" "false"
    134134
    135135  ; ... and tell Windows to use that mode on next start!
     
    338338
    339339  ${LogVerbose} "Turning off WHQL protection..."
    340   nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "ignore"'
     340  ${CmdExecute} "$\"$INSTDIR\VBoxWHQLFake.exe$\" $\"ignore$\"" "true"
    341341
    342342exit:
     
    352352
    353353  ${LogVerbose} "Turning back on WHQL protection..."
    354   nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "warn"'
     354  ${CmdExecute} "$\"$INSTDIR\VBoxWHQLFake.exe$\" $\"warn$\"" "true"
    355355
    356356exit:
     
    384384  ${If} $g_bNoGuestDrv == "false"
    385385    ${LogVerbose} "Installing guest driver ..."
    386     nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxGuest.inf" "$INSTDIR\install_drivers.log"'
    387     Pop $0 ; Ret value
    388     ${LogVerbose} "Guest driver returned: $0"
    389     IntCmp $0 0 +1 error error  ; Check ret value (0=OK, 1=Error)
     386    ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxGuest.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
    390387  ${Else}
    391388    ${LogVerbose} "Guest driver installation skipped!"
     
    397394      ${If} $g_strWinVersion == "8"
    398395        ${LogVerbose} "Installing WDDM video driver for Windows 8..."
    399         nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideoW8.inf" "$INSTDIR\install_drivers.log"'
     396        ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxVideoW8.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
    400397      ${Else}
    401398  !endif
    402399        ${LogVerbose} "Installing WDDM video driver for Windows Vista and 7..."
    403         nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideoWddm.inf" "$INSTDIR\install_drivers.log"'
     400        ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxVideoWddm.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
    404401  !if $%VBOX_WITH_WDDM_W8% == "1"
    405402      ${EndIf}
     
    407404    ${Else}
    408405      ${LogVerbose} "Installing video driver ..."
    409       nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideo.inf" "$INSTDIR\install_drivers.log"'
     406      ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxVideo.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
    410407    ${EndIf}
    411     Pop $0 ; Ret value
    412     ${LogVerbose} "Video driver returned: $0"
    413     IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error)
    414408  ${Else}
    415409    ${LogVerbose} "Video driver installation skipped!"
     
    421415    ; so this .INF file needs to be installed using "InstallHinfSection" which is implemented
    422416    ; with VBoxDrvInst's "driver executeinf" routine
    423     nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver executeinf "$INSTDIR\VBoxMouse.inf"'
    424     Pop $0  ; Ret value
    425     ${LogVerbose} "Mouse driver returned: $0"
    426     IntCmp $0 0 +1 error error  ; Check ret value (0=OK, 1=Error)
     417    ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver executeinf $\"$INSTDIR\VBoxMouse.inf$\"" "false"
    427418  ${Else}
    428419    ${LogVerbose} "Mouse driver installation skipped!"
     
    432423  ; No need to stop/remove the service here! Do this only on uninstallation!
    433424  ${LogVerbose} "Installing VirtualBox service ..."
    434   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service create "VBoxService" "VirtualBox Guest Additions Service" 16 2 "system32\VBoxService.exe" "Base"'
    435   Pop $0 ; Ret value
    436   ${LogVerbose} "VBoxService returned: $0"
     425  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxService$\" $\"VirtualBox Guest Additions Service$\" 16 2 $\"system32\VBoxService.exe$\" $\"Base$\"" "false"
    437426
    438427  ; Set service description
     
    445434  ; Create the Shared Folders service ...
    446435  ; No need to stop/remove the service here! Do this only on uninstallation!
    447   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service create "VBoxSF" "VirtualBox Shared Folders" 2 1 "system32\drivers\VBoxSF.sys" "NetworkProvider"'
     436  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxSF$\" $\"VirtualBox Shared Folders$\" 2 1 $\"system32\drivers\VBoxSF.sys$\" $\"NetworkProvider$\"" "false"
    448437
    449438  ; ... and the link to the network provider
     
    453442
    454443  ; Add default network providers (if not present or corrupted)
    455   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add WebClient'
    456   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add LanmanWorkstation'
    457   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add RDPNP'
     444  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add WebClient" "false"
     445  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add LanmanWorkstation" "false"
     446  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add RDPNP" "false"
    458447
    459448  ; Add the shared folders network provider
    460449  ${LogVerbose} "Adding network provider (Order = $g_iSfOrder) ..."
    461   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add VBoxSF $g_iSfOrder'
    462   Pop $0 ; Ret value
    463   IntCmp $0 0 +1 error error  ; Check ret value (0=OK, 1=Error)
     450  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add VBoxSF $g_iSfOrder" "false"
    464451
    465452!if $%VBOX_WITH_CROGL% == "1"
     
    492479  Goto done
    493480
    494 error:
    495 
    496   Abort "ERROR: Could not install files for Windows 2000 / XP / Vista! Installation aborted."
    497 
    498481done:
    499482
     
    607590  ; Remove VirtualBox video driver
    608591  ${LogVerbose} "Uninstalling video driver ..."
    609   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver uninstall "$INSTDIR\VBoxVideo.inf'
    610   Pop $0 ; Ret value
    611   ; @todo Add error handling here!
    612   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxVideo'
     592  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideo.inf$\"" "true"
     593  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideo" "true"
    613594  Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys"
    614595  Delete /REBOOTOK "$g_strSystemDir\VBoxDisp.dll"
     
    619600  !if $%VBOX_WITH_WDDM_W8% == "1"
    620601  ${LogVerbose} "Uninstalling WDDM video driver for Windows 8..."
    621   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver uninstall "$INSTDIR\VBoxVideoW8.inf"'
    622   Pop $0 ; Ret value
    623   ; Always try to remove both VBoxVideoW8 & VBoxVideoWddm services no matter what is installed currently
    624   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxVideoW8'
    625   Pop $0 ; Ret value
     602  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoW8.inf$\"" "true"
     603  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoW8" "true"
    626604  ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
    627605  ;       could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
     
    630608
    631609  ${LogVerbose} "Uninstalling WDDM video driver for Windows Vista and 7..."
    632   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver uninstall "$INSTDIR\VBoxVideoWddm.inf"'
    633   Pop $0 ; Ret value
     610  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoWddm.inf$\"" "true"
    634611  ; Always try to remove both VBoxVideoWddm & VBoxVideo services no matter what is installed currently
    635   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxVideoWddm'
    636   Pop $0 ; Ret value
     612  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoWddm" "true"
    637613  ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
    638614  ;       could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
     
    732708  ; Remove mouse driver
    733709  ${LogVerbose} "Removing mouse driver ..."
    734   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxMouse'
    735   Pop $0 ; Ret value
     710  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxMouse" "true"
    736711  Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxMouse.sys"
    737   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry delmultisz "SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}" "UpperFilters" "VBoxMouse"'
    738   Pop $0 ; Ret value
    739   ; @todo Add error handling here!
     712  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry delmultisz $\"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}$\" $\"UpperFilters$\" $\"VBoxMouse$\"" "true"
    740713
    741714  ; Delete the VBoxService service
    742715  Call ${un}StopVBoxService
    743   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxService'
    744   Pop $0 ; Ret value
     716  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxService" "true"
    745717  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
    746718  Delete /REBOOTOK "$g_strSystemDir\VBoxService.exe"
     
    761733  ; Remove guest driver
    762734  ${LogVerbose} "Removing guest driver ..."
    763   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver uninstall "$INSTDIR\VBoxGuest.inf"'
    764   Pop $0 ; Ret value
    765   ; @todo Add error handling here!
    766 
    767   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxGuest'
    768   Pop $0 ; Ret value
     735  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxGuest.inf$\"" "true"
     736
     737  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxGuest" "true"
    769738  Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxGuest.sys"
    770739  Delete /REBOOTOK "$g_strSystemDir\VBCoInst.dll" ; Deprecated, does not get installed anymore
     
    776745  ; Remove shared folders driver
    777746  ${LogVerbose} "Removing shared folders driver ..."
    778   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider remove VBoxSF'
    779   Pop $0 ; Ret value
    780   nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxSF'
    781   Pop $0 ; Ret value
     747  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider remove VBoxSF" "true"
     748  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxSF" "true"
    782749  Delete /REBOOTOK "$g_strSystemDir\VBoxMRXNP.dll" ; The network provider DLL will be locked
    783750  !if $%BUILD_TARGET_ARCH% == "amd64"
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