title author date CreateTime categories
静默命令行安装 Visual C++ 发行包
lindexi
2019-8-27 15:39:3 +0800
2019-08-27 15:20:34 +0800
 

本文告诉大家如何通过命令行的方法,在安装程序静默调用 VC++ 库的安装,解决缺少环境问题

对不同的版本的 VC++ 库安装的方法有所不同,每个版本的 VC++ 库都会有 x86 x64 ia64 等版本,本文将使用 x86 版本作为例子,而对应的其他版本安装方法相同

安装

Visual C++ 2017

x86

vc_redist.x86.exe /install /quiet /log "%temp%\Install_vc_redist_2017_x86.log"

x64

vc_redist.x64.exe /install /quiet /log "%temp%\Install_vc_redist_2017_x64.log"

Visual C++ 2015

vc_redist.x86.exe /q /norestart

Visual C++ 2013

vcredist_x86.exe /install /quiet /norestart /log %TEMP%\vcredist_2013_x86.log

Visual C++ 2010

// x86
vcredist_x86.exe /q /norestart
// x64
vcredist_x64.exe /q /norestart
// ia64
vcredist_ia64.exe /q /norestart

Visual C++ 2008

vcredist_x86.exe /q

Visual C++ 2005

这里的 Visual C++ 2005 也就是 Visual C++ 8.0 版本,静默安装方法请看下面

Vcredist_x86.exe /q:a /c:"msiexec /i vcredist.msi /qn /l*v %temp%\vcredist_x86.log"

卸载

Visual C++ 2017

vc_redist.x86.exe /uninstall /quiet /log "%temp%\Uninstall_vc_redist_2017_x86.log"

如果找不到 vc_redist.x86.exe 可以尝试从缓存文件找到

x86 : "C:\ProgramData\Package Cache\{2019b6a0-8533-4a04-ac0e-b2c10bdb9841}\VC_redist.x86.exe" /uninstall /quiet
x64 : "C:\ProgramData\Package Cache\{80586c77-db42-44bb-bfc8-7aebbb220c00}\VC_redist.x64.exe" /uninstall /quiet

Visual C++ 2010

vcredist_x86.exe /q /uninstall /norestart

Visual C++ 2008

普通的卸载

vcredist_x86.exe /qb

不带取消的卸载

vcredist_x86.exe /qb!

Visual C++ 2005

vcredist_x86.exe /q:a /c:"msiexec /i vcredist.msi /qb! /l*v %temp%\vcredist_x86.log"

下载地址

IT Pro Tips for Microsoft Visual C++ Redistribuable 2017 v14 | ITNinja

Mailbag: How to perform a silent install of the Visual C++ 2010 redistributable packages – Aaron Stebner's WebLog

Mailbag: How to perform a silent install of the Visual C++ 2008 redistributable packages – Aaron Stebner's WebLog

Update regarding silent install of the VC 8.0 runtime (vcredist) packages – Aaron Stebner's WebLog