静默命令行安装 Visual C++ 发行包

  • 2020 年 3 月 12 日
  • 筆記

本文告诉大家如何通过命令行的方法,在安装程序静默调用 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:ProgramDataPackage Cache{2019b6a0-8533-4a04-ac0e-b2c10bdb9841}VC_redist.x86.exe" /uninstall /quiet  x64 : "C:ProgramDataPackage 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"

下载地址

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

本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。欢迎转载、使用、重新发布,但务必保留文章署名林德熙(包含链接: https://blog.lindexi.com ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请 与我联系