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

FileInUseProcess Help !!!!


1 reply to this topic

Kiril

Kiril
  • Members
  • 39 posts

Posted 20 January 2002 - 15:10

Hi all,
I am trying to use FileInUse dialog in my uninstall.
I want alert to user to close my main application.
During uninstall setup remove all file including my main.exe but main.exe process still running and I can use my tray icon.
I just want to do something like in InstallShield 5.5 - File Key
Install must check main.exe before uninstall and alert user.
In ISWI exist FileInUse dialog and I am trying to use it.
In Msi help InstallValidate topic says about record of FileInUseProcess property:

Property :  FileInUseProcess
Value     : <name of process>
Text       : <Text contained in the caption of main window>

I am doing:
hRec = MsiCreateRecord(3);
MsiRecordSetString(hRec, 1, "FileInUseProcess");
MsiRecordSetString(hRec, 2, "main.exe");
MsiRecordSetString(hRec, 3, "main title");
MsiProcessMessage(hMSI,INSTALLMESSAGE_ACTIONDATA,hRec);

But it’s doesn’t work
I am not sure about MsiProcessMessage it’s my guess!!!
Please help.

Kiril



rflum

rflum
  • Full Members
  • 40 posts

Posted 07 March 2002 - 18:04

You have 2 problems: the 2nd parameter to MsiRecordSetString should be 0, 1 and 2; and the 2nd parameter to MsiProcessMessage should be INSTALLMESSAGE_FILESINUSE.  So your code should be:

hRec = MsiCreateRecord(3);
MsiRecordSetString(hRec, 0, "FileInUseProcess");
MsiRecordSetString(hRec, 1, "main.exe");
MsiRecordSetString(hRec, 2, "main title");
MsiProcessMessage(hMSI,INSTALLMESSAGE_FILESINUSE,hRec);

Also, a suggestion:
 The InstallShield string IDS_IsFilesInUse_4 starts off with a font specifier: {&Tahoma8}.
NOTE: It says exactly what I want to say, and the translation is free,
so I'm going to take the risk that it may not always have a font specifier,
or that the syntax of the specifier will change.
 iStartIndex = StrFind(@IDSIsFilesInUse_4, iStartIndex+1, 200 );
  lResult = MsiRecordSetString(hRecord, 0, szErrMsg);

 This works for me.  I hope this answer isn't too late.
   Rob
Robert Flum
FlumR@genrad.com
user posted image