PDA

View Full Version : Installer Included Files Running or Attached...


kweatherhead
03-31-2006, 08:45 AM
Greetings,

Many times I have run installation programs and they have determined that the program being updated is running or that files are currently attached by the OS and that a reboot may be need to complete the installation.

My questions are...
1. How does one properly and reliably detect if the program is in-fact running?
2. Based on #1 above, can you catch it if the executable has been renamed?
3. How do you determine if a .dll or other file is attached and a reboot needs to be done to properly complete the installation?

Any guidance would be most appreciated.

Regards,
Keith

Eagle
03-31-2006, 09:43 AM
Hi, below may get you started with #1 and #2
as for #3 look into the boolean action 'file.isinuse' and
the builtin global boolean '_NeedsReboot'
(SUF7 covers target files inuse by default --have a look at your project settings)

you could explore file.getcrc, size and other file version specs of a target file.

you will need to get into the actions and Lua scripting for your purposes

http://www.indigorose.com/forums/showthread.php?t=15320

hth a little

Adam
03-31-2006, 10:29 AM
Keith,

1) Use File.IsInUse() to detect if a file is running. Setup Factory does handle this for you if the file that is running is part of the install package.

2) You would have to know what the file has been renamed to, or if the file does not change location you could use a File.Find() action to get all files of a certain type in a folder.

3) _NeedsReboot will be set to true if a reboot is needed.

Adam Kapilik

TJS
03-31-2006, 11:03 AM
1) Use File.IsInUse() to detect if a file is running. Setup Factory does handle this for you if the file that is running is part of the install package.


I was going to suggest the Windows.EnumerateProcesses() approach, but I guess that is much simpler... I think I have a couple programs where I should go yank out some code/regkeys now.