Creating a response file for msi installer - automation

I have an .msi installer that I am trying to automate the installation for. I cannot use the /quiet option for a silent install because I need to provide the installer a license number.
I've been trying to use the SAVEINI parameter to create the response file
msiexec /i "Installer.msi" SAVEINI="response_file"
msiexec /i "Installer.msi" SAVEINI="response_file.ini"
msiexec /i "Installer.msi" SAVEINI="C:/Windows/LTSvc/packages/Installer/response_file"
None of these create the response file the install runs and then no response file is created.
Any help would be greatly appreciated and thank you in advance for your time.

Windows Installer doesn't have the concept of a response file. Instead you pass public properties at the commandline or generate a transform and apply it at install tine.
https://learn.microsoft.com/en-us/windows/win32/msi/about-transforms

Related

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 :
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)

Set WIX MSI Package to write log to same file as the bootstrapper/burn log file

I have a log file that is written to the installation directory by the MSI. This log file contains code I've written to help with troubleshooting installation issues within the MSI package. The bootstrapper also has its own automatic log file. Is there a way for me to set my MSI to log to the same file as the bootstrapper?
Why do I want to do this?
If an install fails, the bootstrapper displays an error screen with a link to the bootstrapper's log file. This is the information my clients send me when they have problems during installation, but this information is useless to me. I'd love it if this log could also capture all of my MSI troubleshooting information.
You can get the path of yout bootstrapper file and store it in a variable , then when u executing the msi file
"/c msiexec /i Blabla.msi /L*v bootstrapperLogFilePath"

how to create installation log file in Target folder in wix

i am using the following command to see the logs in wix installer.
msiexec /i "D:\WixProjects\DFServicesWixSetup\DFServices\bin\Debug\DFServices.msi" /L*V "D:\DFServices.log"
but this command is trying to install the msi again.
I want to execute this command from wix after finishing the installation and log file need to save in installed folder.
can any one help me on this.
You need to decide in advance if you want Windows Installer to make a log file. You also need to decide in advance where it should go. If you want it to end up in the install folder then you either need to copy it there after installation or specify the install folder in advance, too.
In Windows Installer folders are controlled by properties. You can specify such properties in the command that starts installation. The name of the property for the "install folder" depends on how the installer authoring; INSTALLFOLDER is one typical name.
So, you could do this with a command like this:
msiexec /i "D:\WixProjects\DFServicesWixSetup\DFServices\bin\Debug\DFServices.msi" /L*V "D:\path\DFServices.log" /qb INSTALLFOLDER="D:\path"
The /qb switch is reduce the UI such that the user is offered the chance to change the installer folder. It may more may not be need for your installer, depending on what dialogs its UI normally shows.
So, the first step is to figure out which property sets the install folder in your installer.

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"