Changeset 52265 in vbox
- Timestamp:
- Aug 4, 2014 1:50:42 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 95362
- Location:
- trunk/src/VBox/Installer/win
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
r51844 r52265 842 842 logStringW(hModule, L"CreateHostOnlyInterface: Creating host-only interface"); 843 843 844 HRESULT hr = VBoxNetCfgWinRemoveAllNetDevicesOfId(NETADP_ID); 845 if (FAILED(hr)) 846 { 847 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinRemoveAllNetDevicesOfId failed, error = 0x%x", hr); 848 bSetStaticIp = false; 849 } 844 HRESULT hr; 850 845 851 846 GUID guid; … … 890 885 if (SUCCEEDED(hr)) 891 886 { 892 logStringW(hModule, L"CreateHostOnlyInterface: calling VBoxNetCfgWinCreateHostOnlyNetworkInterface");893 hr = VBoxNetCfgWinCreateHostOnlyNetworkInterface(pwszInfPath, bIsFile, &guid, NULL, NULL);894 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinCreateHostOnlyNetworkInterface returns 0x%x", hr);887 //first, try to update Host Only Network Interface 888 BOOL fRebootRequired = FALSE; 889 hr = VBoxNetCfgWinUpdateHostOnlyNetworkInterface(pwszInfPath, &fRebootRequired); 895 890 if (SUCCEEDED(hr)) 896 891 { 897 ULONG ip = inet_addr("192.168.56.1");898 ULONG mask = inet_addr("255.255.255.0");899 logStringW(hModule, L"CreateHostOnlyInterface: calling VBoxNetCfgWinEnableStaticIpConfig");900 hr = VBoxNetCfgWinEnableStaticIpConfig(&guid, ip, mask);901 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinEnableStaticIpConfig returns 0x%x", hr);902 if (FAILED(hr))903 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinEnableStaticIpConfig failed, error = 0x%x", hr);892 if (fRebootRequired) 893 { 894 logStringW(hModule, L"UpdateHostOnlyInterfaces: Reboot required, setting REBOOT property to force"); 895 HRESULT hr2 = MsiSetPropertyW(hModule, L"REBOOT", L"Force"); 896 if (hr2 != ERROR_SUCCESS) 897 logStringW(hModule, L"UpdateHostOnlyInterfaces: Failed to set REBOOT property, error = 0x%x", hr2); 898 } 904 899 } 905 900 else 906 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinCreateHostOnlyNetworkInterface failed, error = 0x%x", hr); 901 logStringW(hModule, L"UpdateHostOnlyInterfaces: VBoxNetCfgWinUpdateHostOnlyNetworkInterface failed, hr = 0x%x", hr); 902 //in fail case call CreateHostOnlyInterface 903 if (FAILED(hr)) 904 { 905 logStringW(hModule, L"CreateHostOnlyInterface: calling VBoxNetCfgWinCreateHostOnlyNetworkInterface"); 906 hr = VBoxNetCfgWinCreateHostOnlyNetworkInterface(pwszInfPath, bIsFile, &guid, NULL, NULL); 907 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinCreateHostOnlyNetworkInterface returns 0x%x", hr); 908 if (SUCCEEDED(hr)) 909 { 910 ULONG ip = inet_addr("192.168.56.1"); 911 ULONG mask = inet_addr("255.255.255.0"); 912 logStringW(hModule, L"CreateHostOnlyInterface: calling VBoxNetCfgWinEnableStaticIpConfig"); 913 hr = VBoxNetCfgWinEnableStaticIpConfig(&guid, ip, mask); 914 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinEnableStaticIpConfig returns 0x%x", hr); 915 if (FAILED(hr)) 916 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinEnableStaticIpConfig failed, error = 0x%x", hr); 917 } 918 else 919 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinCreateHostOnlyNetworkInterface failed, error = 0x%x", hr); 920 } 907 921 } 908 922 -
trunk/src/VBox/Installer/win/VBoxMergeNetAdpSeq.wxi
r51876 r52265 35 35 <!-- Don't remove the host-only interfaces on update, only on uninstall --> 36 36 <Custom Action="ca_RemoveHostOnlyInterfaces" After="InstallInitialize" > 37 <![CDATA[ (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")]]>37 <![CDATA[NOT (UPGRADINGPRODUCTCODE) AND (Installed) AND (REMOVE="ALL")]]> 38 38 </Custom> 39 39 <!-- First stop the existing host-only interfaces on update ... --> 40 <Custom Action="ca_StopHostOnlyInterfaces" Before="ca_UpdateHostOnlyInterfaces" > 41 <![CDATA[UPGRADINGPRODUCTCODE]]> 42 </Custom> 43 <!-- ... then do the actual driver update --> 44 <Custom Action="ca_UpdateHostOnlyInterfacesArgs" Before="ca_UpdateHostOnlyInterfaces" > 45 <![CDATA[Installed AND UPGRADINGPRODUCTCODE AND (NOT REMOVE="ALL")]]> 46 </Custom> 47 <Custom Action="ca_UpdateHostOnlyInterfaces" Before="InstallFiles" > 48 <![CDATA[Installed AND UPGRADINGPRODUCTCODE AND (NOT REMOVE="ALL")]]> 40 <Custom Action="ca_StopHostOnlyInterfaces" After="InstallInitialize" > 41 <![CDATA[(UPGRADINGPRODUCTCODE) OR (REMOVE="ALL")]]> 49 42 </Custom> 50 43 <?endif ?>
Note:
See TracChangeset
for help on using the changeset viewer.