VirtualBox

Changeset 79406 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 28, 2019 10:43:24 AM (6 years ago)
Author:
vboxsync
Message:

HostDrivers/win/load.cmd: Put drivers in a different place when loading them so the build doesn't fail on windows 10 because the .sys file is kept open. Rewrote bourne shell stuff as CMD mess.

Location:
trunk/src/VBox/HostDrivers/win
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/win/load.cmd

    r76553 r79406  
    22rem $Id$
    33rem rem @file
    4 rem Windows NT batch script for launching load.sh
     4rem Windows NT batch script for loading the support driver.
    55rem
    66
     
    2828
    2929setlocal ENABLEEXTENSIONS
     30setlocal ENABLEDELAYEDEXPANSION
    3031setlocal
    3132
     33
    3234rem
    33 rem loadall.sh should be in the same directory as this script.
     35rem find the directory we're in.
    3436rem
    35 set MY_SCRIPT=%~dp0load.sh
    36 if exist "%MY_SCRIPT%" goto found
     37set MY_DIR=%~dp0
     38if exist "%MY_DIR%\load.cmd" goto dir_okay
    3739echo load.cmd: failed to find load.sh in "%~dp0".
    3840goto end
    3941
     42:dir_okay
    4043rem
    41 rem Found it, convert slashes and tell kmk_ash to interpret it.
     44rem We don't use the driver files directly any more because of win10 keeping the open,
     45rem so create an alternative directory for the binaries.
    4246rem
    43 :found
    44 set MY_SCRIPT=%MY_SCRIPT:\=/%
    45 set MY_ARGS=%*
    46 if ".%MY_ARGS%." NEQ ".." set MY_ARGS=%MY_ARGS:\=/%
    47 kmk_ash %MY_SCRIPT% %MY_ARGS%
     47set MY_ALTDIR=%MY_DIR%\..\LoadedDrivers
     48if not exist "%MY_ALTDIR%" mkdir "%MY_ALTDIR%"
     49
     50rem
     51rem Display device states.
     52rem
     53for %%i in (VBoxNetAdp VBoxNetAdp6 VBoxNetFlt VBoxNetLwf VBoxUSBMon VBoxUSB VBoxDrv) do (
     54    set type=
     55    for /f "usebackq tokens=*" %%f in (`sc query %%i`) do (set xxx=%%f&&if "!xxx:~0,5!" =="STATE" set type=!xxx!)
     56    for /f "usebackq tokens=2 delims=:" %%f in ('!type!') do set type=%%f
     57    if "!type!x" == "x" set type= not configured, probably
     58    echo load.sh: %%i -!type!
     59)
     60
     61rem
     62rem Copy uninstallers and installers and VBoxRT into the dir:
     63rem
     64echo **
     65echo ** Copying installers and uninstallers into %MY_ALTDIR%...
     66echo **
     67set MY_FAILED=no
     68for %%i in (NetAdpUninstall.exe NetAdp6Uninstall.exe USBUninstall.exe NetFltUninstall.exe NetLwfUninstall.exe SUPUninstall.exe ^
     69            NetAdpInstall.exe   NetAdp6Install.exe   USBInstall.exe   NetFltInstall.exe   NetLwfInstall.exe   SUPInstall.exe ^
     70            VBoxRT.dll) do if exist "%MY_DIR%\%%i" (copy "%MY_DIR%\%%i" "%MY_ALTDIR%\%%i" || set MY_FAILED=yes)
     71if "%MY_FAILED%" == "yes" goto end
     72
     73rem
     74rem Unload the drivers.
     75rem
     76echo **
     77echo ** Unloading drivers...
     78echo **
     79for %%i in (NetAdpUninstall.exe NetAdp6Uninstall.exe USBUninstall.exe NetFltUninstall.exe NetLwfUninstall.exe SUPUninstall.exe) do (
     80    if exist "%MY_ALTDIR%\%%i" (echo ** Running %%i...&& "%MY_ALTDIR%\%%i")
     81)
     82
     83rem
     84rem Copy the driver files into the directory now that they no longer should be in use and can be overwritten.
     85rem
     86echo **
     87echo ** Copying drivers into %MY_ALTDIR%...
     88echo **
     89set MY_FAILED=no
     90for %%i in (VBoxDrv.sys VBoxDrv.inf VBoxDrv.cat) do if exist "%MY_DIR%\%%i" (copy "%MY_DIR%\%%i" "%MY_ALTDIR%\%%i" || set MY_FAILED=yes)
     91if "%MY_FAILED%" == "yes" goto end
     92
     93rem
     94rem Invoke the installer if asked to do so.
     95rem
     96if "%1%" == "-u" goto end
     97if "%1%" == "--uninstall" goto end
     98echo **
     99echo ** Loading drivers...
     100echo **
     101for %%i in (SUPInstall.exe) do "%MY_ALTDIR%\%%i" || goto end
    48102
    49103:end
    50104endlocal
    51105endlocal
     106endlocal
    52107
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