在Inno Setup中确定Windows版本
发布时间:2020-12-15 10:11:42 所属栏目:大数据 来源:网络整理
导读:我正在使用Inno Setup来更改操作系统中的回收站.如果用户运行Windows 7或Windows XP,我需要做一些案例.我尝试使用: if not FileExists(winDir + 'System32imageres.dll') then if not FileExists(winDir + 'System32shell32.dll') then installError(3)
我正在使用Inno Setup来更改操作系统中的回收站.如果用户运行Windows 7或Windows XP,我需要做一些案例.我尝试使用:
if not FileExists(winDir + 'System32imageres.dll') then if not FileExists(winDir + 'System32shell32.dll') then installError(3); 但它似乎无法找到imageres.dll或shell32.dll,即使我已经验证它们存在.我究竟做错了什么?或者我可以用另一种方式检查Windows版本吗? 解决方法
您应该使用
GetWindowsVersionEx 功能.它填补了
TWindowsVersion 的记录:
TWindowsVersion = record Major: Cardinal; // Major version number Minor: Cardinal; // Minor version number Build: Cardinal; // Build number ServicePackMajor: Cardinal; // Major version number of service pack ServicePackMinor: Cardinal; // Minor version number of service pack NTPlatform: Boolean; // True if an NT-based platform ProductType: Byte; // Product type (see below) SuiteMask: Word; // Product suites installed (see below) end; 还有很多其他相关功能.请参阅下面的“系统功能”,电话:this page. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |