View Full Version : Can I use the SdRMFileInUse in Windows XP?

03-18-2008, 05:28 AM
my question as the Title, thanks all.

03-18-2008, 07:59 AM
I don't believe that the SdRMFilesInUse dialog works on Windows XP, since SdRMFilesInUse works with the Restart Manager, which was introduced for Windows Vista. On Windows XP systems, you'd want to use SdFilesInUse.

I hope that helps.

Debbie Landers
Macrovision Corporation

03-20-2008, 10:47 PM
Thanks DebbieL:
I have noticed that a SdFilesInUse dialog can be manually used in InstallScript to show the Files-in-use dialog

For the following syntax:
SdFilesInUse ( byval string szTitle, byval string szMsg, byval string szFilesInUse, byref LIST nvlistApps );

I must give a string list of applications that are locking files, but where to get the application list since I don't know which file will be locked?

03-21-2008, 05:27 PM
I think that you would need to identify the files that would cause problems if they were locked during your installation, and add if statements in your script that would check to see if they are locked; if so, add them to the list of files that would be passed to SdFilesInUse. The SdFilesInUse Example (http://helpnet.macrovision.com/Robo/BIN/Robo.dll?tpc=/robo/projects/installshield14langref/LangrefSdFilesInUse_example.htm) help topic has some sample script.

Debbie Landers
Macrovision Corporation

03-23-2008, 09:38 PM
I don't want to specify them manually for too many file types in my project. And I have seen the OnFileLocked event which can detect file in used.
But it only detect one file each time and how to add it into SdFilesInUse's nvlistApps to construct a full file-in-use list?

03-24-2008, 09:54 AM
Are you trying to call SdFilesInUse or SdRMFilesInUse directly? Normally this is only called through the events which correspond to callbacks from Windows Installer. It will have done the work to identify which files are in use, and expects feedback from the user.

If you are trying to call the function manually, then yes, you will have to prepare the file list; these dialogs do not find out the information, they merely display it.

03-25-2008, 03:01 AM
I know that
1. In Basic Msi project, InstallValidation action will launch the SdFilesInUse dialog automatically.
2. In InstallScript MSI project, OnFilesInUse event is available to launch SdFilesInUse automatically.
But what's for InstallScript project? It's seems no way but to add dialog manually.

03-25-2008, 05:43 PM
That is correct - InstallScript doesn't natively use this dialog; it handles in-use files differently from MSI. If you want to use the dialog, you will have to create your list before calling the dialog, and process the response accordingly.