The following table identifies the standard command-line options for this program. Command-line options are case insensitive. Windows Installer 2.0: The command-line options that are identified in this topic are available beginning with Windows Installer 3.0. The Windows Installer Command-Line Options are available with Windows Installer 3.0 and earlier versions. It doesn't appear the beta includes support for a scripted silent install, is that so? If it does, where can I find the switches documented? If it does not, is that planned? (I am hoping to use the product, when released, for computers in a school lab and would greatly appreciate a silent, scripted install.) Jonathan.
Programming, graphics, games, media, C++, Windows, Internet and more...
Blog »
# Installing Visual C++ Redistributable Package from Command Line
Wed
20
May2015
You may think that unless you explicitly use some external library (like FMOD), your program will not require any additional libraries to work, but when coding in C++ using Visual Studio, this is not the case. The functions of standard C/C++ library are implemented in a package of DLL-s called Microsoft Visual C++ Redistributable Package. Each version of Visual Studio has their own set. For example, version for Visual Studio 2013 (Release configuration) consists of files: msvcr120.dll, msvcp120.dll.
You can make your application not requiring this library by setting your project options in Configuration Properties > C/C++ > Code Generation > Runtime Library to 'Multi-threaded [Debug]' without the 'DLL' part, which makes it statically linked. Alternatively, you can distribute these DLL files (although I'm not sure if this is legal) or the whole library installer together with your application. The library is small and free, available to download from Microsoft website:
Microsoft Silent Install Switches
- 2008 SP1: x86, x64
- 2010 SP1: x86, x64
- 2012 Update 4 (all versions)
- 2013 (all versions)
- 2015 Update 3 (all versions)
The question is: can you launch the installer of these packages with some special parameter so the user doesn't have to go through all the setup wizard, confirming each step? The answer is yes, but as Microsoft likes to change everything very often :) the exact command line is different depending on version. Here is the whole set:
Visual Studio 2005 (original one):
Visual Studio 2005, x86 (32-bit version):vcredist_x86.exe /q:a /c:'VCREDI~1.EXE /q:a /c:'msiexec /i vcredist.msi /qn'
Visual Studio 2005, x64 (64-bit version):vcredist_x64.exe /q:a /c:'VCREDI~2.EXE /q:a /c:'msiexec /i vcredist.msi /qn' '
Visual Studio 2005 SP1, x86:vcredist_x86.exe /q:a /c:'VCREDI~3.EXE /q:a /c:'msiexec /i vcredist.msi /qn' '
Visual Studio 2005 SP1, x64:vcredist_x64.exe /q:a /c:'VCREDI~2.EXE /q:a /c:'msiexec /i vcredist.msi /qn' '
If you would like to install it in unattended mode (which will show a small progress bar but not require any user interaction), you can change the '/qn' switch above to '/qb'. Unattended mode + disabled 'Cancel' button is '/qb!'.
Visual Studio 2005 (updated - the one I use):
/Q
- quiet mode
Visual Studio 2008: Just pass one of these parameters:
/q
- quiet mode, no user interface./qb
- unattended mode, shows progress bar but no user interaction required./qb!
- unattended mode with 'Cancel' button disabled.
Visual Studio 2010 and 2012:
/q /norestart
- quiet mode/passive /norestart
- passive (unattended) mode
Visual Studio 2013, 2015, 2017:
/install /quiet /norestart
- quiet mode/install /passive /norestart
- passive (unattended) mode
To quickly install all of these libraries on the machines where lots of different applications are launched that may require them, I gathered all the libraries in one directory and I have written following BAT script:
Update: I also prepared a full package with my script and 'pirated' copy of all these installers for your convenience: Microsoft Visual C++ Redistributable Package.zip (105 MB).
Find Switches For Exe
Comments | #visual studio#c++Share
Please enable JavaScript to view the comments powered by Disqus.The following command-line options are available for Windows Setup. Beginning with Windows 10, version 1607, you can use a setupconfig file as an alternative to passing paramters to Windows Setup on a command line. For more information, see Windows Setup Automation Overview.
setup.exe
The following table lists Setup command-line options:
Option | Description |
---|---|
/1394Debug:<channel> [BaudRate:<baudrate>] | Enables kernel debugging over an IEEE 1394 (FireWire) port while Windows is running and during the windowsPE configuration pass of Windows Setup. Setup /1394debug:1 /baudrate:115200 |
/AddBootMgrLast | Instructs Windows Setup to add the Windows Boot Manager as the last entry in the UEFI firmware boot order. This option is only supported on UEFI PCs running Windows PE 4.0 or later. |
/Auto{Clean | DataOnly | Upgrade} | Performs an automated upgrade to Windows 10 or Windows 8.1 volume license editions only. |
/BitLocker{AlwaysSuspend | TryKeepActive | ForceKeepActive} | Specifies the BitLocker status during upgrades. |
/BusParams:<bus.device.function> | Specifies the PCI address of a 1394, USB, or NET debug port. The bus, device, and function numbers must be in decimal format. Example: Setup /busparams:0.29.7 For more info, see Setting Up Kernel Debugging with USB 2.0. |
/CompactOS {Enable / Disable} | Specifies whether to use the Compact OS feature to save hard drive space. By default, Windows Setup determines whether to use this feature automatically. |
/Compat {IgnoreWarning / ScanOnly} | IgnoreWarning: Setup completes installation, ignoring any dismissible compatibility messages.
Setup /Auto Upgrade /Quiet /Compat ScanOnly To ignore common disclaimers in the UI, for example, language changes: Setup /Auto Upgrade /Quiet /Compat ScanOnly /Compat IgnoreWarning Most of the time, an Admin would like to look at the compat XML if Setup found compat issues. For that the admin can even use copy logs flag to collect Setup logs: Setup /Auto Upgrade /Quiet /Compat ScanOnly /Compat IgnoreWarning /CopyLogs C:TempLogfiles.log This setting is new for Windows 10. |
/CopyLogs<location> | Setup will copy or upload logs(compressed) upon failure to the specified location (assuming machine/user has permission and network access to location). |
/Debug:<port> [BaudRate:<baudrate>] | Enables kernel debugging over a communications (COM) port when Windows is running, and during the windowsPE configuration pass of Windows Setup. |
/DiagnosticPrompt {enable | disable} | Specifies that the Command Prompt is available during Windows Setup. |
/DynamicUpdate {enable | disable} | Specifies whether setup will perform Dynamic Update operations (search, download, and install updates). Example: |
/EMSPort: {COM1 | COM2 | off} [/emsbaudrate:<baudrate>] | Enables or disables Emergency Management Services (EMS) during Windows Setup and after the server operating system has been installed. The following arguments are used to specify the behavior of EMS during Windows Setup. |
/InstallDrivers<location> | Adds .inf-style drivers to the new Windows 10 installation. The driver .inf can be in a folder within the specified location. The command will recurse through the specified location. |
/InstallFrom<path> | Specifies a different Install.wim file to use during Windows Setup. This enables you to use a single preinstallation environment to install multiple versions of Windows images. For example, you can use a 32-bit version of Windows Setup to deploy a 64-bit Windows image. You can also use an answer file for cross-platform deployments. For more information, see “Creating a WIM for Multiple Architecture Types” in Windows Setup Supported Platforms and Cross-Platform Deployments. |
/InstallLangPacks<location> | Adds language packs (lp.cab) to the new Windows 10 installation. |
/m:<folder_name> | Instructs Setup to copy alternate files from an alternate location. This option instructs Setup to look in the alternate location first, and, if files are present, to use them instead of the files from the default location. |
/MigNEO Disable | Tells Windows Setup to perform an upgrade of Windows without additional offline phase optimizations. This option is available in Windows 10, version 1803 and later. |
/MigrateDrivers {all | none} | Instructs Setup whether to migrate the drivers from the existing installation during the upgrade. You can specify All or None. By default, Setup decides which is best for each individual driver based on the install choice. |
/NetDebug:hostip=<w.x.y.z>,port=<n>,key= <q.r.s.t>[,nodhcp][,busparams=n.o.p] | Enables kernel debugging over the network. |
/NoReboot | Instructs Windows Setup not to restart the computer after the down-level phase of Windows Setup completes. The /noreboot option enables you to execute additional commands before Windows restarts. This option suppresses only the first reboot. The option does not suppress subsequent reboots. For example: |
/PKey<product key> | Supplies Setup with the specific product key. Example: |
/Priority Normal | Tells Windows Setup to increase the thread priority from low to high for feature updates through Windows Update. This option is available in Windows 10, version 1709 and later Note: Media based installations already run at normal priority. |
/PostOOBE<location> [setupcomplete.cmd] | After Setup is complete, run a script. |
/PostRollback<location> [setuprollback.cmd] [/postrollbackcontext {system / user}] | If the feature update fails to install and rolls back the changes, or if the user chooses to uninstall the feature update and go back to a previous version of Windows, run a script. |
/Quiet | This will suppress any Setup user experience including the rollback user experience. Example: |
/ReflectDrivers<location> | Specifies the path to a folder that contains encryption drivers for a computer that has third-party encryption enabled. |
/ResizeRecoveryPartition {Enable / Disable} | Specifies whether it's OK to resize the existing Windows Recovery Environment (Windows RE) partition or create a new one during installation. |
/ShowOOBE {full / none} | full: Requires the user to interactively complete the out of box experience (OOBE). |
/Telemetry {Enable / Disable} | Specifies whether Windows Setup should capture and report installation data. |
/TempDrive<drive_letter> | Instructs Windows Setup to put temporary installation files on the specified partition. For an upgrade, the /tempdrive option affects only the placement of temporary files. The operating system is upgraded in the partition from which you run the Setup.exe file. |
/Unattend:<answer_file> | Enables you to use an answer file with Windows Setup. This is known as an unattended installation. You must specify a value for <answer_file>. Windows Setup applies the values in the answer file during installation. |
/Uninstall {enable / disable} | Determines whether Windows will include controls that allow the user to go back to the previous operating system. |
/USBDebug:<hostname> | Sets up debugging on a USB port. Debug data is effective on the next reboot. |
/WDSDiscover | Specifies that the Windows Deployment Services (WDS) client should be in discover mode. |
/WDSServer:<servername> | Specifies the name of the Windows Deployment Services server that the client should connect to. |
Setup.exe exit codes
Msi Silent Install
Exit code name | Exit code | Cause |
---|---|---|
CONX_SETUP_EXITCODE_CONTINUE_REBOOT | 0x3 | This upgrade was successful. |
CONX_SETUP_EXITCODE_RESUME_AT_COMPAT_REPORT | 0x5 | The compatibility check detected issues that require resolution before the upgrade can continue. |
CONX_SETUP_EXITCODE_AUTO_INSTALL_FAIL | 0x7 | The installation option (upgrade or data only) was not available. |
Related topics