From afb1457f9e0d4126f783d1a0272671a17c783114 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Mon, 15 Oct 2007 22:07:39 +0000 Subject: [PATCH] pull up r20119 from trunk r20119@cathode-dark-space: jaltman | 2007-10-12 19:08:30 -0400 ticket: 5820 There appears to be a bug either in the WiX engine or the Windows Installer 3.1. The "File" type on the Registry Search property is supposed to provide the full path name. Instead, we are being given just the directory as if it were being processed with the "Directory" type. We can avoid this for a REG_SZ value by using the "Raw" type because we are sure that the string is not going to begin with a '#' character. Because the full path was not being obtained for the UPGRADENSIS property, the Uninstall routine was unable to CreateProcess() the uninstall program. This commit also includes addition debugging in the NSIS Uninstall custom handler to report the path and the GetLastError() value when the uninstall fails. This will be logged in the msiexec log file and displayed in a MessageBox. ticket: 5820 version_fixed: 1.6.3 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@20122 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/installer/wix/custom/custom.cpp | 29 +++++++++++++++------ src/windows/installer/wix/custom/custom.h | 1 + src/windows/installer/wix/lang/ui_1033.wxi | 1 + src/windows/installer/wix/property.wxi | 2 +- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/windows/installer/wix/custom/custom.cpp b/src/windows/installer/wix/custom/custom.cpp index a61b632ac..98d669f3e 100644 --- a/src/windows/installer/wix/custom/custom.cpp +++ b/src/windows/installer/wix/custom/custom.cpp @@ -551,7 +551,7 @@ MSIDLLEXPORT UninstallNsisInstallation( MSIHANDLE hInstall ) sInfo.cb = sizeof(sInfo); sInfo.lpReserved = NULL; sInfo.lpDesktop = _T(""); - sInfo.lpTitle = _T("Foo"); + sInfo.lpTitle = _T("NSIS Uninstaller for Kerberos for Windows"); sInfo.dwX = 0; sInfo.dwY = 0; sInfo.dwXSize = 0; @@ -578,11 +578,24 @@ MSIDLLEXPORT UninstallNsisInstallation( MSIHANDLE hInstall ) NULL, &sInfo, &pInfo)) { - pInfo.hProcess = NULL; - pInfo.hThread = NULL; - rv = 40; - goto _cleanup; - }; + DWORD lastError = GetLastError(); + MSIHANDLE hRecord; + + hRecord = MsiCreateRecord(4); + MsiRecordClearData(hRecord); + MsiRecordSetInteger(hRecord, 1, ERR_NSS_FAILED_CP); + MsiRecordSetString(hRecord, 2, strPathUninst); + MsiRecordSetInteger(hRecord, 3, lastError); + + MsiProcessMessage( hInstall, INSTALLMESSAGE_ERROR, hRecord ); + + MsiCloseHandle( hRecord ); + + pInfo.hProcess = NULL; + pInfo.hThread = NULL; + rv = 40; + goto _cleanup; + }; // Create a job object to contain the NSIS uninstall process tree @@ -630,8 +643,8 @@ _cleanup: if(hJob) CloseHandle(hJob); if(strPathUninst) delete strPathUninst; - if(rv != ERROR_SUCCESS) { - ShowMsiError( hInstall, ERR_NSS_FAILED, rv ); + if(rv != ERROR_SUCCESS && rv != 40) { + ShowMsiError( hInstall, ERR_NSS_FAILED, rv ); } return rv; } diff --git a/src/windows/installer/wix/custom/custom.h b/src/windows/installer/wix/custom/custom.h index 2e66671a1..3b28eecca 100644 --- a/src/windows/installer/wix/custom/custom.h +++ b/src/windows/installer/wix/custom/custom.h @@ -79,3 +79,4 @@ MSIDLLEXPORT UninstallNetProvider ( MSIHANDLE ); #define ERR_ABORT 4004 #define ERR_PROC_LIST 4006 #define ERR_NPI_FAILED 4007 +#define ERR_NSS_FAILED_CP 4008 diff --git a/src/windows/installer/wix/lang/ui_1033.wxi b/src/windows/installer/wix/lang/ui_1033.wxi index bae778175..dc6b5561f 100644 --- a/src/windows/installer/wix/lang/ui_1033.wxi +++ b/src/windows/installer/wix/lang/ui_1033.wxi @@ -1165,6 +1165,7 @@ Custom action failed. Phase [2] Failed to determine running processes. Status [2] Failed to install Kerberos network provider. Status [2] + NSIS Uninstallation failed to initialize. Uninstaller path [2] returned error [3] diff --git a/src/windows/installer/wix/property.wxi b/src/windows/installer/wix/property.wxi index b392333fc..b1f5c599b 100644 --- a/src/windows/installer/wix/property.wxi +++ b/src/windows/installer/wix/property.wxi @@ -40,7 +40,7 @@ http://web.mit.edu/kerberos - + -- 2.26.2