VirtualBox

vbox的更動 96687 路徑 trunk/src/VBox/Additions/WINNT


忽略:
時間撮記:
2022-9-11 上午12:34:46 (2 年 以前)
作者:
vboxsync
訊息:

Add/Nt/Installer: Changed the 2nd parameter of ${CmdExecute} from a 'true/false' to a more explicit 'non-zero-exitcode=log/abort' to make it explicitly clear what's going to happen on failure. Always save the install_ui.log. bugref:10261

位置:
trunk/src/VBox/Additions/WINNT/Installer
檔案:
修改 5 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi

    r96686 r96687  
    862862  ${LogVerbose} "Installation completed."
    863863
     864  ;
     865  ; Dump UI log to on success too. Only works with non-silent installs.
     866  ; (This has to be done here rather than in .onInstSuccess, because by
     867  ; then the log is no longer visible in the UI.)
     868  ;
     869  ${IfNot} ${Silent}
     870    StrCpy $0 "$INSTDIR\install_ui.log"
     871    Push $0
     872    Call DumpLog
     873  ${EndIf}
     874
    864875SectionEnd
    865876
     877;;
    866878; !!! NOTE: This function *has* to be right under the last section; otherwise it does
    867879;           *not* get called! Don't ask me why ... !!!
     
    896908FunctionEnd
    897909
     910;;
    898911; This function is called when a critical error occurred, caused by
    899912; the Abort command
     913;
    900914Function .onInstFailed
    901915
     
    907921  ${EndIf}
    908922
    909   ; Dump UI log to see what happend.
    910   ; Only works with non-silent installs.
    911   IfSilent +4 +1
     923  ; Dump UI log to see what happend. Only works with non-silent installs.
     924  ${IfNot} ${Silent}
    912925    StrCpy $0 "$INSTDIR\install_ui.log"
    913926    Push $0
    914927    Call DumpLog
     928  ${EndIf}
    915929
    916930  ; Set overall exit code
     
    919933FunctionEnd
    920934
     935;;
    921936; This function is called when installation was successful!
     937;
    922938Function .onInstSuccess
    923939
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh

    r96686 r96687  
    468468  ${If} ${FileExists} "$g_strSystemDir\shutdown.exe"
    469469    ; Try to abort the shutdown
    470     ${CmdExecute} "$\"$g_strSystemDir\shutdown.exe$\" -a" "true"
     470    ${CmdExecute} "$\"$g_strSystemDir\shutdown.exe$\" -a" 'non-zero-exitcode=log'
    471471  ${Else}
    472472    ${LogVerbose} "Shutting down not supported: Binary $\"$g_strSystemDir\shutdown.exe$\" not found"
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsExternal.nsh

    r96686 r96687  
    3333; code other than 0 the installer will be aborted.
    3434;
    35 ; @param   Command line (full qualified and quoted).
    36 ; @param   If set to "false" the installer aborts if the external program reports
    37 ;          an exit code other than 0, "true" just prints a warning and continues
    38 ;          execution.
     35; @param   ${cmdline}   Command line (full qualified and quoted).
     36; @param   ${options}   Either 'non-zero-exitcode=log' or 'non-zero-exitcode=abort'.
     37;                       Controls how to handle non-zero exit codes, in the latter
     38;                       case they will trigger an installation abort, while in the
     39;                       form only a warning in the log file.
    3940;
    40 !macro _cmdExecute cmdline optional
     41!macro _cmdExecute cmdline options
    4142  ; Save $0 & $1
    4243  Push $0
    4344  Push $1
     45
     46  ; Check that the options are valid.
     47  ${IfNot}    ${options} != "exitcode=0"
     48  ${AndIfNot} ${options} != "ignore-exitcode"
     49    Abort "Internal error in _cmdExecute: options=${options} cmdline=${cmdline}"
     50  ${EndIf}
    4451
    4552  ;
     
    6370  ;
    6471  ${If} $0 <> 0
    65     ${If} ${optional} == "false"
     72    ${If} ${options} == "exitcode=0"
    6673      ${LogVerbose} "Error excuting $\"${cmdline}$\" (exit code: $0) -- aborting installation"
    6774      Abort "Error excuting $\"${cmdline}$\" (exit code: $0) -- aborting installation"
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsNT4.nsh

    r96605 r96687  
    162162
    163163  ; Install guest driver
    164   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxGuest$\" $\"VBoxGuest Support Driver$\" 1 1 $\"$SYSDIR\drivers\VBoxGuest.sys$\" $\"Base$\"" "false"
     164  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxGuest$\" $\"VBoxGuest Support Driver$\" 1 1 $\"$SYSDIR\drivers\VBoxGuest.sys$\" $\"Base$\"" 'non-zero-exitcode=abort'
    165165
    166166  ; Bugfix: Set "Start" to 1, otherwise, VBoxGuest won't start on boot-up!
     
    173173
    174174  ; Video driver
    175   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver nt4-install-video" "false"
     175  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver nt4-install-video" 'non-zero-exitcode=abort'
    176176
    177177  ; Create the VBoxService service
    178178  ; No need to stop/remove the service here! Do this only on uninstallation!
    179179  ${LogVerbose} "Installing VirtualBox service ..."
    180   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxService$\" $\"VirtualBox Guest Additions Service$\" 16 2 $\"%SystemRoot%\system32\VBoxService.exe$\" $\"Base$\"" "false"
     180  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxService$\" $\"VirtualBox Guest Additions Service$\" 16 2 $\"%SystemRoot%\system32\VBoxService.exe$\" $\"Base$\"" 'non-zero-exitcode=abort'
    181181
    182182   ; Create the Shared Folders service ...
     
    196196
    197197  ; Add the shared folders network provider
    198   ;${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add VBoxSF" "false"
     198  ;${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add VBoxSF" 'non-zero-exitcode=abort'
    199199
    200200  Goto done
     
    244244
    245245  ; Remove the guest driver service
    246   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxGuest" "true"
     246  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxGuest" 'non-zero-exitcode=log'
    247247  Delete /REBOOTOK "$SYSDIR\drivers\VBoxGuest.sys"
    248248
    249249  ; Delete the VBoxService service
    250250  Call ${un}StopVBoxService
    251   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxService" "true"
     251  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxService" 'non-zero-exitcode=log'
    252252  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
    253253  Delete /REBOOTOK "$SYSDIR\VBoxService.exe"
     
    264264
    265265  ; Delete the VBoxVideo service
    266   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideo" "true"
     266  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideo" 'non-zero-exitcode=log'
    267267
    268268  ; Delete the VBox video driver files
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh

    r96686 r96687  
    141141
    142142  ; Write the new value in the adapter config (VBoxVideo.sys) using hex values in binary format
    143   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD" "false"
    144   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD" "false"
    145   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD" "false"
     143  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD"  'non-zero-exitcode=abort'
     144  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD"  'non-zero-exitcode=abort'
     145  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD" 'non-zero-exitcode=abort'
    146146
    147147  ; ... and tell Windows to use that mode on next start!
     
    198198    FILE "$%PATH_OUT%\bin\additions\vbox-legacy-timestamp-ca.cer"
    199199    FILE "$%PATH_OUT%\bin\additions\VBoxCertUtil.exe"
    200     ${CmdExecute} "$\"$INSTDIR\cert\VBoxCertUtil.exe$\" add-trusted-publisher --root $\"$INSTDIR\cert\vbox-legacy-timestamp-ca.cer$\"" "true"
    201     ${CmdExecute} "$\"$INSTDIR\cert\VBoxCertUtil.exe$\" display-all" "true"
     200    ${CmdExecute} "$\"$INSTDIR\cert\VBoxCertUtil.exe$\" add-trusted-publisher --root $\"$INSTDIR\cert\vbox-legacy-timestamp-ca.cer$\"" 'non-zero-exitcode=log'
     201    ${CmdExecute} "$\"$INSTDIR\cert\VBoxCertUtil.exe$\" display-all" 'non-zero-exitcode=log'
    202202  ${EndIf}
    203203!endif
     
    354354  ${If} $g_bNoGuestDrv == "false"
    355355    ${LogVerbose} "Installing guest driver ..."
    356     ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxGuest.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
     356    ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxGuest.inf$\" $\"$INSTDIR\install_drivers.log$\"" 'non-zero-exitcode=abort'
    357357  ${Else}
    358358    ${LogVerbose} "Guest driver installation skipped!"
     
    362362    ${If} $g_bWithWDDM == "true"
    363363      ${LogVerbose} "Installing WDDM video driver..."
    364       ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxWddm.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
     364      ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxWddm.inf$\" $\"$INSTDIR\install_drivers.log$\"" 'non-zero-exitcode=abort'
    365365    ${Else}
    366366      ${LogVerbose} "Installing video driver ..."
    367       ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxVideo.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false"
     367      ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxVideo.inf$\" $\"$INSTDIR\install_drivers.log$\"" 'non-zero-exitcode=abort'
    368368    ${EndIf}
    369369  ${Else}
     
    379379    ; so this .INF file needs to be installed using "InstallHinfSection" which is implemented
    380380    ; with VBoxDrvInst's "driver executeinf" routine
    381     ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxMouse.inf$\"" "false"
     381    ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxMouse.inf$\"" 'non-zero-exitcode=abort'
    382382  ${Else}
    383383    ${LogVerbose} "Mouse driver installation skipped!"
     
    389389  ;
    390390  ${LogVerbose} "Installing VirtualBox service ..."
    391   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxService$\" $\"VirtualBox Guest Additions Service$\" 16 2 $\"%SystemRoot%\System32\VBoxService.exe$\" $\"Base$\"" "false"
     391  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxService$\" $\"VirtualBox Guest Additions Service$\" 16 2 $\"%SystemRoot%\System32\VBoxService.exe$\" $\"Base$\"" 'non-zero-exitcode=abort'
    392392
    393393  ; Set service description
     
    402402  ; Create the Shared Folders service ...
    403403  ; No need to stop/remove the service here! Do this only on uninstallation!
    404   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxSF$\" $\"VirtualBox Shared Folders$\" 2 1 $\"\SystemRoot\System32\drivers\VBoxSF.sys$\" $\"NetworkProvider$\"" "false"
     404  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxSF$\" $\"VirtualBox Shared Folders$\" 2 1 $\"\SystemRoot\System32\drivers\VBoxSF.sys$\" $\"NetworkProvider$\"" 'non-zero-exitcode=abort'
    405405
    406406  ; ... and the link to the network provider
     
    410410
    411411  ; Add default network providers (if not present or corrupted)
    412   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add WebClient" "false"
    413   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add LanmanWorkstation" "false"
    414   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add RDPNP" "false"
     412  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add WebClient"         'non-zero-exitcode=abort'
     413  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add LanmanWorkstation" 'non-zero-exitcode=abort'
     414  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add RDPNP"             'non-zero-exitcode=abort'
    415415
    416416  ; Add the shared folders network provider
    417417  ${LogVerbose} "Adding network provider (Order = $g_iSfOrder) ..."
    418   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add VBoxSF $g_iSfOrder" "false"
     418  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add VBoxSF $g_iSfOrder" 'non-zero-exitcode=abort'
    419419
    420420
     
    518518  ; Remove VirtualBox video driver
    519519  ${LogVerbose} "Uninstalling video driver ..."
    520   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideo.inf$\"" "true"
    521   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideo" "true"
     520  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideo.inf$\"" 'non-zero-exitcode=log'
     521  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideo" 'non-zero-exitcode=log'
    522522  Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys"
    523523  Delete /REBOOTOK "$g_strSystemDir\VBoxDisp.dll"
     
    527527
    528528  ${LogVerbose} "Uninstalling WDDM video driver..."
    529   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxWddm.inf$\"" "true"
    530   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxWddm" "true"
     529  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxWddm.inf$\"" 'non-zero-exitcode=log'
     530  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxWddm" 'non-zero-exitcode=log'
    531531  ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
    532532  ;       could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
     
    535535  ; Obsolete files begin
    536536  ${LogVerbose} "Uninstalling WDDM video driver for Windows 8..."
    537   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoW8.inf$\"" "true"
    538   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoW8" "true"
     537  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoW8.inf$\"" 'non-zero-exitcode=log'
     538  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoW8" 'non-zero-exitcode=log'
    539539  ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
    540540  ;       could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
     
    542542
    543543  ${LogVerbose} "Uninstalling WDDM video driver for Windows Vista and 7..."
    544   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoWddm.inf$\"" "true"
     544  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoWddm.inf$\"" 'non-zero-exitcode=log'
    545545  ; Always try to remove both VBoxVideoWddm & VBoxVideo services no matter what is installed currently
    546   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoWddm" "true"
     546  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoWddm" 'non-zero-exitcode=log'
    547547  ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall
    548548  ;       could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled
     
    579579  ; Remove mouse driver
    580580  ${LogVerbose} "Removing mouse driver ..."
    581   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxMouse" "true"
     581  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxMouse" 'non-zero-exitcode=log'
    582582  Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxMouse.sys"
    583   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry delmultisz $\"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}$\" $\"UpperFilters$\" $\"VBoxMouse$\"" "true"
     583  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry delmultisz $\"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}$\" $\"UpperFilters$\" $\"VBoxMouse$\"" 'non-zero-exitcode=log'
    584584
    585585  ; Delete the VBoxService service
    586586  Call ${un}StopVBoxService
    587   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxService" "true"
     587  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxService" 'non-zero-exitcode=log'
    588588  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService"
    589589  Delete /REBOOTOK "$g_strSystemDir\VBoxService.exe"
     
    604604  ; Remove guest driver
    605605  ${LogVerbose} "Removing guest driver ..."
    606   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxGuest.inf$\"" "true"
    607 
    608   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxGuest" "true"
     606  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxGuest.inf$\"" 'non-zero-exitcode=log'
     607
     608  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxGuest" 'non-zero-exitcode=log'
    609609  Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxGuest.sys"
    610610  Delete /REBOOTOK "$g_strSystemDir\VBCoInst.dll" ; Deprecated, does not get installed anymore
     
    616616  ; Remove shared folders driver
    617617  ${LogVerbose} "Removing shared folders driver ..."
    618   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider remove VBoxSF" "true"
    619   ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxSF" "true"
     618  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider remove VBoxSF" 'non-zero-exitcode=log'
     619  ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxSF" 'non-zero-exitcode=log'
    620620  Delete /REBOOTOK "$g_strSystemDir\VBoxMRXNP.dll" ; The network provider DLL will be locked
    621621  !if $%KBUILD_TARGET_ARCH% == "amd64"
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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