summaryrefslogtreecommitdiffstats
path: root/src/windows/installer
diff options
context:
space:
mode:
authorJeffrey Altman <jaltman@secure-endpoints.com>2007-10-12 23:08:30 +0000
committerJeffrey Altman <jaltman@secure-endpoints.com>2007-10-12 23:08:30 +0000
commita70217525cfffbb83a289d9ae28f4b9823b7c1af (patch)
treea117a31c4e95eb11204ddf9f97e7ed314ae16aa0 /src/windows/installer
parent6e011a1ee3fa13245b4ccc16e1dce6e5159ec24a (diff)
downloadkrb5-a70217525cfffbb83a289d9ae28f4b9823b7c1af.tar.gz
krb5-a70217525cfffbb83a289d9ae28f4b9823b7c1af.tar.xz
krb5-a70217525cfffbb83a289d9ae28f4b9823b7c1af.zip
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 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20119 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/windows/installer')
-rw-r--r--src/windows/installer/wix/custom/custom.cpp29
-rw-r--r--src/windows/installer/wix/custom/custom.h1
-rw-r--r--src/windows/installer/wix/lang/ui_1033.wxi1
-rw-r--r--src/windows/installer/wix/property.wxi2
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 a61b632ac1..98d669f3ef 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 2e66671a1a..3b28eeccae 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 bae7781750..dc6b5561f7 100644
--- a/src/windows/installer/wix/lang/ui_1033.wxi
+++ b/src/windows/installer/wix/lang/ui_1033.wxi
@@ -1165,6 +1165,7 @@
<Error Id="4005">Custom action failed. Phase [2]</Error>
<Error Id="4006">Failed to determine running processes. Status [2]</Error>
<Error Id="4007">Failed to install Kerberos network provider. Status [2]</Error>
+ <Error Id="4008">NSIS Uninstallation failed to initialize. Uninstaller path [2] returned error [3]</Error>
<AdminUISequence>
<Show Dialog="FatalError" OnExit="error" />
<Show Dialog="UserExit" OnExit="cancel" />
diff --git a/src/windows/installer/wix/property.wxi b/src/windows/installer/wix/property.wxi
index b392333fc7..b1f5c599bd 100644
--- a/src/windows/installer/wix/property.wxi
+++ b/src/windows/installer/wix/property.wxi
@@ -40,7 +40,7 @@
<Property Id="ComponentDownload">http://web.mit.edu/kerberos</Property>
<Property Id="UPGRADENSIS">
- <RegistrySearch Id="regsrch_NSIS" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\Kerberos for Windows" Name="UninstallString" Type="file"/>
+ <RegistrySearch Id="regsrch_NSIS" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\Kerberos for Windows" Name="UninstallString" Type="raw"/>
</Property>
<Property Id="NSISVERSION">