[DUG] Renaming file in use
Kyley Harris
kyleyharris at gmail.com
Sat Dec 3 21:08:41 NZDT 2005
Sounds like there are lots of eggs in the basket.
You have your own app, mutexes and a 3rd party app all of which could be
having an
impact on something not appearing to work. Do you test the result of
shellexecute to
determine the failure? perhaps it ran and exited for some reason or other
that you are
missing.
Like anything, you only need one line of code out of place to make a
simple process become a
failing process. timing and position is everything.
On Sat, 03 Dec 2005 16:15:47 +1300, Ross Levis <ross at stationplaylist.com>
wrote:
>> ShellExecute works fine. It is not posting a message. ShellExecute
>> will
> not return until the new process is spawned. Also, I am passing 0 as the
> first param.
>
> I'm doing exactly this to run a silent Inno setup install. On some
> slower PC's the setup executable often did not load. After inserting a
> sleep, it did always load, but this caused problems with the program
> still being open when the setup attempted to install the file.
>
> Semi related to this, I am using a Mutex while the app is running to
> prevent another instance, and also to use the feature in Inno Setup to
> warn that the program is running during install or uninstall. My app
> specifically releases the mutex well before the ShellExecute but this
> doesn't seem to take effect, even with ProcessMessages and sleeps after
> the release, Inno still says the program is running. And this occurs
> mostly on faster PC's. I would have thought the mutex release would be
> instant, so I'm bemused by this one as well.
>
> Ross.
>
More information about the Delphi
mailing list