Jump to content

Installer Automation


Recommended Posts

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!!

Link to comment
Share on other sites

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
Link to comment
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!

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...