Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Force WI to show FilesInUse dlg then continue


2 replies to this topic

rflum

rflum
  • Full Members
  • 40 posts

Posted 28 February 2001 - 21:46

Hi, all,
  I wrote a CA to detect an app (without a window or a titlebar) running during uninstall, because WI can't detect it.
  I fill a record and send MsiProcessMessage INSTALLMESSAGE_FILESINUSE to WI.  If I am uninstalling by running setup.exe again from the CD, WI shows the FilesInUse dlg, but after closing the app and pressing Retry, it goes to the SetupCompleteError dlg and quits instead of uninstalling.  If I uninstall from Add/Remove instead, I get a small dlg that is not the FilesInUse dlg, but has the app's name in a listbox and 3 buttons: Cancel, Retry and Ignore. ????  After closing the app and pressing Retry, it just quits, no SetupCompleteError dlg, no uninstall.

How do I get WI to show FIU and continue normally?
  Thanks, Rob


rflum

rflum
  • Full Members
  • 40 posts

Posted 15 May 2001 - 21:18

Hi, all,
 I'm replying to my own post so if anyone has a similar problem, they'll profit by this info.
 (Hey, Sofia!)

I had 2 problems here:
1)  I was returning a value from my app-detecting CA: 0 if app was not running and 1 if it was.
If a CA returns a non-0 value, the Installer will fail unless you tell it to ignore the CA's return value.  I chose to set a property instead and always return ERROR_SUCCESS.
2) When running from Add/Remove Programs the Installer runs in Basic UI mode, which doesn't include the FilesInUse dialog.  However, sending MsiProcessMessage INSTALLMESSAGE_FILESINUSE to the Installer will get it to display what looks like a common MS Quit/Cancel/Retry dialog.  The FilesInUse msg record field 1 is used to fill this dialog's text field if running Basic UI, and ignored if in Full UI mode.  I pass the standard IS message @IDS__IsFilesInUse_4, so I get translation for free.  The following code works just fine:

     //  Send a FILESINUSE message to the Windows Installer service.
     //  Create a record with 3 fields.
     hRecord = MsiCreateRecord(3);
     // Format the record fields.
     MsiRecordSetString(hRecord, 0, @IDS__IsFilesInUse_4);   // Set field 1 to explanatory msg
     MsiRecordSetString(hRecord, 1, MYAPP_NAME);   // Set field 2 to name of running exe
     MsiRecordSetString(hRecord, 2, MYAPP_WINTITLE);   // Set field 3 to exe's window title
     lResult = MsiProcessMessage(hInstall, INSTALLMESSAGE_FILESINUSE, hRecord);

 Happy sailing, Rob


eheimfeld

eheimfeld
  • Members
  • 10 posts

Posted 13 November 2001 - 15:57

How do you create a CA to detect a running application. ANd can have the CA shut down taht application?