Microsoft Installer command line string parameter not working?

后端 未结 2 1349
再見小時候
再見小時候 2020-12-04 03:36

So I am trying to run a quite installation, with my msi, and it seems like I can easily pass a number for a parameter that I have, but I can\'t seem to pass in a string...I

相关标签:
2条回答
  • 2020-12-04 04:00

    If you invoke from Powershell, you should use the call operator & This should then also work with parameters enclosed in quotes:

    & msiexec /i `"My Installer.msi`" /quiet JREPATH=`"c:\BLA BLA`"
    
    0 讨论(0)
  • 2020-12-04 04:03

    UPDATE: Since this was related to PowerShell. See Windows Installer PowerShell Module on github.com (scroll down for description, use releases tab for download). I haven't really tested it much, but it is from Heath Stewart - Microsoft Senior Software Engineer (github).

    Brief, inline sample:

    install-msiproduct .\example.msi -destination (join-path $env:ProgramFiles Example)
    
    • How can I use powershell to run through an installer?
    • Get the Windows Installer PowerShell Module easier with WMF 5.0

    The below was written before I realized that this was related to PowerShell.


    Quick Suggestion: Maybe try this command line:

    msiexec.exe /i c:\setup.msi /QN /L*V "C:\Temp\msilog.log" JREPATH="c:\MyPath"
    

    Get rid of the double \\ in the path you specify (could be enough), and use the old style /QN switch instead of the /quiet switch. Some elaboration and details below.


    Silent Installation: What installer is this? Is it a vendor package? Some sort of Java application I presume? This is how to install a normal MSI file silently:

    msiexec.exe /i c:\setup.msi /QN /L*V "C:\Temp\msilog.log"
    

    Quick explanation:

    /L*V "C:\Temp\msilog.log"= verbose logging
    /QN = run completely silently
    /i = run install sequence
    

    msiexec.exe: There are two types of switches for msiexec.exe - the old fashioned ones such as /QN (Command-Line Options) for silent installation which matches the newer /quiet that you are using (Standard Installer Command-Line Options).

    To add properties you do as you have already done, add it to the command line:

    msiexec.exe /i myinstaller.msi ADDLOCAL="Program,Dictionaries" SERIALKEY="1234-1234" /qn
    

    Some Further Links:

    • How to make better use of MSI files (On how to deploy MSI files silently with or without transforms applied. First section only. The last section goes into a lot of details on other topics)
    • Batch script to install MSI (similar answer)
    0 讨论(0)
提交回复
热议问题