msiexec doesn't install msi - cmd

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"

Related

msiexec silent install will fail without error

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

msiexec can't read path in parent directory

I'm trying to install a .msi package (adobe reader) through Microsoft msiexec
I wan't to do a silent install
my Code Looks like this:
msiexec /a "%~dp0..\adobe\setup"
problem:
whenever I use double dot (..) in msiexec command path I get an error
msiexec /a "adobe\setup"
works fine.
so, I even couldn't find a single example using similar path in msiexec command.
any help would be appreciated.
without msiexec none /S /qn or /silent works
So I'm out of ideas.
thanks in advance.
I think you have 2 options, either:
cd..
msiexec adobe\setup.msi
Or
set parent=%~dp0
msiexec %parent%adobe\setup.msi

Automating Application Installations in Batch

I am trying to write a Script that will install our remote app applications automatically. Here is what I have so far:
REM Install Remote Icons
#Echo On
pushd "\\Servername.com\it\RDP\Installers\"
start msiexec /i "\\Servername.com\it\RDP\Installers\ExercisePro.msi" /qn
start msiexec /i "\\Servername.com\it\RDP\Installers\Excel.msi" /qn
start msiexec /i "\\Servername.com\it\RDP\Installers\Word.msi" /qn
start msiexec /i "\\Servername.com\it\RDP\Installers\Outlook.msi" /qn
start msiexec /i "\\Servername.com\it\RDP\Installers\Allscripts EHR.msi" /qn
start msiexec /i "\\Servername.com\it\RDP\Installers\Allscripts PM.msi" /qn
start msiexec /i "\\Servername.com\it\RDP\Installers\MModal Allscripts EHR.msi" /qn
popd
mkdir C:\Users\%USERNAME%\Icons
copy C:\Users\%USERNAME%\%APPDATA%\Local\Microsoft\Installer C:\Icons
pushd "\\Servername.com\M Modal\Fluency.Direct.9.1.65.7.6.4.v7\fd.client\install_silent.bat"
popd
copy \\Servername.com\Private IT\PC_Shortcuts \\%COMPUTERNAME%\%USERNAME%\Public\Desktop
pause
So far the script is not working as I intended it. I want it to install the applications then I want it to make a directory called C:\Icons and copy the app data over to that folder so I can delete the appdata entries that it makes and those entries take the user profile longer to login. Also I have a folder on the server that I want to copy to the local desktop that has all of the internet shortcuts we use. This is also not working correctly :(
This should work for you.
Also do you really need all the pushd and popd if you are providing the full location of the sources you are copying. If you are executing a file, and calling it by it's full Universal Naming Convention (i.e. C:\Folder\Test.txt) then you don't need to change your current directory to C:\Folder, you can run that file from anywhere within the computers file system, as you are providing the full file location.
If you want to run the file by only providing the filename, or a partial address to the file, you would then need to change to the directory the file is residing in, or provide the location to the director from where you are located. (i.e. if you are in C:\Folder1 and the file resides in C:\Folder1\Folder2\Folder3\File.txt you would need to use the following address .\Folder2\Folder3\File.txt as you are already located in C:\Folder1 and the .\ acts as a placeholder\variable for the current directory you are sitting in).
REM Install Remote Icons
#Echo On
msiexec /i "\\Servername.com\it\RDP\Installers\ExercisePro.msi" /qn /norestart
msiexec /i "\\Servername.com\it\RDP\Installers\Excel.msi" /qn /norestart
msiexec /i "\\Servername.com\it\RDP\Installers\Word.msi" /qn /norestart
msiexec /i "\\Servername.com\it\RDP\Installers\Outlook.msi" /qn /norestart
msiexec /i "\\Servername.com\it\RDP\Installers\Allscripts EHR.msi" /qn /norestart
msiexec /i "\\Servername.com\it\RDP\Installers\Allscripts PM.msi" /qn /norestart
msiexec /i "\\Servername.com\it\RDP\Installers\MModal Allscripts EHR.msi" /qn /norestart
Call "\\Servername.com\M Modal\Fluency.Direct.9.1.65.7.6.4.v7\fd.client\install_silent.bat"
mkdir C:\Users\%USERNAME%\Icons
copy C:\Users\%USERNAME%\%APPDATA%\Local\Microsoft\Installer\*.* C:\Users\%USERNAME%\Icons /Y
copy \\Servername.com\Private IT\PC_Shortcuts\*.* \\%COMPUTERNAME%\%USERNAME%\Public\Desktop /Y
pause
NOTE: I have added in the /norestart to ensure that your device doesn't restart after any of the installations, which would then in turn kill the installation script.
You can use powershell remoting for this tasks. Check invoke-command with the -ComputerName parameter for remote actions. With Powershell version 5 Copy-Item supports FromSession ToSession parameters to copy files remotely. You can run msiexec via Start-Process.

How to install Node.js in custom folder silently on Windows?

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.

Silent msi install command [duplicate]

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

Resources