With msiexec, what's the difference between these different ways to direct to the installer?

前端 未结 2 1468
灰色年华
灰色年华 2021-01-27 07:41

I\'ve got a simple problem. I\'ve only found two ways that will actually run my msi file, and neither of them will work.

Pay close attention to my usage of \'

2条回答
  •  逝去的感伤
    2021-01-27 07:55

    PowerShell Module: There is now a Windows Installer PowerShell Module courtesy of Heath Stewart of Microsoft. I haven't tested it much, just a smoke test. See below for another alternative using MSI API directly via COM.


    Re-Quoting: I saw someone write a lot about PowerShell and escape sequences. It looks pretty complicated: Setting Public Property Values on the Command Line - there were other posts too.

    Alternatives?: Perhaps you can go via MSI API COM calls? I have this old answer on various ways to uninstall MSI packages. I'll see if I can dig up a PowerShell example, in the meantime here is a VBScript version using MSI API COM calls:

    Set installer = CreateObject("WindowsInstaller.Installer")
    installer.InstallProduct "C:\Product.msi", "REBOOT=ReallySuppress"
    

    There is also WMI - which I never use. See section 10 here.


    Link:

    • Different ways to invoke MSI
    • https://github.com/heaths/psmsi
    • Get the Windows Installer PowerShell Module easier with WMF 5.0
    • Other answers: 1

提交回复
热议问题