Changeset 103889 in vbox for trunk/src/VBox/Installer/win/InstallHelper
- Timestamp:
- Mar 18, 2024 11:46:55 AM (11 months ago)
- Location:
- trunk/src/VBox/Installer/win/InstallHelper
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/win/InstallHelper/Makefile.kmk
r98429 r103889 34 34 VBoxInstallHelper_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) 35 35 VBoxInstallHelper_DEFS = _WIN32_WINNT=0x0501 _UNICODE UNICODE VBOX_SVN_REV=$(VBOX_SVN_REV) 36 if def VBOX_WITH_NETFLT36 if defined(VBOX_WITH_NETFLT) || defined(VBOX_WITH_NETADP) 37 37 VBoxInstallHelper_SDKS += VBoxWinNewDevLib 38 VBoxInstallHelper_DEFS += VBOX_WITH_NETFLT=1 38 VBoxInstallHelper_DEFS += \ 39 $(if $(VBOX_WITH_NETFLT),VBOX_WITH_NETFLT,) \ 40 $(if $(VBOX_WITH_NETADP),VBOX_WITH_NETADP,) 41 VBoxInstallHelper_LIBS += \ 42 $(PATH_STAGE_LIB)/WinNetConfigSharedStatic.lib \ 43 $(PATH_STAGE_LIB)/VBoxDrvCfgSharedStatic.lib \ 44 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \ 45 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib 39 46 endif 40 47 VBoxInstallHelper_DEPS = $(VBOX_SVN_REV_KMK) … … 48 55 internal/VBoxSerial.cpp 49 56 endif 50 VBoxInstallHelper_LIBS 57 VBoxInstallHelper_LIBS += \ 51 58 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Msi.lib 52 ifdef VBOX_WITH_NETFLT53 VBoxInstallHelper_LIBS += \54 $(PATH_STAGE_LIB)/WinNetConfigSharedStatic.lib \55 $(PATH_STAGE_LIB)/VBoxDrvCfgSharedStatic.lib \56 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \57 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib58 endif59 59 60 60 if "$(KBUILD_TARGET)" == "win" && defined(VBOX_WITH_TESTCASES) && !defined(VBOX_OSE) -
trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
r103328 r103889 30 30 * Header Files * 31 31 *********************************************************************************************************************************/ 32 #if def VBOX_WITH_NETFLT32 #if defined(VBOX_WITH_NETFLT) || defined(VBOX_WITH_NETADP) 33 33 # include "VBox/VBoxNetCfg-win.h" 34 34 # include "VBox/VBoxDrvCfg-win.h" 35 35 #endif 36 36 37 #define _WIN32_DCOM 38 #include <iprt/win/windows.h> 39 37 40 #include <msi.h> 38 41 #include <msiquery.h> 39 40 #define _WIN32_DCOM41 #include <iprt/win/windows.h>42 42 43 43 #include <shellapi.h> … … 874 874 } 875 875 876 #if def VBOX_WITH_NETFLT876 #if defined(VBOX_WITH_NETFLT) || defined(VBOX_WITH_NETADP) 877 877 878 878 /** @todo should use some real VBox app name */ … … 1056 1056 return uErr; 1057 1057 } 1058 1058 #endif /* defined(VBOX_WITH_NETFLT) || defined(VBOX_WITH_NETADP) */ 1059 1060 #ifdef VBOX_WITH_NETFLT 1059 1061 static UINT vboxNetFltQueryInfArray(MSIHANDLE hModule, OUT LPWSTR pwszPtInf, DWORD cwcPtInf, 1060 1062 OUT LPWSTR pwszMpInf, DWORD cwcMpInf) … … 1087 1089 } 1088 1090 1089 #endif /*VBOX_WITH_NETFLT*/ 1090 1091 /*static*/ UINT _uninstallNetFlt(MSIHANDLE hModule) 1092 { 1093 #ifdef VBOX_WITH_NETFLT 1091 static UINT _uninstallNetFlt(MSIHANDLE hModule) 1092 { 1094 1093 INetCfg *pNetCfg; 1095 1094 UINT uErr; … … 1128 1127 netCfgLoggerDisable(); 1129 1128 } 1129 1130 /* Never fail the uninstall even if we did not succeed. */ 1131 return ERROR_SUCCESS; 1132 } 1130 1133 #endif /* VBOX_WITH_NETFLT */ 1131 1134 1132 /* Never fail the uninstall even if we did not succeed. */1133 return ERROR_SUCCESS;1134 }1135 1136 1135 UINT __stdcall UninstallNetFlt(MSIHANDLE hModule) 1137 1136 { 1138 (void)_uninstallNetLwf(hModule); 1137 #ifdef VBOX_WITH_NETFLT 1138 _uninstallNetLwf(hModule); 1139 1139 return _uninstallNetFlt(hModule); 1140 } 1141 1140 #else 1141 RT_NOREF(hModule); 1142 return ERROR_SUCCESS; 1143 #endif 1144 } 1145 1146 #ifdef VBOX_WITH_NETFLT 1142 1147 static UINT _installNetFlt(MSIHANDLE hModule) 1143 1148 { 1144 #ifdef VBOX_WITH_NETFLT1145 1149 UINT uErr; 1146 1150 INetCfg *pNetCfg; … … 1189 1193 netCfgLoggerDisable(); 1190 1194 } 1195 1196 /* Never fail the install even if we did not succeed. */ 1197 return ERROR_SUCCESS; 1198 } 1191 1199 #endif /* VBOX_WITH_NETFLT */ 1192 1200 1193 /* Never fail the install even if we did not succeed. */1194 return ERROR_SUCCESS;1195 }1196 1197 1201 UINT __stdcall InstallNetFlt(MSIHANDLE hModule) 1198 1202 { 1199 (void)_uninstallNetLwf(hModule); 1203 #ifdef VBOX_WITH_NETFLT 1204 _uninstallNetLwf(hModule); 1200 1205 return _installNetFlt(hModule); 1201 } 1202 1203 1204 /*static*/ UINT _uninstallNetLwf(MSIHANDLE hModule) 1205 { 1206 #else 1207 RT_NOREF(hModule); 1208 return ERROR_SUCCESS; 1209 #endif 1210 } 1211 1206 1212 #ifdef VBOX_WITH_NETFLT 1213 static UINT _uninstallNetLwf(MSIHANDLE hModule) 1214 { 1207 1215 INetCfg *pNetCfg; 1208 1216 UINT uErr; … … 1241 1249 netCfgLoggerDisable(); 1242 1250 } 1251 1252 /* Never fail the uninstall even if we did not succeed. */ 1253 return ERROR_SUCCESS; 1254 } 1243 1255 #endif /* VBOX_WITH_NETFLT */ 1244 1256 1245 /* Never fail the uninstall even if we did not succeed. */1246 return ERROR_SUCCESS;1247 }1248 1249 1257 UINT __stdcall UninstallNetLwf(MSIHANDLE hModule) 1250 1258 { 1251 (void)_uninstallNetFlt(hModule); 1259 #ifdef VBOX_WITH_NETFLT 1260 _uninstallNetFlt(hModule); 1252 1261 return _uninstallNetLwf(hModule); 1253 } 1254 1262 #else 1263 RT_NOREF(hModule); 1264 return ERROR_SUCCESS; 1265 #endif 1266 } 1267 1268 #ifdef VBOX_WITH_NETFLT 1255 1269 static UINT _installNetLwf(MSIHANDLE hModule) 1256 1270 { 1257 #ifdef VBOX_WITH_NETFLT1258 1271 UINT uErr; 1259 1272 INetCfg *pNetCfg; … … 1318 1331 netCfgLoggerDisable(); 1319 1332 } 1333 1334 /* Never fail the install even if we did not succeed. */ 1335 return ERROR_SUCCESS; 1336 } 1320 1337 #endif /* VBOX_WITH_NETFLT */ 1321 1338 1322 /* Never fail the install even if we did not succeed. */1323 return ERROR_SUCCESS;1324 }1325 1326 1339 UINT __stdcall InstallNetLwf(MSIHANDLE hModule) 1327 1340 { 1328 (void)_uninstallNetFlt(hModule); 1341 #ifdef VBOX_WITH_NETFLT 1342 _uninstallNetFlt(hModule); 1329 1343 return _installNetLwf(hModule); 1330 } 1331 1332 1333 #if 0 1344 #else 1345 RT_NOREF(hModule); 1346 return ERROR_SUCCESS; 1347 #endif 1348 } 1349 1350 1351 #if 0 /** @todo r=andy Remove this? */ 1334 1352 static BOOL RenameHostOnlyConnectionsCallback(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pDev, PVOID pContext) 1335 1353 { … … 1387 1405 return TRUE; 1388 1406 } 1389 #endif 1390 1407 #endif /* 0 */ 1408 1409 #ifdef VBOX_WITH_NETADP 1391 1410 static UINT _createHostOnlyInterface(MSIHANDLE hModule, LPCWSTR pwszId, LPCWSTR pwszInfName) 1392 1411 { 1393 #ifdef VBOX_WITH_NETFLT1394 1412 netCfgLoggerEnable(hModule); 1395 1413 … … 1460 1478 logStringF(hModule, "CreateHostOnlyInterface: VBoxNetCfgWinUpdateHostOnlyNetworkInterface failed, hr = %#x", hr); 1461 1479 logStringF(hModule, "CreateHostOnlyInterface: calling VBoxNetCfgWinCreateHostOnlyNetworkInterface"); 1462 # ifdef VBOXNETCFG_DELAYEDRENAME1480 # ifdef VBOXNETCFG_DELAYEDRENAME 1463 1481 BSTR devId; 1464 1482 hr = VBoxNetCfgWinCreateHostOnlyNetworkInterface(pwszInfPath, fIsFile, NULL, &guid, &devId, NULL); 1465 # else /* !VBOXNETCFG_DELAYEDRENAME */1483 # else /* !VBOXNETCFG_DELAYEDRENAME */ 1466 1484 hr = VBoxNetCfgWinCreateHostOnlyNetworkInterface(pwszInfPath, fIsFile, NULL, &guid, NULL, NULL); 1467 # endif /* !VBOXNETCFG_DELAYEDRENAME */1485 # endif /* !VBOXNETCFG_DELAYEDRENAME */ 1468 1486 logStringF(hModule, "CreateHostOnlyInterface: VBoxNetCfgWinCreateHostOnlyNetworkInterface returns %#x", hr); 1469 1487 if (SUCCEEDED(hr)) … … 1476 1494 if (FAILED(hr)) 1477 1495 logStringF(hModule, "CreateHostOnlyInterface: VBoxNetCfgWinEnableStaticIpConfig failed, error = %#x", hr); 1478 # ifdef VBOXNETCFG_DELAYEDRENAME1496 # ifdef VBOXNETCFG_DELAYEDRENAME 1479 1497 hr = VBoxNetCfgWinRenameHostOnlyConnection(&guid, devId, NULL); 1480 1498 if (FAILED(hr)) 1481 1499 logStringF(hModule, "CreateHostOnlyInterface: VBoxNetCfgWinRenameHostOnlyConnection failed, error = %#x", hr); 1482 1500 SysFreeString(devId); 1483 # endif /* VBOXNETCFG_DELAYEDRENAME */1501 # endif /* VBOXNETCFG_DELAYEDRENAME */ 1484 1502 } 1485 1503 else … … 1498 1516 netCfgLoggerDisable(); 1499 1517 1500 #endif /* VBOX_WITH_NETFLT */1501 1502 1518 logStringF(hModule, "CreateHostOnlyInterface: Returns success (ignoring all failures)"); 1503 1519 /* Never fail the install even if we did not succeed. */ 1504 1520 return ERROR_SUCCESS; 1505 1521 } 1522 #endif /* VBOX_WITH_NETADP */ 1506 1523 1507 1524 UINT __stdcall CreateHostOnlyInterface(MSIHANDLE hModule) 1508 1525 { 1526 #ifdef VBOX_WITH_NETADP 1509 1527 return _createHostOnlyInterface(hModule, NETADP_ID, L"VBoxNetAdp.inf"); 1528 #else 1529 RT_NOREF(hModule); 1530 return ERROR_SUCCESS; 1531 #endif 1510 1532 } 1511 1533 1512 1534 UINT __stdcall Ndis6CreateHostOnlyInterface(MSIHANDLE hModule) 1513 1535 { 1514 #if 0 /* Trick for allowing the debugger to be attached. */ 1536 #ifdef VBOX_WITH_NETADP 1537 # if 0 /* Trick for allowing the debugger to be attached. */ 1515 1538 for (unsigned i = 0; i < 128 && !IsDebuggerPresent(); i++) 1516 1539 { … … 1520 1543 Sleep(1002); 1521 1544 __debugbreak(); 1545 # endif 1546 return _createHostOnlyInterface(hModule, NETADP_ID, L"VBoxNetAdp6.inf"); 1547 #else /* !VBOX_WITH_NETADP */ 1548 RT_NOREF(hModule); 1549 return ERROR_SUCCESS; 1522 1550 #endif 1523 return _createHostOnlyInterface(hModule, NETADP_ID, L"VBoxNetAdp6.inf"); 1524 } 1525 1551 } 1552 1553 #ifdef VBOX_WITH_NETADP 1526 1554 static UINT _removeHostOnlyInterfaces(MSIHANDLE hModule, LPCWSTR pwszId) 1527 1555 { 1528 #ifdef VBOX_WITH_NETFLT1529 1556 netCfgLoggerEnable(hModule); 1530 1557 … … 1550 1577 1551 1578 netCfgLoggerDisable(); 1552 #endif /* VBOX_WITH_NETFLT */1553 1579 1554 1580 /* Never fail the uninstall even if we did not succeed. */ 1555 1581 return ERROR_SUCCESS; 1556 1582 } 1583 #endif /* VBOX_WITH_NETADP */ 1557 1584 1558 1585 UINT __stdcall RemoveHostOnlyInterfaces(MSIHANDLE hModule) 1559 1586 { 1587 #ifdef VBOX_WITH_NETADP 1560 1588 return _removeHostOnlyInterfaces(hModule, NETADP_ID); 1561 } 1562 1589 #else 1590 RT_NOREF(hModule); 1591 return ERROR_SUCCESS; 1592 #endif 1593 } 1594 1595 #ifdef VBOX_WITH_NETADP 1563 1596 static UINT _stopHostOnlyInterfaces(MSIHANDLE hModule, LPCWSTR pwszId) 1564 1597 { 1565 #ifdef VBOX_WITH_NETFLT1566 1598 netCfgLoggerEnable(hModule); 1567 1599 … … 1581 1613 1582 1614 netCfgLoggerDisable(); 1583 #endif /* VBOX_WITH_NETFLT */1584 1615 1585 1616 /* Never fail the uninstall even if we did not succeed. */ 1586 1617 return ERROR_SUCCESS; 1587 1618 } 1619 #endif /* VBOX_WITH_NETADP */ 1588 1620 1589 1621 UINT __stdcall StopHostOnlyInterfaces(MSIHANDLE hModule) 1590 1622 { 1623 #ifdef VBOX_WITH_NETADP 1591 1624 return _stopHostOnlyInterfaces(hModule, NETADP_ID); 1592 } 1593 1625 #else 1626 RT_NOREF(hModule); 1627 return ERROR_SUCCESS; 1628 #endif 1629 } 1630 1631 #ifdef VBOX_WITH_NETADP 1594 1632 static UINT _updateHostOnlyInterfaces(MSIHANDLE hModule, LPCWSTR pwszInfName, LPCWSTR pwszId) 1595 1633 { 1596 #ifdef VBOX_WITH_NETFLT1597 1634 netCfgLoggerEnable(hModule); 1598 1635 … … 1661 1698 1662 1699 netCfgLoggerDisable(); 1663 #endif /* VBOX_WITH_NETFLT */1664 1700 1665 1701 /* Never fail the update even if we did not succeed. */ 1666 1702 return ERROR_SUCCESS; 1667 1703 } 1704 #endif /* VBOX_WITH_NETADP */ 1668 1705 1669 1706 UINT __stdcall UpdateHostOnlyInterfaces(MSIHANDLE hModule) 1670 1707 { 1708 #ifdef VBOX_WITH_NETADP 1671 1709 return _updateHostOnlyInterfaces(hModule, L"VBoxNetAdp.inf", NETADP_ID); 1710 #else 1711 RT_NOREF(hModule); 1712 return ERROR_SUCCESS; 1713 #endif 1672 1714 } 1673 1715 1674 1716 UINT __stdcall Ndis6UpdateHostOnlyInterfaces(MSIHANDLE hModule) 1675 1717 { 1718 #ifdef VBOX_WITH_NETADP 1676 1719 return _updateHostOnlyInterfaces(hModule, L"VBoxNetAdp6.inf", NETADP_ID); 1677 } 1678 1720 #else 1721 RT_NOREF(hModule); 1722 return ERROR_SUCCESS; 1723 #endif 1724 } 1725 1726 #ifdef VBOX_WITH_NETADP 1679 1727 static UINT _uninstallNetAdp(MSIHANDLE hModule, LPCWSTR pwszId) 1680 1728 { 1681 #ifdef VBOX_WITH_NETFLT1682 1729 INetCfg *pNetCfg; 1683 1730 UINT uErr; … … 1716 1763 netCfgLoggerDisable(); 1717 1764 } 1718 #endif /* VBOX_WITH_NETFLT */1719 1765 1720 1766 /* Never fail the uninstall even if we did not succeed. */ 1721 1767 return ERROR_SUCCESS; 1722 1768 } 1769 #endif /* VBOX_WITH_NETADP */ 1723 1770 1724 1771 UINT __stdcall UninstallNetAdp(MSIHANDLE hModule) 1725 1772 { 1773 #ifdef VBOX_WITH_NETADP 1726 1774 return _uninstallNetAdp(hModule, NETADP_ID); 1775 #else 1776 RT_NOREF(hModule); 1777 return ERROR_SUCCESS; 1778 #endif 1727 1779 } 1728 1780
Note:
See TracChangeset
for help on using the changeset viewer.