VirtualBox

Changeset 39262 in vbox for trunk/src/VBox/Main/src-all/win


Ignore:
Timestamp:
Nov 10, 2011 12:18:16 PM (13 years ago)
Author:
vboxsync
Message:

comregister.cmd: Try make sure the right stuff is registered and that the PATH does not interfer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/win/comregister.cmd

    r35376 r39262  
     1@echo off
     2REM $Id$
     3REM
     4REM Script to register the VirtualBox COM classes
     5REM (both inproc and out-of-process)
     6REM
     7
     8REM
     9REM Copyright (C) 2006-2011 Oracle Corporation
     10REM
     11REM This file is part of VirtualBox Open Source Edition (OSE), as
     12REM available from http://www.virtualbox.org. This file is free software;
     13REM you can redistribute it and/or modify it under the terms of the GNU
     14REM General Public License (GPL) as published by the Free Software
     15REM Foundation, in version 2 as it comes in the "COPYING" file of the
     16REM VirtualBox OSE distribution. VirtualBox OSE is distributed in the
     17REM hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     18REM
     19
     20setlocal
     21
     22REM
     23REM Figure out where the script lives first, so that we can invoke the
     24REM correct VBoxSVC and register the right VBoxC.dll.
     25REM
     26
     27REM Determin the current directory.
     28set _SCRIPT_CURDIR=%CD%
     29for /f "tokens=*" %%d in ('cd') do set _SCRIPT_CURDIR=%%d
     30
     31REM Determin a correct self - by %0.
     32set _SCRIPT_SELF=%0
     33if exist "%_SCRIPT_SELF%" goto found_self
     34set _SCRIPT_SELF=%_SCRIPT_SELF%.cmd
     35if exist "%_SCRIPT_SELF%" goto found_self
     36
     37REM Determin a correct self - by current working directory.
     38set _SCRIPT_SELF=%_SCRIPT_CURDIR%\comregister.cmd
     39if exist "%_SCRIPT_SELF%" goto found_self
     40
     41REM Determin a correct self - by the PATH
     42REM This is very verbose because nested for loops didn't work out.
     43for /f "tokens=1  delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     44if exist "%_SCRIPT_SELF%" goto found_self
     45for /f "tokens=2  delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     46if exist "%_SCRIPT_SELF%" goto found_self
     47for /f "tokens=3  delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     48if exist "%_SCRIPT_SELF%" goto found_self
     49for /f "tokens=4  delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     50if exist "%_SCRIPT_SELF%" goto found_self
     51for /f "tokens=5  delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     52if exist "%_SCRIPT_SELF%" goto found_self
     53for /f "tokens=6  delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     54if exist "%_SCRIPT_SELF%" goto found_self
     55for /f "tokens=7  delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     56if exist "%_SCRIPT_SELF%" goto found_self
     57for /f "tokens=8  delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     58if exist "%_SCRIPT_SELF%" goto found_self
     59for /f "tokens=9  delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     60if exist "%_SCRIPT_SELF%" goto found_self
     61for /f "tokens=10 delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     62if exist "%_SCRIPT_SELF%" goto found_self
     63for /f "tokens=11 delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     64if exist "%_SCRIPT_SELF%" goto found_self
     65for /f "tokens=12 delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     66if exist "%_SCRIPT_SELF%" goto found_self
     67for /f "tokens=13 delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     68if exist "%_SCRIPT_SELF%" goto found_self
     69for /f "tokens=14 delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     70if exist "%_SCRIPT_SELF%" goto found_self
     71for /f "tokens=15 delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     72if exist "%_SCRIPT_SELF%" goto found_self
     73for /f "tokens=16 delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     74if exist "%_SCRIPT_SELF%" goto found_self
     75for /f "tokens=17 delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     76if exist "%_SCRIPT_SELF%" goto found_self
     77for /f "tokens=18 delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     78if exist "%_SCRIPT_SELF%" goto found_self
     79for /f "tokens=19 delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     80if exist "%_SCRIPT_SELF%" goto found_self
     81for /f "tokens=20 delims=;" %%d in ("%PATH%") do set _SCRIPT_SELF=%%d\comregister.cmd
     82if exist "%_SCRIPT_SELF%" goto found_self
     83echo Warning: Not able to determin the comregister.cmd location.
     84set _VBOX_DIR=
     85goto register
     86
     87:found_self
     88set _VBOX_DIR=
     89cd "%_SCRIPT_SELF%\.."
     90for /f "tokens=*" %%d in ('cd') do set _VBOX_DIR=%%d\
     91cd "%_SCRIPT_CURDIR%"
     92
     93
     94REM
     95REM Do the registrations.
     96REM
     97:register
     98@echo on
     99%_VBOX_DIR%VBoxSVC.exe /ReregServer
     100regsvr32 /s /u %_VBOX_DIR%VBoxC.dll
     101regsvr32 /s    %_VBOX_DIR%VBoxC.dll
    1102@echo off
    2103
    3 REM /*
    4 REM  * Script to register the VirtualBox COM classes
    5 REM  * (both inproc and out-of-process)
    6 REM  */
     104:end
     105endlocal
    7106
    8 REM /*
    9 REM  Copyright (C) 2006-2007 Oracle Corporation
    10 REM
    11 REM  This file is part of VirtualBox Open Source Edition (OSE), as
    12 REM  available from http://www.virtualbox.org. This file is free software;
    13 REM  you can redistribute it and/or modify it under the terms of the GNU
    14 REM  General Public License (GPL) as published by the Free Software
    15 REM  Foundation, in version 2 as it comes in the "COPYING" file of the
    16 REM  VirtualBox OSE distribution. VirtualBox OSE is distributed in the
    17 REM  hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    18 REM
    19 REM  */
    20 
    21 
    22 VBoxSVC.exe /ReregServer
    23 
    24 regsvr32 /s /u VBoxC.dll
    25 regsvr32 /s VBoxC.dll
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