以前我使用的是:
{ Check Windows Version }
WindowsVersion := GetWindowsVersion;
Log(Format('Windows Version: %x', [WindowsVersion]));我现在用的是:
{ Check Windows Version }
GetWindowsVersionEx(WinVer);
WinVerPacked := PackVersionComponents(WinVer.Major, WinVer.Minor, WinVer.Build, 0);其中WinVer的类型为TWindowsVersion。现在我们如何处理Log条目?
发布于 2020-11-17 15:34:14
如果Inno安装程序已经记录了
2020年-11-17 16:26:59.234 Windows版本: 10.0.19041 (NT平台:是)
无论如何,没有什么可以阻止您继续使用进行日志记录,即使您现在使用GetWindowsVersionEx进行版本检查.
PackVersionComponents返回值实际上类似于GetWindowsVersion,因此您可以直接记录它:日志(格式(‘Windows:%x',WinVerPacked));
它只会在输出中有更多的零:
2020年-11-17 16:26:59.337 Windows版本: A00004A610000
虽然与以前的GetWindowsVersion日志记录类似,但它的用户不友好:
2020年-11-17 16:26:59.337 Windows版本: A004A61
TWindowsVersion组件。日志(格式(‘Windows版本:%1!%.%1!’,WinVer.Major,WinVer.Minor,WinVer.Build));
这将使您了解Inno安装程序在其标题中记录的内容:
2020年-11-17 16:26:59.337视窗版本: 10.0.19041
但是,如果您记录了由
TWindowsVersion,则可以通过记录GetWindowsVersionString的输出来简化您的生活:日志(格式(‘Windows:%s',GetWindowsVersionString));
这几乎是一样的:
2020年-11-17 16:26:59.337视窗版本: 10.00.19041
https://stackoverflow.com/questions/64877948
复制相似问题