1

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\

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?

Shintaro Takechi
  • 1,215
  • 1
  • 17
  • 39
  • For a specific application? – Gerhard Jul 24 '20 at 17:03
  • Yes for specific application(s). – Shintaro Takechi Jul 24 '20 at 17:05
  • `where /r c:\ Applicationname.exe` – Gerhard Jul 24 '20 at 17:06
  • I was hoping that there'd be something written somewhere. Because uninstall seem to know where it is. – Shintaro Takechi Jul 24 '20 at 17:09
  • Well, in that case. [this should answer your question](https://stackoverflow.com/questions/60172976/how-does-windows-find-the-installed-location-when-uninstalling-software) – Gerhard Jul 24 '20 at 17:10
  • I am not hiding the application installer. If you are so curious, I am looking for SAP Crystal Reports runtime engine for .NET Framework (32-bit) with GUID {007E6B4F-6276-470C-9799-E572E9A8C984} which is under Wow6432Node so yes I am aware of possibility with 32bit. As I stated, the registry for this GUID is visible. But the InstallLocation is not filled in. I checked the App Path but it was not located. – Shintaro Takechi Jul 24 '20 at 17:43
  • @Gerhard The answer definitely helped me. Thank you very much. – Shintaro Takechi Jul 24 '20 at 20:07

1 Answers1

1

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 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:

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:

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • Thank you very much for your reply. I have seen your other replies related to msi and it has been very helpful. – Shintaro Takechi Jul 28 '20 at 22:25
  • Thanks, you are welcome - hope it helped. Yes, MSI is a strange technology - [some very important benefits](https://stackoverflow.com/a/49632260/129130) (a bit down the page) and quite a bit of quirks: [common MSI problems](https://stackoverflow.com/questions/45840086/how-do-i-avoid-common-design-flaws-in-my-wix-msi-deployment-solution) and [maybe this ad-hoc sprawling one](https://stackoverflow.com/a/1055861/129130) (section on "anti-patterns"). – Stein Åsmul Jul 28 '20 at 22:34