Microsoft Installer command line string parameter not working? - wix

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 :
Now according to this article : https://learn.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..

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

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)

Related

How to pass msiexec command line options to Wix

I have a Wix Installer, Product.msi, which launches a setup.exe via Custom Action. When I execute my Installer through Command Prompt, for example:
msiexec /i Product.msi /q
or
msiexec /r Product.msi /q
or
msiexec /x Product.msi
I would like to pass /i /r /q /x options to setup.exe
Is it possible to achieve this through Wix Toolset?
The flags you mention all set properties for the MSI, which you can then reference in your custom action, converting to whatever format you need for your setup.exe.
For instance:
/i corresponds to the value of Installed being false (if the product isn't already installed).
/r corresponds to a value of "Repair" on the WixUIInstallMode property.
/x corresponds to a value of "Remove" on the WixUIInstallMode property.
/q (and its modifiers like /qn and /qb) correspond to the UILEVEL property, which has the following values found from this link.
UILevel:
INSTALLUILEVEL_NONE 2 Completely silent installation.
INSTALLUILEVEL_BASIC 3 Simple progress and error handling.
INSTALLUILEVEL_REDUCED 4 Authored UI, wizard dialogs suppressed.
INSTALLUILEVEL_FULL 5 Authored UI with wizards, progress, errors.
You can see this answer if you're unfamiliar with passing values and referencing them in a custom action.

WiX bootstrapper silent install with custom /a argument

Is it possible to initiate a silent installation of a WiX bundle through the use of a command line argument in the format of /a or /arg?
I'm aware of the available command line arguments accepted by the wixstdba bootstrapper.
Specifically, we need to do this using the argument /s /v/qn argument.
NB: Executing the bootsrapper with the command line setup.exe /s /v/qn actually does initiate a silent install, and I assume this is because the BA interprets the /s as equivalent to -s. But since I can't find this behaviour documented anywhere, I am nervous about relying upon it, and would prefer an explicit method for doing this.
TL;DR
The reason we would like to support this argument /format is due to the automatic upgrade operation of a previous version of the software. This version of the software launched an automatically downloaded upgrade to itself, which was an InstallShield package, with the switches /s /v/qn to launch the MSI as a silent installation. Those switches are coded into a constant field, so the fact that we are moving from InstallShield to WiX presents this problem.
We would like to replicate this functionality but need a way to translate this set of arguments to either a -silent or -passive argument, or find some other method to accomplish this task.
Burn supports both - and / as switch characters. Silent UI mode is supported as q, quiet, s, and silent with leading - and /. See the code at https://github.com/wixtoolset/wix3/blob/develop/src/burn/engine/core.cpp#L1098.

ProgramFilesFolder Set to C:\ when using /a switch for msiexec

I have an .MSI installer that I created using WIX and works fine when opening the file from windows explorer or installing from a command window using msiexec /i. The problem is that I need to use /a to install it using a group policy when the computer turns on.
When using the /i option the ProgramFilesFolder value is set correctly to "C:\Program Files (x86)\".
When using the /a option the value of ProgramFilesFolder is set to "C:\", and then I get an error (on the Log) that says:
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2203. The arguments are: C:\Referrals.msi, -2147287035,
Note: I am not running the .MSI file from "C:\"
Try
msiexec /a TARGETDIR="c:\temp\location" /passive
I think you may have the msiexec.exe command line mixed up: /a is admin install. This is essentially a command to create a network installation point with extracted files to use for installation on a lot of computers. This ensures the source files are available for patching, self-repair, repair, reinstall, etc...
To deal with advertisement and group policy you need to use these command line options. So a very basic operation would be advertise product to all users silently and write a log file:
msiexec.exe /JM "Installer.msi" /QN /L* "C:\msilog.log"

Writing log file in temp folder by IExpress

I'm using IExpress to generate .exe installer.
I want to make it generate log file into temp folder like this.
msiexec /i MyPackage.msi" /l*v "%temp%\MyPackge.log"
but after a bit of research I found that IExpress use command.com not cmd.exe so that it doesn't understand %temp%
So, I try changing it to
cmd.exe /c msiexec /i MyPackage.msi" /l*v "%temp%\MyPackge.log"
it seems work but there is a command prompt appears while installing which is not nice at all.
Anyway to fix this ?
you can choose to install /q quiet with no UI and /norestart options
msiexec command line options http://msdn.microsoft.com/en-us/library/windows/desktop/aa367988%28v=vs.85%29.aspx
You can hide the cmd.exe window by changing the Show window option to Hidden in the IExpress Wizard. In the .sed file, this would be:
ShowInstallProgramWindow=1
I end up with this.
msiexec /i MyPackage.msi" /l*v "..\MyPackge.log"
because the .msi has been extracted to %temp%\MyProduct, that's why I can use "..\MyPackage.log"

Silently install Apache through Advanced Installer

I am trying to silently install apache using Advanced Installer 8.9, but it is still prompting me for user interaction even though I pass the command parameters in the Silent (No UI) field.
msiexec /i "httpd-2.2.22-win32-x86-no_ssl.msi" /qn /passive ALLUSERS=1 SERVERADMIN=admin#localhost SERVERNAME=localhost SERVERDOMAIN=localhost SERVERPORT=80
What can I do to solve this?
The parameters set in "Silent (No UI)" field are used by the prerequisite only if the bootstrapper is running with silent UI. If you want these parameters to be used for all the UI levels of the bootstrapper you need to set the same command line in all fields, i.e. Full UI, Basic UI and Silent (No UI).
Agree with #bogdan. Also, I noticed that you pass the entire msiexec command into the parameters. If you have specified apache as a prerequisite, you only need to pass the arguments of msiexec in the command parameters, e.g. /qn, /passive etc. You shouldn't pass "msiexec" as command line parameters.