在.Net安装项目中如何判断操作系统的版本

在ASP.NET Web应用程序做部署时,不仅需要判断IIS的版本,有时还需要判断操作系统的版本,以下步骤可以判断操作系统的版本信息。

限制只能在2000 Server或更高版本的系统上安装,不能在2000 profession上安装。
1,添加一个启动条件。
2,设置Condition属性的值为:VersionNT>=500 And MsiNTProductType=3

参考资料:

None.gif VersionNT Property
None.gif
None.gifThe installer sets the VersionNT property to the version number for the operating system, undefined if the operating system is not Windows NT, Windows 2000, Windows XP. The value is an integer: MajorVersion * 100 + MinorVersion.
None.gif
None.gif
None.gifWindows NT/Windows 2000/Windows XP operating system dependent actions and condition expressions use this value.
None.gif
None.gifSee also Operating System Property Values.
None.gif
None.gif
None.gifRemarks
None.gif
None.gifCondition expressions can test for Windows NT/Windows 2000/Windows XP simply by using the property name, or may verify the version using a comparison operator.
None.gif

Operating System Property Values

The following table displays values for selected operating system properties, including Microsoft Windows Server 2003 family, Windows XP, Windows 2000, Microsoft Windows NT version 4.0, Windows Millennium Edition (Windows Me), Windows 98, and Windows 95. For more information, see Released Versions of Windows Installer.

SystemVersion9X VersionNT WindowsBuild ServicePackLevel
Windows 95 (Gold)400 950 
Windows 95 + OSR400   
Windows 95 + OSR2400   
Windows 95 + OSR2.5400 1111 
Windows 98 (Gold)410 1998 
Windows 98 Second Edition410 2222 
Windows Me490 3000.1 
Windows NT 4.0 (Gold)  4001381 
Windows NT 4.0 + Service Pack 1 40013811
Windows NT 4.0 + Service Pack 2 40013812
Windows NT 4.0 + Service Pack 3 40013813
Windows NT 4.0 + Service Pack 4 40013814
Windows NT 4.0 + Service Pack 5 40013815
Windows NT 4.0 + Service Pack 6 40013816
Windows 2000 5002195 
Windows 2000 + Service Pack 1 50021951
Windows XP 5012600 
Windows XP + Service Pack 1 50126001
Windows Server 2003 family 502Greater than 2600 

MsiNTProductType Property

The installer sets the MsiNTProductType property for Windows NT, Windows 2000, and later operating systems. This property indicates the Windows product type.

For operating systems earlier than Windows 2000, the installer sets the following values.

ValueMeaning
1Windows NT work station
2Windows NT domain controller
3Windows NT server

For Windows 2000 and later operating systems the installer sets the following values. Note that values are the same as of the wProductType field of the <?XML:NAMESPACE PREFIX = MSHelp /> structure.

ValueMeaning
1Windows 2000 Professional and later
2Windows 2000 domain controller and later
3Windows 2000 Server and later

Remarks

This property is only available with Windows Installer version 2.0 and later.

转载于:https://www.cnblogs.com/zengdj/archive/2005/08/18/217662.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值