我正在编写一个perl脚本来检查系统中是否已经安装了Visual C++ Redistributable 2010 x64。
来读取注册表中的相应条目。或者使用MsiQueryProductStateA
在没有out的情况下,使用Win32::TieRegistry是不可能的。
但是使用use Win32::API是一种选择
尝试在Win32::API中使用MsiQueryProductStateA
use Win32::API;
$function = Win32::API::More->Import(
'msi', 'INSTALLSTATE MsiQueryProductStateA(LPCSTR szProduct)'
);本应获取一些有效的返回值,但得到错误
Win32::API::parse_prototype: WARNING unknown output parameter type 'INSTALLSTATE' at C:\Program Files\HP\HP BTO Software\nonOV\Perl\a\lib/5.26.2/MSWin32-x64-multi-thread/Win32/API.pm line 600. 4294967294有没有人可以解释一下如何使用/导入返回类型以及如何使用它?
提前感谢
发布于 2019-05-16 14:35:56
展示如何在C++ (而不是perl)中实现,您可以参考一下。
我安装了Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019。


返回值5表示"The product is installed for the current user.“
在注册表中查找产品代码如下所示:
HKEY_CLASSES_ROOT\Installer\Dependencies\Microsoft.VS.VC_RuntimeAdditionalVSU_x86,v14
https://stackoverflow.com/questions/56145780
复制相似问题