.net 安装后MSI文件复制到哪里去了?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2071860/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 13:47:53  来源:igfitidea点击:

Where the MSI file is copied after the installation?

.netwindowswindows-xpwindows-installer

提问by Jader Dias

I have to replace it because of a bug that blocks the software uninstallation, but Windows can't find the MSI file if I use the file search utility, but I think the MSI is stored somewhere where the Add or Remove Programsutility can use it.

由于阻止软件卸载的错误,我必须更换它,但如果我使用文件搜索实用程序,Windows 找不到 MSI 文件,但我认为 MSI 存储在该Add or Remove Programs实用程序可以使用它的某个地方。

回答by Sam Holder

Does it not go into %windir%\installer\

它不会进入 %windir%\installer\

Though I think that the files may get renamed. Not sure where you get the name mapping from...

虽然我认为这些文件可能会被重命名。不确定您从哪里获得名称映射...

This directory gets very big so I move it to an external drive. This sometimes cause uninstalls or updates to fail with a missing msi error, but this can be fixed by putting the directory back

这个目录变得非常大,所以我把它移到了一个外部驱动器上。这有时会导致卸载或更新失败并丢失 msi 错误,但这可以通过放回目录来解决

回答by saschabeaumont

You can force a recache/reinstall using with MSIEXEC, the recommended way to update buggy installation packages that cannot be otherwise removed is to recache with a fixed package, then uninstall as usual.

您可以使用 MSIEXEC 强制重新缓存/重新安装,更新无法删除的错误安装包的推荐方法是使用固定包重新缓存,然后照常卸载。

MSIEXEC /fv setup.msi

回答by RBT

I had put down lot of comments into the accepted answer so I thought I would rather post an answer after creating a summary with few more additional details:

我已经对已接受的答案发表了很多评论,所以我想我宁愿在创建包含更多其他细节的摘要后发布答案:

Installshield creates a copy of the *.msi files into %windir%\installer\path where %windir% is an environment variable which usually points to C:\Windows\. Before creating a copy of *.msi files it renames it using some random nomenclature e.g. I can see a file named 65ec5c99.msiin my C:\Windows\Installerdirectory.

Installshield 将 *.msi 文件的副本创建到%windir%\installer\路径中,其中 %windir% 是通常指向的环境变量C:\Windows\。在创建 *.msi 文件的副本之前,它使用一些随机命名法重命名它,例如我可以看到65ec5c99.msi在我的C:\Windows\Installer目录中命名的文件。

Now to figure out the actual product name for the renamed MSI file there are two ways:

现在要找出重命名的 MSI 文件的实际产品名称,有两种方法:

  1. Check LocalPackageattribute inside registry at path - [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersio??n\Installer\UserData??\<InternalUserId>\Pr??oducts\<ProductGUID>??\InstallProperties]. InternalUserIdis something of sort S-1-5-18. ProductGUIDis a GUID like 00058CD18F0BF523DA1072073D56715Dembedded as a public property inside the MSI file itself. You can check this public property by opening your MSI file using any tool e.g. orca

  2. Open C:\Windows\Installerfolder in explorer. Change the view of the directory to Detailsview. Add Subjectcolumn to the view. Whooaa!! The mystery is solved. The product name is visible right there in Subjectcolumn

  1. 检查LocalPackage注册表中路径 - 的属性[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersio??n\Installer\UserData??\<InternalUserId>\Pr??oducts\<ProductGUID>??\InstallProperties]InternalUserId是某种东西S-1-5-18ProductGUID是一个 GUID,就像00058CD18F0BF523DA1072073D56715D作为公共属性嵌入在 MSI 文件本身中一样。您可以通过使用任何工具(例如 orca)打开您的 MSI 文件来检查此公共属性

  2. C:\Windows\Installer在资源管理器中打开文件夹。更改目录的视图以Details查看。将Subject列添加到视图。哇哦!!谜底解开了。产品名称在Subject列中可见

enter image description here

在此处输入图片说明

回答by Ed.

When you install a package using the Windows Installer service, the msi file does get cached in the hidden folder "%windir%\installer". It does get renamed, and the new name is a hex string that doesn't have an obvious correlation to the original name. Something like "123ab4.msi".

当您使用 Windows Installer 服务安装程序包时,msi 文件会缓存在隐藏文件夹“%windir%\installer”中。它确实被重命名,新名称是一个与原始名称没有明显关联的十六进制字符串。类似“123ab4.msi”的东西。

It's not hard to figure out which one is the cached copy of your app. The quickest way is to look for the cached file that's the same size. When you think you've found it, hover your pointer over the file's name in Windows Explorer. The tooltip will come up, and it will show you the data from the summary information stream of the package. Product name, author name, and so on. Once you've found the right file, you can directly edit it with a tool like Orca.

不难弄清楚哪一个是您的应用程序的缓存副本。最快的方法是查找大小相同的缓存文件。当您认为已找到它时,请将指针悬停在 Windows 资源管理器中的文件名上。将出现工具提示,它会向您显示包的摘要信息流中的数据。产品名称、作者姓名等。找到正确的文件后,您可以直接使用 Orca 等工具对其进行编辑。

If you're just trying to fix things on your own machine, then directly editing the cached database may be a good option. However, Microsoft does provide a built-in way to handle a problem like this. You can create a patch (an msp file), which contains the difference between the original msi file and your updated msi file. That patch could then be distributed to anyone else that has already installed your app using the original install, and it would be easy to use.

如果您只是想在自己的机器上修复问题,那么直接编辑缓存数据库可能是一个不错的选择。但是,Microsoft 确实提供了一种内置方法来处理此类问题。您可以创建一个补丁(一个 msp 文件),其中包含原始 msi 文件和更新后的 msi 文件之间的差异。然后可以将该补丁分发给已经使用原始安装安装了您的应用程序的任何其他人,并且它很容易使用。

MSDN discusses patch creation here - http://msdn.microsoft.com/en-us/library/aa368060%28VS.85%29.aspx

MSDN 在此处讨论补丁创建 - http://msdn.microsoft.com/en-us/library/aa368060%28VS.85%29.aspx

Deleting the hidden folder generally isn't a good idea, as that breaks some core functionality of the Installer service. That includes patching, detect and repair, and the ability to upgrade via migration rather than uninstalling and reinstalling.

删除隐藏文件夹通常不是一个好主意,因为这会破坏安装程序服务的一些核心功能。这包括修补、检测和修复,以及通过迁移而不是卸载和重新安装进行升级的能力。

回答by thrax

To see useful names of msi files in C:\Windows\Installerright click at the top of explorer and add the field to view Subject (will probably have to select more as it isn't a default like name, date modified, etc.) From here you can find the msi and use it to uninstall programs.

C:\Windows\Installer在资源管理器顶部右键单击查看有用的 msi 文件名称并添加字段以查看主题(可能需要选择更多,因为它不是默认值,如名称、修改日期等)从这里你可以找到msi 并使用它来卸载程序。

回答by Klaus Byskov Pedersen

Maybe the msi has simply been deleted. You can delete the installation folder and run the msi cleanup utility and then reinstall your program.

也许 msi 只是被删除了。您可以删除安装文件夹并运行 msi 清理实用程序,然后重新安装您的程序。