UINT __stdcall uninstallLoopbackMSI (MSIHANDLE hInstall) { LPWSTR szValueBuf; DWORD cbValueBuf = 256; Args args; UINT rc; SetMsiReporter("RemoveLoopback", "Removing loopback adapter", hInstall); szValueBuf = (LPWSTR) malloc (cbValueBuf * sizeof (WCHAR)); while (rc = MsiGetPropertyW(hInstall, L"CustomActionData", szValueBuf, &cbValueBuf)) { free (szValueBuf); if (rc == ERROR_MORE_DATA) { cbValueBuf++; szValueBuf = (LPWSTR) malloc (cbValueBuf * sizeof (WCHAR)); } else return ERROR_INSTALL_FAILURE; } if (!process_args(szValueBuf, 1, args)) return ERROR_INSTALL_FAILURE; rc = UnInstallLoopBack (); if (rc == 1) return ERROR_INSTALL_FAILURE; if (rc == 2) { MsiDoActionW (hInstall, L"ScheduleReboot"); } return ERROR_SUCCESS; }
UINT __stdcall installLoopbackMSI (MSIHANDLE hInstall) { LPWSTR szValueBuf; DWORD cbValueBuf = 256; Args args; UINT rc; SetMsiReporter("InstallLoopback", "Installing loopback adapter", hInstall); /* check if there is already one installed. If there is, we shouldn't try to * install another. */ if(IsLoopbackInstalled()) return ERROR_SUCCESS; szValueBuf = (LPWSTR) malloc (cbValueBuf * sizeof (WCHAR)); while (rc = MsiGetPropertyW(hInstall, L"CustomActionData", szValueBuf, &cbValueBuf)) { free (szValueBuf); if (rc == ERROR_MORE_DATA) { cbValueBuf++; szValueBuf = (LPWSTR) malloc (cbValueBuf * sizeof (WCHAR)); } else return ERROR_INSTALL_FAILURE; } if (!process_args(szValueBuf, 1, args)) return ERROR_INSTALL_FAILURE; rc = InstallLoopBack (args.lpConnectionName, args.lpIPAddr, args.lpSubnetMask); if (rc != 2 && rc != 0) return ERROR_INSTALL_FAILURE; if (rc == 2) { MsiDoActionW (hInstall, L"ScheduleReboot"); } return ERROR_SUCCESS; }
UINT __stdcall RemoveExistingProductsAgain(MSIHANDLE hInstall) { return MsiDoActionW(hInstall, L"RemoveExistingProducts"); }