EddieR

Run setup.exe minimized or hidden

7 posts in this topic

#1 ·  Posted

I am trying to use AutoIt to automate some program installations from software vendors who refuse to provide MSI files and who also refuse to get into the 21st century with installers that have switches that allowed automated installs.  I would prefer to have the installers work without the employee having the chance of interfering. (Unlikely given how fast it executes with the ControlClick calls I am using.)

So I can launch Notepad either minimized or hidden without any issue, but when I launch the setup.exe program it still comes up in the foreground.  Is there an option I am overlooking or just unlucky.

Run("notepad.exe", "", @SW_MINIMIZE ) ; works

Run("notepad.exe", "", @SW_HIDE ) ; works

Run("setup.exe", "", @SW_MINIMIZE  )  ; does not work...program launches, but in the foreground

Run("setup.exe", "", @SW_HIDE  )  ; does not work...program launches, but in the foreground

Share this post


Link to post
Share on other sites



#2 ·  Posted

@EddieR welcome to the forum. We have a number of people on the forum with experience repackaging and automating deployments of applications (some of us longer than we can remember). If you can share the application, we can probably do more to assist. With nothing more than "Setup.exe", though, it is a bit difficult.

1 person likes this

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

Share this post


Link to post
Share on other sites

#3 ·  Posted

It all depends upon how the "Setup.exe" was created. Was it created using the Wise installer? Inno Setup? NSIS setup? Once you know this you can easily set the proper command line switches to make the program install silently. The software itself likely has documentation on how to do this.

In my experience, the macros within AutoIt seldom work when running another programs installation package.

1 person likes this

Who lied and told you life would EVER be fair?

Share this post


Link to post
Share on other sites

#5 ·  Posted

@youtuber if you read the OP he states very clearly that it is resistant to silent installs with parameters...

1 person likes this

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

Share this post


Link to post
Share on other sites

#6 ·  Posted

Unlikely given how fast it executes with the ControlClick calls I am using

I'm not sure you can use ControlClick if the window is minimized or hidden, I think the window must me visible.

One way is to use that kind of method :

Run("setup.exe")
Local $hSetupWindow = WinWait("title of the installation window")
WinSetTrans($hSetupWindow, 1)
ControlClick(....)

 

1 person likes this

Share this post


Link to post
Share on other sites

#7 ·  Posted

Methods  I have tried\used in the past are:

  • Disable mouse and keyboard using BlockInput
  • Move the window off the desktop area so it can't be seen. Obviously there can be issues with unexpected prompts which you can't see, thus pausing the setup.
  • Another is to repackage the installer, if it isn't a big one with tons of reg entries. Some are pretty simple

I have tried to minimise installers or hide windows, but some have spawned another process during install that showed a window anyway.

1 person likes this

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