kwantum

runwait and shellexecutewait aren't waiting

4 posts in this topic

Hello,

I am trying to write an autoit script to install software. The software installation is a silent install that runs setup.exe with some parameters.

It runs fine from a cmd prompt and with a batch script. I am converting to autoit so the installation media can be downloaded and extracted to the correct place and eliminate a lot of user error in this process.

I have one autoit script that downloads the media and extracts the zip. That script calls a helper autoit script. The helper script has

#RequireAdmin.

$instparms = " /s /v"

ShellExecuteWait("C:\Temp\setup.exe", $instparms)

I have tried using our old batch script with shellexecutewait. The script keeps running and doesn't wait. I have a pop up at the end to report if the install succeeded or failed. As soon as the zip file uncompresses and the helper script is called, I get the pop up saying the install failed.

I also tried runwait and and processwaitclose. In task manager I can see setup.exe and the helper script still running.

I can get the script to work by adding in sleeps but I would prefer not to go that route.

Any ideas?

Thank you

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

kwantum,

See this thread.  Applies if you are running the script from SciTE.

kylomas

edit: Don't know of a workaround.  Search the forums.  I'm sure this has come up before.

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

@kwantum, welcome to the AutoIt forum.

9 hours ago, kwantum said:

In task manager I can see setup.exe and the helper script still running.

so the helper script is obviously working correctly. now, i assume the pop-up message is displayed by the master script; in that case, the master script should be calling the helper script also using a RunWait() or similar statement.

also, beware of UAC issues - i advise you run the master script as admin, at least for testing. also read this topic carefully:

 

Share this post


Link to post
Share on other sites

If it doesnt work that means your process starts another and then exits, instead of runwait use run, processwaitclose, processlist and then check for parent process pid.

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