0

I am setting up an automated deployment of a very old software. It's so old that there is no silent install option. I've checked the installer with ProcessExplorer and confirmed there were no silent switches in Strings. To get around this, I am installing the components manually.

My goal is to have my deployment software call a PowerShell script which calls the installer, then moves the mouse to the next button, and goes through the motions as an end-user would. I already have the deployment software performing the preparation steps, and calling the program installer. It will need some wait functions to account for different processing times among different computers. And it would need to be able to handle the script being called on computers with different sized screens.

Is this possible?

  • Is this possible? Yes. Here are some example ways of sending mouse coords and clicks from powershell: https://stackoverflow.com/a/46258874/7411885 **But** this won't be easy or foolproof. For example, can you guarantee where the wizard will show up on the screen? What if the PC has multiple monitors? This kind of thing also probably has to run as the logged-in user, which makes it bad for software deployments. – Cpt.Whale Mar 11 '22 at 20:53
  • 1
    An alternative for ancient installers like this without a decent silent installation feature: repackaging the installer. There is a lot of software available that can watch an installation process and build a silent version. – Cpt.Whale Mar 11 '22 at 20:57
  • Hello Jason, maybe is not an alternative for your case, but moving the mouse to certain coordinates and clicking stuff can be easily done using AutoHotKey which can be easily bundled with the script and called from it. – francisco.l Mar 11 '22 at 23:10

1 Answers1

0

As already commented - using a mouse won't be that easy with the requirement to make it work on different computers (screen size...). If PowerShell is required, you might try to use send keys:

Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.SendKeys]::SendWait("%n{TAB}{ENTER}")

Source: Send Keys in Powershell alt+n {TAB} {ENTER}

I know software deployment tools (baramundi for example) might have built-in scripting capabilities to automate something like that, but you can built your own application that helps you with your installation. With Autoit you can create almost bulletproof installer if your installer is compatible. Just get Autoit, try if you can use the finder tool within "AutoIt Window Info" (try both x86 and x64). If it can directly "find" your buttons, you need you can wait for that window, and that button and then press it with controlClick function: https://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm

Third way - the best solution especially for old software - depending on the installation routine you might build your own installer. In some cases, copying the necessary folder, files, and registry entries might be enough. For other cases you might monitor your installation process with Procmon and do the other things that happen during normal installation. https://learn.microsoft.com/en-us/sysinternals/downloads/procmon Also using Procmon in a try and error deployment might be enough for you. Just copy the installation from a working client try to start the application, read the error message, and solve that with the help of actions you see that happened/failed in procmom.

ouflak
  • 2,458
  • 10
  • 44
  • 49
An-dir
  • 465
  • 2
  • 13