3

I'm trying to install required software for integration tests. I'm having trouble with my install script though since the installer doesn't have a silent mode. It's an EXE rather than an MSI if that makes a difference.

Here is what I have currently:

- ps: "curl $env:DOWNLOAD_URL -OutFile $env:TMP\\$env:DOWNLOADED_FILENAME"
- ps: "& $env:TMP\\$env:DOWNLOADED_FILENAME"

When I run this in PowerShell on my local machine it launches the installer but I can't see any way to send keys (I need to send something like Alt+N, Alt+A, Alt+N, Alt+I, Alt+F).

The installer is for EnergyPlus building energy simulation software.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Jamie Bull
  • 12,889
  • 15
  • 77
  • 116
  • Pretty much every exe installer has command line arguments. Can you let us know what installer are you trying to use? In general "/S" is a safe option to start with. – Andrey Marchuk Jun 01 '16 at 10:30
  • Edited to add a link - but it looks like `/S` is working. Thanks! – Jamie Bull Jun 01 '16 at 10:50
  • 1
    My experience is that starting with `installer.exe /help` will give a nice place to start. When `/help` does not exist there tends to be at least a useful error message. – Farway Feb 07 '19 at 10:36

1 Answers1

3

Try /S, this works for most cases. If, however, the installer is async, you can do trick like this, to make powershell wait for installer to exit:

start "" /wait "EnergyPlus-8.4.0-09f5359d8a-Windows-i386.exe" /S
Andrey Marchuk
  • 13,301
  • 2
  • 36
  • 52
  • 2
    I used `- ps: "& $env:TMP\\$env:DOWNLOADED_FILENAME \S | Out-Null"` which also works to make powershell wait since it's doing something with the output. – Jamie Bull Jun 01 '16 at 13:03
  • More expressive notation of the powershell command: `Start-Process -FilePath "EnergyPlus-8.4.0-09f5359d8a-Windows-i386.exe" -ArgumentList "/S" -Wait` – Farway Feb 07 '19 at 10:32