如果我知道 MSI GUID,如何在注册表中查找程序位置?
我已经安装了一些带有 GUID (0733556C-37E8-4123-A801-D3E6C5151617) 的 MSI。 该程序在注册表中注册: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\()
值 UninstallString = MsiExec.exe / I (0733556C-37E8-4123-A801-D3E6C5151617)
我的问题是:实用程序 MsiExec.exe 如何知道删除程序时要运行的文件的名称和路径?在注册表中的哪里可以找到此信息?
I have installed some MSI with GUID (0733556C-37E8-4123-A801-D3E6C5151617).
The program registered in the registry:
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ ()
Value
UninstallString = MsiExec.exe / I (0733556C-37E8-4123-A801-D3E6C5151617)
My question is: how utility MsiExec.exe knows the name and path to the file you want to run when you remove programs? Where in the registry this information can be found?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Windows 将 Windows Installer 配置信息隐藏并加密在注册表中。它不像注册表的其他部分那样可以用肉眼浏览。
要查询/修改/删除此信息,您需要使用 MSI 函数。
(安装程序功能参考)
对于您的特定问题,尝试使用函数 MsiGetProductInfo。
Windows keeps Windows Installer configuration information hidden and encrypted in the Registry. It is not browseable with the human eye as other parts of the Registry are.
To query/modify/delete this information, you'll need to use MSI functions.
(Installer Function Reference)
For your particular question, try the function MsiGetProductInfo.
正如 William Leara 所说,这是一个简单的 C# 程序,它使用 MsiGetProductInfo 来获取磁盘上缓存的安装程序的实际位置。
Here's a simple c# program that uses MsiGetProductInfo, as William Leara says, to get the actual location of the cached installer on disk.
您可以从命令行尝试:
You could try, from the command line:
您不需要任何软件。这适用于 Windows 10,我认为它也适用于 Windows 7。
如果您的产品代码是 0733556C-37E8-4123-A801-D3E6C5151617。
尝试找到密钥 C65533708E7332148A103D6E5C516171 (基本上是相反的)一旦找到它,浏览 InstallProperties 子项,如果不存在,请尝试查找其他结果。找到 InstallProperties 后,打开并找到 LocalPackage Key。然后您就有了安装应用程序时 MSI 保存为缓存的 msi 包的路径。
You don´t need any software. This is working in Windows 10 and I think its valid for windows 7 as well.
If your Product Code is 0733556C-37E8-4123-A801-D3E6C5151617.
Try to find the key C65533708E7332148A103D6E5C516171 (basically it's reversed) once you found it, browse for InstallProperties subkey, if doesn´t exists, try to find other result. Once you found InstallProperties, open and find the LocalPackage Key. And then you have the path for the msi packeage that MSI saves as Cache when you installed your application.
该键映射到
HKEY_CLASSES_ROOT\Installer\Products\
。That key maps to
HKEY_CLASSES_ROOT\Installer\Products\
.我发现 Tarma Software Research 有一个免费实用程序对此很有帮助。从他们的网站获取它。
There is a free utility from Tarma Software Research that I found helpful for this. Get it from their website.
这个问题的前提是误导性的,因为卸载时并没有使用注册表中的UninstallString。继续更改字符串来测试它 - 它不会使用您更改的字符串。
尽管引用注册表中的内容可能很有吸引力,但简短的答案是注册表中的 Windows Installer 数据是实现细节。问题基本上是询问 MsiConfigureProduct(....INSTALLSTATE_ABSENT...) 是如何工作的,猜测实现细节以及它可能在注册表中的位置是毫无意义的。从头到尾都是 API。发布者可能想要完成一项实际任务,但它被卸载如何工作的问题所掩盖。
The premise of this question is misleading because the UninstallString in the registry is not used when doing the uninstall. Go ahead and change the string to test this - it won't use your altered string.
Although references to stuff in the registry might be appealing, the short answer is that Windows Installer data in the registry is implementation detail. The question is basically asking how MsiConfigureProduct(....INSTALLSTATE_ABSENT...) works, and it's pointless to guess at the implementation details and where it might be in the registry. It's APIs all the way down. There might have been an actual task the poster may have wanted to accomplish, but it is masked by a question of how uninstalls work.