【Inno Setup】判别系统版本

[Code]
function IsXP32(): Boolean;
var
Version:TWindowsVersion;
S:String;

begin
  GetWindowsVersionEx(Version);
  S:= '主版本号:' + IntToStr(  Version.Major ) + #13#10;
  S:= S+'副版本号:' + IntToStr(  Version.Minor )  +#13#10;
  S:= S+'构建号:' + IntToStr(  Version.Build )  +#13#10;
  S:= S+'服务包主版本号:' + IntToStr(  Version.ServicePackMajor )  +#13#10;
  S:= S+'服务包副版本号:' + IntToStr(  Version.ServicePackMinor )  +#13#10;

  if Version.NTPlatform then 
  Begin
    S:= S+'基于 NT 平台则:True' +#13#10;
  end; 

  if not Version.NTPlatform then 
  Begin
    S:= S+'基于 NT 平台则:False' +#13#10;
  end; 

  if Version.ProductType = VER_NT_WORKSTATION  then 
  Begin
    S:= S+'产品类型:Work Station(工作站)' +#13#10;
  end;

  if Version.ProductType = VER_NT_DOMAIN_CONTROLLER  then 
  Begin
    S:= S+'产品类型:Domain Controller(域控制器)' +#13#10;
  end;

  if Version.ProductType = VER_NT_SERVER  then 
  Begin
    S:= S+'产品类型:Server(服务器)' +#13#10;
  end;

  if Version.SuiteMask and VER_SUITE_BACKOFFICE <> 0 then 
  Begin
    S:= S+'安装的产品组件:Microsoft BackOffice 组件' +#13#10;
  end;

  if Version.SuiteMask and VER_SUITE_BLADE <> 0 then 
  Begin
    S:= S+'安装的产品组件:Blade(设置在网络版的 Windows Server 2003)' +#13#10;
  end;

  if Version.SuiteMask and VER_SUITE_DATACENTER <> 0 then 
  Begin
    S:= S+'安装的产品组件:Windows 2000数据中心服务器' +#13#10;
  end;

  if Version.SuiteMask and VER_SUITE_ENTERPRISE <> 0 then 
  Begin
    S:= S+'安装的产品组件:Windows 2000高级服务器' +#13#10;
  end;

  if Version.SuiteMask and VER_SUITE_EMBEDDEDNT <> 0 then 
  Begin
    S:= S+'安装的产品组件:Windows XP Embedded' +#13#10;
  end;
  
  if Version.SuiteMask and VER_SUITE_PERSONAL <> 0 then 
  Begin
    S:= S+'安装的产品组件:Personal(家庭版的 Windows)' +#13#10;
  end;

  if Version.SuiteMask and VER_SUITE_SINGLEUSERTS <> 0 then 
  Begin
    S:= S+'安装的产品组件:Single User TS(支持远程桌面,但只支持一个交互式会话)' +#13#10;
  end;

  if Version.SuiteMask and VER_SUITE_SMALLBUSINESS <> 0 then 
  Begin
    S:= S+'安装的产品组件:Microsoft小型企业服务器' +#13#10;
  end;

  if Version.SuiteMask and VER_SUITE_SMALLBUSINESS_RESTRICTED <> 0 then 
  Begin
    S:= S+'安装的产品组件:Microsoft小型企业服务器随限制性客户端许可证一起安装。' +#13#10;
  end;

  if Version.SuiteMask and VER_SUITE_TERMINAL <> 0 then 
  Begin
    S:= S+'安装的产品组件:终端服务' +#13#10;
  end;
     
  S:= S+'产品类型:' + IntToStr(  Version.ProductType )  +#13#10;
  S:= S+'安装的产品组件:' + IntToStr(  Version.SuiteMask )  +#13#10;

  MsgBox(S,mbInformation,MB_OK);
  if (Version.Major = 5) and (not Is64BitInstallMode) then
  begin
  Result :=True;
  Exit;
  end;
  Result :=False;
end;










  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值