1

Hi I'm wondering if it's possible to create application installers for MSI's. What I want it to do is when I run an MSI I want to be able to run it in it's own process so I can reference it via it's process ID so I can send various keys to it so it installs the way I want it too.

I can code in both C and Java but for the Sys Admins would be good if I could code it in Powershell for them. Also I've seen other installers that can detect when the next instance of the install screen appears so it immediately send the new command keys, well appears that way.

Any advice is welcomed.

Sébastien
  • 11,860
  • 11
  • 58
  • 78
Elijah
  • 13
  • 1
  • 3
  • We need some more information. Are you looking to take an existing MSI installer and automate the installation with Powershell? – Adam Bertram Nov 03 '13 at 02:25

1 Answers1

3

MSI's traditionally allow for admins to provide an answer file or arguments using msiexec. See this q/a on SuperUser or this SO Q/A for more info.

You can then use PowerShell to call the exe's by using the 3rd party Windows Installer PowerShell Module .

[The Windows Installer PowerShell Module] Exposes Windows Installer functionality to PowerShell, providing means to query installed product and patch information and to query views on packages.

for example:

install-msiproduct .\example.msi -destination (join-path $env:ProgramFiles Example)

See this page for additional examples.

If you need to send keystrokes to the msi gui; you could look in to the Windows Automation Snapin for PowerShell. I have never used this personally.

Community
  • 1
  • 1
Chad Carisch
  • 2,422
  • 3
  • 22
  • 30
  • Thanks for your replies.. What I want to do is launch the MSI with no quiet switches so I can 'send keys' to it. The MSI command switches doesn't provide me with the customization I'm after. – Elijah Nov 03 '13 at 03:08
  • Thanks. That's what I was after – Elijah Nov 03 '13 at 04:18
  • The Windows Installer PowerShell Module has now moved here: https://github.com/heaths/psmsi (since codeplex is dead). – Jamey Nov 19 '19 at 11:27