没有卸载注册表或C:\ Windows \ Installer,有没有办法检测安装位置? [英] Is there way to detect install location without uninstall registry nor C:\Windows\Installer?
问题描述
我需要检测的某些可执行文件已正确安装,但未在通常的Computer \ HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall \
Some of the executable that I need to detect is installed properly, but has not written InstallLocation in the usual Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
我还检查了C:\ Windows \ Installer,但未在msi文件中找到GUID.
I also checked C:\Windows\Installer but the GUID was not found with msi file.
有什么办法可以知道文件的安装位置吗?
Is there any way to know where the files were installed?
推荐答案
MSI API :以下是使用VBScript获取 Microsoft Visual C++ 2012 x86 Minimum Runtime - 11.0.50727
-为您的目的更新GUID(显然):
MSI API: Here is a sample using VBScript to get the installation path for Microsoft Visual C++ 2012 x86 Minimum Runtime - 11.0.50727
- update GUIDs for your purpose (obviously):
Set i = CreateObject("WindowsInstaller.Installer")
' Microsoft Visual C++ 2012 x86 Minimum Runtime - 11.0.50727
MsgBox i.ComponentPath("{2F73A7B2-E50E-39A6-9ABC-EF89E4C62E36}","{F5CBD6DC-5C9C-430E-83A7-179BA49988CD}")
Installer.ComponentPath
方法:
Installer.ComponentPath
method:
- 第一个参数是产品代码.
- 第二个参数是组件代码.
- The first parameter is the product code.
- The second parameter is the component code.
GUIDs: Open the MSI in question with Orca (or equivalent, see link) to find the Product code in the "Property Table"
and the Component code in the "Component Table"
.
对于已安装的软件包,您可以执行以下操作:
For installed packages you can do as follows:
- ProductCode: How can I find the product GUID of an installed MSI setup?
- Open Cached MSI: You can find the cached MSI and do a File => Open in Orca to retrieve the information you need. You can find the cached path using the script below.
查找缓存的MSI :下面的PowerShell脚本位于此处一个>.它将允许您找到已安装的MSI的本地缓存路径.
Find Cached MSI: The below PowerShell script is from here. It will allow you to find the local cache path for the installed MSI.
gwmi -Query "SELECT Name,LocalPackage FROM Win32_Product WHERE IdentifyingNumber='{2F73A7B2-E50E-39A6-9ABC-EF89E4C62E36}'" | Format-Table Name,LocalPackage
链接:
Links:
这篇关于没有卸载注册表或C:\ Windows \ Installer,有没有办法检测安装位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!