VirtualBox

Changeset 40995 in vbox for trunk/src/VBox/Installer


Ignore:
Timestamp:
Apr 19, 2012 5:36:57 PM (13 years ago)
Author:
vboxsync
Message:

installer/win: add netadp disable/update code (not invoked properly)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp

    r39003 r40995  
    967967    logStringW(hModule, L"StopHostOnlyInterfaces: Stopping all host-only Interfaces");
    968968
    969     /** TODO */
     969    BOOL bSetupModeInteractive = SetupSetNonInteractiveMode(FALSE);
     970
     971    HRESULT hr = VBoxNetCfgWinPropChangeAllNetDevicesOfId(NETADP_ID, VBOXNECTFGWINPROPCHANGE_TYPE_DISABLE);
     972    if (SUCCEEDED(hr))
     973    {
     974        hr = VBoxDrvCfgInfUninstallAllSetupDi(&GUID_DEVCLASS_NET, NETADP_ID, L"Net", 0/* could be SUOI_FORCEDELETE */);
     975        if (FAILED(hr))
     976        {
     977            logStringW(hModule, L"RemoveHostOnlyInterfaces: VBoxDrvCfgInfUninstallAllSetupDi failed hr = 0x%x\n", hr);
     978        }
     979    }
     980    else
     981        logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstall failed, hr = 0x%x\n", hr);
     982
     983    /* Restore original setup mode. */
     984    if (bSetupModeInteractive)
     985        SetupSetNonInteractiveMode(bSetupModeInteractive);
    970986
    971987    netCfgLoggerDisable();
     
    982998
    983999    logStringW(hModule, L"UpdateHostOnlyInterfaces: Updating all host-only Interfaces");
     1000
     1001    BOOL bSetupModeInteractive = SetupSetNonInteractiveMode(FALSE);
    9841002
    9851003    WCHAR wszMpInf[MAX_PATH];
     
    10041022
    10051023            logStringW(hModule, L"UpdateHostOnlyInterfaces: Resulting INF path = %s", pwszInfPath);
     1024
     1025            BOOL fRebootRequired = FALSE;
     1026            HRESULT hr = VBoxNetCfgWinUpdateHostOnlyNetworkInterface(pwszInfPath, &fRebootRequired);
     1027            if (SUCCEEDED(hr))
     1028            {
     1029                if (fRebootRequired)
     1030                {
     1031                    logStringW(hModule, L"Reboot required, setting REBOOT property to Force");
     1032                    HRESULT hr2 = MsiSetPropertyW(hModule, L"REBOOT", L"Force");
     1033                    if (hr2 != ERROR_SUCCESS)
     1034                        logStringW(hModule, L"Failed to set REBOOT property, error = 0x%x", hr2);
     1035                }
     1036            }
     1037            else
     1038                logStringW(hModule, L"UpdateHostOnlyInterfaces: VBoxNetCfgWinUpdateHostOnlyNetworkInterface failed, hr = 0x%x", hr);
    10061039        }
    10071040        else
     
    10111044        logStringW(hModule, L"UpdateHostOnlyInterfaces: Failed to get NetAdpDir property, error = 0x%x", uErr);
    10121045
    1013     /** TODO */
     1046    /* Restore original setup mode. */
     1047    if (bSetupModeInteractive)
     1048        SetupSetNonInteractiveMode(bSetupModeInteractive);
    10141049
    10151050    netCfgLoggerDisable();
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