pull up r20119 from trunk
authorTom Yu <tlyu@mit.edu>
Mon, 15 Oct 2007 22:07:39 +0000 (22:07 +0000)
committerTom Yu <tlyu@mit.edu>
Mon, 15 Oct 2007 22:07:39 +0000 (22:07 +0000)
 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
src/windows/installer/wix/custom/custom.h
src/windows/installer/wix/lang/ui_1033.wxi
src/windows/installer/wix/property.wxi

index a61b632ac1a8395068c29a2eee53beb133295ea4..98d669f3efd38e36b2f000b8871b103a4519bb62 100644 (file)
@@ -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;
 }
index 2e66671a1adf398a27765cde2c44b3413031e581..3b28eeccae9747bec23733ca68d7e821ab768517 100644 (file)
@@ -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
index bae7781750f90d777391aaa1305bc689ceb8b380..dc6b5561f7a0ebfab26469ca9f9cbfee2bcced03 100644 (file)
       <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" />
index b392333fc7dbeed16b19bb2e6ee555db3c5c2571..b1f5c599bd31f92772a75bc619fac94fa6392c28 100644 (file)
@@ -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">