Hi Friedrich,

A mutual client has run into a problem with some code that I use to
run programs. It doesnt' work with Wupdate.exe on his XP machine.

After some digging into this, I have found out that the code I use -
which uses ShellExecuteEx, WaitForSingleObject etc. - does NOT work
with Wupdate.exe if the program is not called with parameters. If it
is called with parameters, then everything is fine. This behaviour is
present on both XP SP2 and Vista Home Premium, both with all the
latest updates applied.

What seems to happen is that if Wupdate is called without parameters,
it waits for the calling process to terminate. When I terminate the
process using the Task Manager, the Wupdate.exe pops up immediately
after the calling process is terminated.

My code works properly with all other programs that I have tried it
with and I (and others) have been using this for about 6 months now
without issues.

http://www.buildautomator.com/stuff/...RunProgram.zip

This file includes a Clarion 6.3, 9058 application and the compiled
EXE. Run the exe and select a wupdate.exe and check the Wait
checkbox. The program will attemt to run wupdate.exe but stops as
it's waiting for wupdate.exe to terminate. Wupdate.exe OTOH seems to
be waiting for test.exe to terminate before it continues. Now try it
again with the "/C /S" parameters and it will run fine.

I can run any other program with this test.exe, including the Setup
Builder IDE without any issues.

Since I never call the Wupdate.exe with the wait parameter without
using the /S /C parameters also I have never run into this myself.
Just for fun I tried this on a wupdate.exe from SB5 and it produced
the same results.

I tried to run the BuildAutomatorInstall.exe from the Test.exe and let
it wait and there I also get the same results. The install doesn't
show until I terminate Test.exe. When test.exe disappears from the
task list in Task Manager the install appears immediately.

On my quest to execute installs, I'm realizing that installs build
with earlier 4.0, 5.5 or 6.x (6.6 2040 in the htm reported on a file
that does work) do NOT show this behaviour. New installs that are
compiled in the latest build DO show this behaviour. I have tried to
run several installs that I have and were not created with SB and none
of them shows this behaviour when run with wait turned on. It seems
that this behaviour started in the installs sometime during 6.7-6.8
and they now also behave like wupdate.exe

I dont' make much sense of it, but it seems that you cannot run exes
created in Setup Builder from a different process and use
WaitforSingleObject() to wait for it.

Best regards,

Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com


Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php