Sign in to follow this  
Followers 0
thawee

Error Launching the same application back to back

6 posts in this topic

#1 ·  Posted (edited)

I realize this will be a tad vague, but I do think the issue can be thought through without detailed code.

I install my application using ShellExecuteWait - From what i understand the script stops until the Shell has finished with what it needs to do then proceeds.

After the install finishes, I try to launch it using Run()

I then get an error that the application is already running.

I have tried putting a sleep timer between when it installs the application and then runs it, but this seems limited. I don't think this will work every time because the length of the sleep statement really sleeps for is somewhat dependent on how fast the computer is handles the sleep statement.

When i have tried using the sleep statement sometimes i get the application is already running error and sometimes not depending on the speed of computer.

I have also tried creating a loop to read the process ID, and wait for it to close before the script continues, but this still doesn't work. I have come to the assumption that Microsoft windows has a generic bug. It shuts down the process ID before it finishes unloading the application from memory resulting in my program colliding with itself.

Thanks for your help.

Thawee

Edited by thawee

Share this post


Link to post
Share on other sites



Isn't it the case where the install program you launch does run its own child process(es)? In that case the install program may well finish, close, return while there are cild process(es) not yet finished.

Maybe a bit of monitoring with process explorer will reveal what happens in your case.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

that may be the case, it sounds very logical.

do you have any ideas on how to compensate for this?

Share this post


Link to post
Share on other sites

Monitor for the PID to close, then check for any remaining processes with the same PPID (Parent-PID).

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

You need to investigate to determine which process the install program is going to launch, and use Run instead of RunWait so that you get control as soon as the Installer runs. Then you should be able to use ProcessWait and ProcessWaitClose. See helpfile for usage.

That's likely to be the cleanest way to deal properly with such situation. This is also along the lines of the last remark under the RunWait function in the helpfile.

I'm not saying that this is always the case, nor that the sketch above will solve your issue, but many installers merely run an unpacker, which drops (say) an .msi file which is then "shellexecuted" or something like that.

Edit: ... or use the idea of our MVPenguin!

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

alrighty.. :P

thanks for the heads up.

I will post back when i have a solution that works :mellow:

Take Care

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0