Sign in to follow this  
Followers 0
Trompu

Installer Automation

8 posts in this topic

Hello everyone, I wanted to create some installer automations and I was pointed this way, so I read a few documents and started coding but I can't seem to get past step 1 unfortunately.

For the moment I'm trying to create a simple automation to click "Next" "Next" etc. on a freeware program (http://www.dvddecrypter.org.uk/SetupDVDDecrypter_3.5.4.0.exe)

I couldn't even get past the first screen yet, this is my code

ShellExecute("F:\FER\Fernando\Instaladores\DVDDecrypter_3.5.4.0.exe")

WinWaitActive("DVD Decrypter 3.5.4.0 Setup")

Send("!n")

I also tried changing the las command (send) to:

Send("{ENTER}")

or to:

ControlClick("DVD Decrypter 3.5.4.0 Setup","","[CLASS:Button; INSTANCE:2]")

But none of those worked either, I would really appreciate some help, thanks!!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Glad to see others struggled at first...

I tried this quickly on a Windows 7 32bit machine and this is the code i got for the first part...

(Run and ShellExecute both just run the program, so dont worry about changing that)

#RequireAdmin

Run("DVDDecrypter_3.5.4.0.exe")

WinWaitActive("DVD Decrypter 3.5.4.0 Setup")

Send("!n")

WinWaitActive("DVD Decrypter 3.5.4.0 Setup")

Send("!n")

WinWaitActive("DVD Decrypter 3.5.4.0 Setup")

Send("!I")

...

The only thing i would do is tighten up the WinWaitActive to include text from the window so you know the command goes to the right window.

Edited by Mystroth

Share this post


Link to post
Share on other sites

The Run() is not working for me, but replaced it with my previous ShellExecute() and it worked, my question is, why is that line in the begining #RequireAdmin so important?

Because I found out that it's the difference between a success and a failure

Thanks!

Share this post


Link to post
Share on other sites

When building installers - avoid at all cost using send. Try first to see if the installer supports command line switches. Another option is to see if the installer supports answer files. Third, if you have to interact directly with the controls on an installer try to use controlsend. Only use send if you have no choice.

The reason for this is simply you want to the install package to be as stable as possible. If you use send and anything happens such as a window loses focus or the app hangs, then the entire script fails.

Share this post


Link to post
Share on other sites

I got it to work with

ControlClick("DVD Decrypter 3.5.4.0 Setup","","[CLASS:Button; INSTANCE:2]")

And found out my problem was the #RequireAdmin, but still don't know why

Share this post


Link to post
Share on other sites

the #RequireAdmin means that the program will have elevated privileges for the install. In Windows Vista, or 7 by default something will popup asking you for those permissions when it installs. When i installed DVD Decrypter it asked for elevated permissions, without those permissions the install would not work.

Share this post


Link to post
Share on other sites

I see, maybe it's because of the lack of signature to the installer, gonna keep on trying with this, thanks!!

Share this post


Link to post
Share on other sites

As MPH suggested above, automating installations is always best practice. One site that I always suggest is here, formerly AppDeploy.com. You can do a search of their database for an application (such as DVD Decoder), and find all the relevant command line switches for install/uninstall, plus any other notes from people who repackage software on a daily basis.

I also suggest a repackaging tool such as WiX (free) or Admin Studio (21 day trial). With a repackaging tool you can bundle your application into an MSI, and then it is a very simple process to install it with ShellExecute.


√-1 2^3 ∑ π, and it was delicious!

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