用InstallShield制作安装包时,有时候需要判断操作系统的类型(如Windows XP或者是Windows Vista等
来源:互联网 发布:男士单肩包 知乎 编辑:程序博客网 时间:2024/05/22 05:13
转自:http://blog.csdn.net/huangxinfeng/article/details/4873847
用InstallShield制作安装包时,有时候需要判断操作系统的类型(如Windows XP或者是Windows Vista等
(http://community.flexerasoftware.com/)
方法一:采用注册表的方式进行判断,例程如下:
NUMBER nOS,nvResult;
STRING svOS;
nOS = REGDB_NUMBER;
RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
RegDBGetKeyValueEx( "SOFTWARE//Microsoft//Windows NT//CurrentVersion","CurrentVersion", nOS, svOS, nvResult);
if (svOS == "6.0") then
MessageBox("We are on Vista!", INFORMATION);
else
if (svOS == "5.1") then
MessageBox("We are on XP!",INFORMATION);
endif;
endif;
方法二:采用GetSystemInfo函数进行处理,请看下面的说明信息:
SYSINFO.nWinMajor:
4 The operating system is Windows NT 4.0.
5 The operating system is Windows Server 2003 R2, Windows Server 2003, Windows XP,or Windows 2000.
6 The operating system is Windows Vista or Windows Server 2008.
SYSINFO.nWinMinor:
0 The operating system is Windows Vista, Windows Server 2008, Windows 2000, or Windows NT 4.0.
1 The operating system is Windows XP.
2 The operating system is Windows Server 2003 R2, Windows Server 2003, or Windows XP Professional x64 Edition.
GetSystemInfo(WINMINOR, nvResult, svResult);
GetSystemInfo(WINMAJOR, nvResult, svResult);
方法二可以通过InstallShield的帮助文档找到更详细的信息。
方法三:通过SYSINFO.WINNT的方法进行判断,例程如下:
if (SYSINFO.WINNT.bWinVista) then
if (SYSINFO.nOSProductType = VER_NT_WORKSTATION) then
// 当前操作系统为Windows Vista
endif;
endif;
if (SYSINFO.WINNT.bWinXP) then
当前操作系统为Windows XP
endif;
上述三种方法是最为常见的解决办法,当然亦可能还有其他的方法可以进行处理。
- 用InstallShield制作安装包时,有时候需要判断操作系统的类型(如Windows XP或者是Windows Vista等
- InstallShield安装包制作笔记:判断安装时需要重写或者删除的程序是否打开并处理
- windows中使用installShield制作windows服务的安装包
- InstallShield判断操作系统类型的多种方法
- 判断当前Windows XP操作系统是32位还是64位的方法
- 破解Windows XP操作系统正版验证或者黑屏的办法
- 微软的下一代操作系统到底是Longhorn还是windows vista?
- 安装包制作 InstallShield
- InstallShield制作安装包
- installshield安装包制作
- InstallShield安装包制作
- InstallShield安装包制作
- Windows XP 操作系统安装图解
- 利用InstallShield12制作安装包之三:判断操作系统类型的多种方法
- InstallShield安装包制作笔记:Please wait while Windows Configures XX !!
- 用InstallShield打包不同安装类型的安装包
- WINDOWS XP AND VISTA
- 彻底了解Windows XP操作系统登录类型
- C# 插件构架实战(Jack H Hansen )
- TIMESTAMP vs. DATETIME, 该用哪一个?
- html input输入限制
- shell 之空格
- android学习笔记之JSON .
- 用InstallShield制作安装包时,有时候需要判断操作系统的类型(如Windows XP或者是Windows Vista等
- oracle PL-SQL块与深入例子
- Mandelbrot set
- VB.NET中的sender、e和handles
- bash: ifconfig: command not found 解决办法
- jqGrid 问题笔记
- asp.net 调用带有输出参数的存储过程
- MySQL解决DOS环境下乱码问题
- 打包传输结构体或大内存块