On Windows 10, I have tried to do a silent install of an msi package, but the install simply fails without any error.
Here are my commands to get the msi in zip format, unzip, and then install.
wget -q http://kakadusoftware.com/wp-content/uploads/KDU805_Demo_Apps_for_Win64_200602.msi_.zip
cmake -E tar -xf KDU805_Demo_Apps_for_Win64_200602.msi_.zip
msiexec /i KDU805_Demo_Apps_for_Win64_200602.msi /quiet /qn /norestart
Edit: I logged output to file, and found this error
MSI (s) (64:AC) [09:15:20:332]: Product: Kakadu Demo-Apps -- Error 1925. You do not have sufficient privileges to complete this installation for all users of the machine. Log on as administrator and then retry this installation.
The Windows Installer is a "Windows application" (as opposed to a "console application") which means starting it from the command-line will not cause the console to wait. To wait, you need to explicitly wait for the process to exit. One easy way is:
start /wait "" msiexec /i KDU805_Demo_Apps_for_Win64_200602.msi /qn /norestart
Note: The empty string "" is important if you ever need to quote the command-line to start. Otherwise, the start command will use your quoted command-line as the title of the created window (crazy, I know, check start /? for the details).
Related
I want to install "foo.msi" from cmd command line. I run:
msiexec.exe /qn /i .\foo.msi
It returns almost instantaneously and foo.msi does not get installed. I'm not sure what I'm doing wrong.
To root out the causes of error, I ran:
msiexec.exe /qn /i .\doesNotExist.msi
And got the thing. It returns immediately. No complaints about not being able to find the .msi or anything.
Does anyone know the proper way to use msiexec.exe to install an msi from windows cmd command line?
msiexec runs asynchronously. If you want to wait for it to complete its work, use:
start /wait msiexec /qn /i .\foo.msi
In this case, the first step to run your command with the logs option as below:
msiexec -i "foo.msi" /qn /L* "d:\logs\log.log"
Check the logs for errors. When I faced this, the issue was missing property values. That can be pass like below:
msiexec.exe /i "foo.msi" MYPROP1="myValue1" MYPROP3="myValue2"
I'm trying to write a command in a bat file to run an installer exe file. The important part is to start and run the installer in silent mode. To clarify, I DO NOT want the user to see the installer and click through the wizard. They should just be able to double click the bat file and walk away. I have attempted this command in my bat file:
#echo off
REM Next command runs installer in silent mode
start /d "%USERPROFILE%\Desktop" MyInstaller_7.1.51.14.exe –s –v –qn
The –s –v –qn are supposed to enable the installer to run in the background, but they are not working.
Can anyone help me improve my command in my bat file so that MyInstaller_7.1.51.14.exe is indeed running in the background, silently, with no UI or wizard of any kind visible to the user??
Please help.
You can try one of these START command options to see if it gives you the effect you want:
/B = Start application without creating a new window
/MIN = Start window minimized
Edited:
Try putting the command with its switches inside quotes:
start /d "%USERPROFILE%\Desktop" "MyInstaller_7.1.51.14.exe –s –v –qn"
Another solution you can test :
Create a file RunHide.vbs and put this line in it :
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
and then run your batch file like this :
wscript.exe "RunHide.vbs" "Install.bat"
and your batch file will be run without any windows (and maybe your Installer to)
I finally figured it out.
Here is the correct code:
#echo off
REM Next command runs installer in silent mode
start "%USERPROFILE%\Desktop" MyInstaller_7.1.51.14.exe /s /v /qn
The change was between –s –v –qn and /s /v /qn where the former does not work, and the latter does.
I create a script to auto install all my dev stack on Windows.
I have a problem with Node.js
What's the command line to install node-v0.10.23-x64.msi in C:\Tools silently?
Thanks.
I found it.
This is the correct way to install Node.js on Windows silently in a custom directory.
msiexec.exe /i node-v0.10.23-x64.msi INSTALLDIR="C:\Tools\NodeJS" /quiet
msiexec.exe /i node-v0.10.23-x64.msi /qn
/i means normal install
/qn means no UI
I do not known how to set the destination, you can read documentation here, and check if msi supports it:
http://www.advancedinstaller.com/user-guide/msiexec.html
This will do the exact installation as doing it manual from the UI
msiexec /i node-v6.11.2-x64.msi TARGETDIR="C:\Program Files\nodejs\" ADDLOCAL="NodePerfCtrSupport,NodeEtwSupport,DocumentationShortcuts,EnvironmentPathNode,EnvironmentPathNpmModules,npm,NodeRuntime,EnvironmentPath" /qn
To expand a little on foozar's answer, which works.
msiexec.exe /i node-v0.10.23-x64.msi INSTALLDIR="C:\Tools\NodeJS" /quiet
Note that /quiet may be better replaced with /passive:
Passive shows the status bar, and more importantly, prompts the user for the admin password if needed.
Quiet mode will just fail if the installer doesn't have privileges.
How do I install to a non default web site with a silent MSIEXEC installation?
Given the lack of information in your question, all I can say is something like this:
msiexec /i YOURPACKAGE.msi /qn
If you need to pass parameters, you can define them on the commandline:
msiexec /i YOURPACKAGE.msi /qn THISWEBSITE=http://example.com
I have the following problematic scenario:
Problematic Scenrio Description Begin---------------------------
I use msiexec to install a package in quiet mode in the following way:
msiexec /i c:\mypackage.msi /quiet
Now I have the package installed. Let's say I entered the command above again:
msiexec /i c:\mypackage.msi /quiet
Problematic Scenrio Description End---------------------------
Now since the package is already installed, the installation should fail. But I have no indication for that.
I use the log option in order to get a log going:
msiexec /i c:\mypackage.msi /quiet /l* log.txt
When errors occur I do see them in the log but in the scenario depicted above the log is empty. There is also nothing written to the system event log. So my question is, How can I get an indication that the installation (The second one) didn't go?
Notes:
I am not willing to solve this problem by writing a batch script that will check if the package is installed prior to the call to msiexec. The reason is that it contradicts our customer deployment requirements.
I have a DLL custom action data, in the second time, the DLL is not activated so I can't use the DLL in order to write the failure somewhere.
Installation does not fail if the package is already installed, it was "successfully reconfigured"
In order to check if a Windows Installer package is installed on the system or not, you're best to use the Windows SDK (not a batch file) - here's a sample script that iterates the list of installed products and triggers MSIEXEC if it is not already installed. (This example searches by name, alternatively you could search by package code)
Option Explicit
Dim productName:productName = "My Awesome Product"
Dim installer : Set installer = Nothing
Set installer = Wscript.CreateObject("WindowsInstaller.Installer")
Dim productCode, property, value, message
For Each productCode In installer.Products
If InStr(1, LCase(installer.ProductInfo(productCode, "ProductName")), LCase(productName)) Then Exit For
Next
If IsEmpty(productCode) Then
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
WshShell.Exec("msiexec /i mypackage.msi /qb")
Else
Wscript.Echo productName & " is already installed."
Wscript.Quit 2
End If
Is it your package? If so, put in a prerequisite condition that checks if some key file or registry entry doesn't exist yet.
If it's not your package, wrap it in something (another installer or an exe) that will make the check.
I know this is old thread, but google hits this up and in benefit of others try this
start /wait msiexec /i c:\mypackage.msi /quiet
If error, echo %errorlevel% will be non zero. If calling above programmatically use GetLastError()