[英]Deploying a C#/.NET application without an installer nor ClickOnce
[英]Is there way to detect install location without uninstall registry nor C:\Windows\Installer?
我需要检测的一些可执行文件已正确安装,但尚未在通常的 Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ 中写入 InstallLocation
我还检查了 C:\Windows\Installer 但在 msi 文件中找不到 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
方法:
GUID :使用Orca (或等效项,请参阅链接)打开有问题的 MSI,在"Property Table"
中找到产品代码,在"Component Table"
中找到组件代码。
对于已安装的软件包,您可以执行以下操作:
查找缓存的 MSI :下面的 PowerShell 脚本来自这里。 它将允许您找到已安装 MSI 的本地缓存路径。
gwmi -Query "SELECT Name,LocalPackage FROM Win32_Product WHERE IdentifyingNumber='{2F73A7B2-E50E-39A6-9ABC-EF89E4C62E36}'" | Format-Table Name,LocalPackage
链接:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.