Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
723 views
in Technique[技术] by (71.8m points)

wix - Microsoft Installer command line string parameter not working?

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 tried using single quotes ' and double quotes "

msiexec /i 'My Installer.msi' /quiet JREPATH="c:\BLA BLA"

This and also the single quotes return this :

enter image description here

Now according to this article : https://docs.microsoft.com/en-us/windows/desktop/msi/command-line-options

it should work...

Property values that are literal strings must be enclosed in quotation marks. Include any white spaces in the string between the marks.

msiexec /i A:Example.msi PROPERTY="Embedded White Space"

There is no problem with the MSI, I assume this because if i pass a number..it works...

msiexec /i 'My Installer.msi' /quiet JREPATH=3

LATER EDIT:

It seems that the problem appears when I have a space in the value of the parameter..for example something like the example below works :

msiexec /i "WKFS ReportGenerator.msi" /quiet JREPATH="c:\;;BLA"

This however doesn't:

msiexec /i "WKFS ReportGenerator.msi" /quiet JREPATH="c:\;;BLA a"

LATER EDIT 2:

These commands including spaces in the value work if using a simple cmd instead of PowerShell..

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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`"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...