Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
840 views
in Technique[技术] by (71.8m points)

installation - How does Windows find the installed location when uninstalling software

When I run an installer that allows a custom install location/path, the files will be correctly placed at the location that I select.

When I run the same MSI and select remove (or uninstall from add/remove programs), how does it know the install location so the correct files are removed?

I thought it would be stored at 'ComputerHKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall{GUID}', but when I look at that location for my installed software, the 'InstallLocation' key is empty.

However, no matter how I uninstall it, it knows which folder to go remove, no matter where I put it. Is that information stored elsewhere in the registry, or in the MSI file itself?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is a very complicated question as MSI can be configured to drop its uninstall files anywhere you tell it. Usually by default though it will create an uninstall .msi file with a specific name in C:WindowsInstaller.

But don't depend on the uninstall .msi being placed in this directory and don't rely on there being an uninstall path in the Uninstall registry key. This key is as much about convenience for the end-user as anything else.

The uninstall information is usually contained within the MSI file, but it need not be and during installation it can create keys to aid upgrading and uninstallation. The information that an installation will leave in the registry is entirely down to how you configure the .msi database.

Adding a few more things... many installers like Nullsoft, InstallAware and InstallShield like to do their own stuff and put their uninstall information in other places. So InstallShield likes to create an InstallShield Installation Information folder and Nullsoft likes to create .dat files and an uninstall.exe. But beyond all this, these installers are still invoking MSI and creating installation tables and database. So where the uninstall information is actually located it not an exact science!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...