杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2191|回复: 0

Installshield 判断系统是否预安装了vcredist_x86.exe

[复制链接]
发表于 2018-5-24 15:24:21 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
在没有安装过VC的电脑系统里,经常会出现打开某些应用程序提示错误问题。需要安装vcredist_x86.exe。
如果程序全部安装vcredist_x86.exe,会造成覆盖电脑本身VC版本的问题,所以最好先判断再做是否安装的动作。

此问题主要出现在早期系统版本,比如XP、Vista系统,Win7以后很少出现,所以,只需在这类系统安装即可。

代码参考:

  1. function OnBegin()
  2. NUMBER nResult;
  3. begin
  4. //XP and Vista install Codec and vcredist_x86
  5. if (((SYSINFO.nWinMajor = 6 ) && (SYSINFO.nWinMinor = 0))||((SYSINFO.nWinMajor = 5 ) && (SYSINFO.nWinMinor <= 2) )) then
  6.    RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);  
  7.    nResult = RegDBKeyExist ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{{9A25302D-30C0-39D9-BD6F-21E6EC160475}}");
  8.    if (nResult < 0) then
  9.     nResult=LaunchAppAndWait ( SUPPORTDIR ^ "vcredist_x86.exe" , "/q" , LAAW_OPTION_WAIT );
  10.    endif;
  11. endif;

  12. end;
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-5-14 06:14 , Processed in 0.100063 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表