wix-msi-loopback-20040622

convert wix installer to use msi interface to loopback dll instead
of instloop.exe
This commit is contained in:
Jeffrey Altman 2004-06-23 09:12:07 +00:00 committed by Jeffrey Altman
parent be70343e2a
commit 50e18fe024
2 changed files with 35 additions and 1 deletions

View File

@ -16,7 +16,8 @@ DLLEXPORTS=\
-EXPORT:InstallLoopBack \
-EXPORT:doLoopBackEntryW \
-EXPORT:uninstallLoopBackEntryW \
-EXPORT:installLoopbackMSI
-EXPORT:installLoopbackMSI \
-EXPORT:uninstallLoopbackMSI
DLLLIBFILES=\
setupapi.lib msi.lib uuid.lib Shell32.lib ole32.lib advapi32.lib wbemuuid.lib

View File

@ -627,3 +627,36 @@ UINT __stdcall installLoopbackMSI (MSIHANDLE hInstall)
return ERROR_SUCCESS;
}
UINT __stdcall uninstallLoopbackMSI (MSIHANDLE hInstall)
{
LPWSTR szValueBuf;
DWORD cbValueBuf = 256;
Args args;
UINT rc;
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, args))
return ERROR_INSTALL_FAILURE;
rc = UnInstallLoopBack ();
if (rc == 1)
return ERROR_INSTALL_FAILURE;
if (rc == 2) {
MsiDoActionW (hInstall, L"ScheduleReboot");
}
return ERROR_SUCCESS;
}