Jump to content

AutoIt Execution Query - (Moved)


Recommended Posts

Hi,

I have written a AutoIt script which will install an application and compiled it into exe. When I trigger the compiled exe manually from the command prompt it is triggering the installer and performing the installation successfully but if I trigger the same AutoIT Compiled exe file using tool like puppet etc we have observed the Autoit compiled exe as well Setup.exe is getting triggered but it is not doing the actually installation. Seeing this behavior it looks like we have to execute the Autoit using user interaction mode. I dont have any clue here. Can someone please help us here.image.thumb.png.e761bf398ad2a0ad58bd081d50c072ae.png

 

Below is the script.

#include <GuiComboBox.au3>
#include <File.au3>

$instance = $CmdLine[1]

Run(@scriptdir & '\setup.exe /s /f1"C:\Temp\retrive.iss"')
WinWaitActive("InstallShield Wizard")
Send($instance)
Sleep(3000)
ControlClick("InstallShield Wizard", "", "[CLASS:Button; INSTANCE:1]")
WinWaitActive("WebRetrieve Settings")
Sleep(3000)
ControlClick("WebRetrieve Settings", "", "[CLASS:Button; INSTANCE:20]")
WinWaitActive("WebRetrieveSettings")
ControlClick("WebRetrieveSettings", "","[CLASS:Button; INSTANCE:1]")

Link to comment
Share on other sites

I'm not famillar with puppet at all, though I imagine the probelm stems from the environment of that account doing the installing. If setup.exe can't produce a dialog to interact with, your script will obviously just hang.

As a test - if you deployed a straight "setup.exe" without switches do you see a dailog at all?

TBH though, virtually clicking through setup dialogs is probably not a great way of going about things for software deployment. Is there a reg value (or something) that corresponds to that "instance" param that you can modify after a silent install?? Just a suggestion.

 

Link to comment
Share on other sites

Hi Matty,

 

Thanks for the reply. This setup.exe is a installshield package. Not all the steps are silent. It require click until finish to complete the installation that is why we tried to automate this using AutoIT. While deploying remotely we encountered this issue. That AutoIt require interactive session to automate the click. This setup.exe is not having any silent flag etc. I tried all the possible way but still it is not working.

Link to comment
Share on other sites

If puppet is anything like SCCM, you can make the install interactive on the client. If so, don't use any silent flags in the installer, but rather use AutoIt to hide any installer windows. As @MattyD said, if the windows don't appear in a silent install, there's nothing to automate. But if AutoIt hides them, it can still interact with them.

Link to comment
Share on other sites

Thanks for the information. I apologies first that I have failed to clearly mention my problem statement. Let me give a try once again.

1) The Setup.exe which I am trying to automate is wrapped with installshield. We can record silent installation for install shield binaries. Refer below link.

https://docs.revenera.com/installshield24helplib/helplibrary/CreatetheResponseFile.htm#:~:text=You have the option of,file in the Windows folder.

2) Using the above link i have created silent response file  called retrive.iss. But here the problem is due to application limitation not all steps got recorded and it makes this application semi automated. when we run command Run(@scriptdir & '\setup.exe /s /f1"C:\Temp\retrive.iss"'). It will come to this screen below which further automated by AutoIT script.

image.png.c6973e8539ccdea9f6c71bbc5443b4ca.png

3) Now here thanks to AutoIT I could able to automate the remaining step using click on the GUI. Note: Setup.exe produce GUI and it need a click to complete the installation. AutoIT script is copied above. Please request you to refer.

- AutoIT script compiled to Retrieval.exe 

image.thumb.png.4edb13a814bc213171e4076d2c32e278.png

4) I have created a powershell script with command (Start-Process "C:\temp\Retreival.exe" -ArgumentList "Retrieve" -Wait -NoNewWindow -Passthru).ExitCode to call Retrieval.exe to do the installation. I tested running locally using RDP it is working fine as expected.

5) Now the problem comes when I try to deploy using Puppet, a kind of SCCM it triggers the installation on target client but it stuck. When I refer task manager I can see the process is running but nothing happens. I feel like the problem is that AUTOIT will work only if the session is interactive like we run locally with RDP but it is not working when we try to deploy remotely.

image.thumb.png.51653204a645e439cd3cfba1b6cb3e42.png

 

 

Link to comment
Share on other sites

It sounds like that dialog is a Custom Action in InstallShield and those are annoying because, more often than not, they break the unattended flag. I understand it's not AutoIt script help but it sounds like you'll have to repackage it for deployment. It's occasions like this that I always ask my employers to buy a license of either New Boundary's Prism Deploy Packager (Formerly known as PicTaker, my personal favorite) or Flexera's AdminStudio (pricy and complex but works well). Any delta capture style repackager should work; there are a number of free ones out there but I don't have any experience with them.

Edited by rsn
Link to comment
Share on other sites

If you show the "session ID" column in taskmanager It maybe attempting to install on session 0?  serviceui.exe may help with this to make the windows interactive.

but yeah I think time would be better served picking at that setup.exe.  I agree those installshield installers can be difficult, but half the time they just wrap an msi which is packaged internally. - so you can try to dig that out if its there!

Also, I vaguely remeber using a dissasembler online that could extract the actual install script?? so there's that avenue if my memory's not failing me!

I'm assuming you've tried these switches, but just to rule it out -  :) capital "/S" - case sensitivity has got me a couple of times with installshield.  also "/S /v/qn"

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