cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
webwolve
Level 4

Detecting Locked Files

Hi all,

I have a request to add a feature to detect locked (or open) files on the end user's machine before attempting to lay any files down via my install. Does anyone have any suggestions on how to do this, or even if it is possible?

I'm running an InstallScript project with approximately 3000 files installed.

Thanks in advance!
Labels (1)
0 Kudos
(2) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The InstallScript engine will call the OnFileLocked event for any files that are detected as locked when attempting to overwrite or remove the file. The value returned from this event can be used to have the engine perform a specific action for the file (the default action is to copy/remove the file after reboot).

If you want to detect if any files are in use before file transfer, you could use Is(FILE_LOCKED) and FeatureFileEnum to enumerate all files in the setup and test if they are locked. However, this would likely be rather time consuming, and it may be simpler to detect if any known processes are running that could be using the files (see "List and Shut Down Running Applications" at http://installsite.org/pages/en/isp_ext.htm for one possible method for detecting running processes).
0 Kudos
webwolve
Level 4

Thanks for your suggestions.
0 Kudos