PDA

View Full Version : How to tell if a file is being accessed



NewsArchive
10-29-2008, 07:37 AM
Does anyone have a foolproof way to test if a file is being accessed or
locked?

What we have been doing is changing the name of the primary EXE, and then
testing to see if the original name is there.
If it is, the rename failed, and the file is locked by some user.

Ok, i know this is a crude way of doing it, but it worked beautifully until
RDP.
It seems that with RDP on some of the newer servers, the EXE's are cached.

Result: after the install, it tells you to reboot the server. And sometimes,
when the server comes back up, all the exe's and dll's that were replaced
during the install process are gone.

So, any ideas? It is vital that everyone is out of the software before the
update run. I just need a viable way to make sure of this.

Thanks,
--Glenn.

NewsArchive
10-29-2008, 07:38 AM
Glenn,

You have several options. You can try the "Check In-use File..." and/or
"Check In-use Folder Tree..." functions.

Another way to handle this is the use of the "Set Delayed File Install"
SetupBuilder technology. This will automatically check (before files are
replaced) if all files can be written. If this is the case, the
installation continues. If a file is locked, the installer reports the
filename and offers a retry/cancel option.

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
10-30-2008, 03:19 AM
oh... never saw these... (feeling somewhat newbishly awkward...)

Will they handle the issue with RDP servers caching the application files?

Thanks,
--Glenn.

NewsArchive
10-30-2008, 03:22 AM
Hi Glenn,

> oh... never saw these... (feeling somewhat newbishly awkward...)
>
> Will they handle the issue with RDP servers caching the application files?

The functions check if it is possible to get exclusive write access to the
files. If this is the case, they return "success". If exlusive file access
is not possible (files are "locked" or "in-use" -> cannot be
replaced/renamed, etc.) then the functions return "fail".

Does this help?

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner