Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

Here's a simple c# program that uses MsiGetProductInfo, as William Leara says, to get the actual location of the cached installer on disk.

class Program
{
    static void Main(string[] args)
    {
        Int32 len = 512;
        System.Text.StringBuilder builder = new System.Text.StringBuilder(len);
        MsiGetProductInfo("{89C098E5-C108-49F9-9B1D-10503C6D8A05}", "LocalPackage", builder, ref len);
        Console.WriteLine(builder.ToString());
        Console.ReadLine();
    }

    [DllImport("msi.dll", CharSet = CharSet.Unicode)]
    static extern Int32 MsiGetProductInfo(string product, string property, [Out] StringBuilder valueBuf, ref Int32 len); 
}

You could try, from the command line:

wmic product where "Name like '%your software here%'" get Name, Version, PackageCode

There is a free utility from Tarma Software Research that I found helpful for this. Get it from their website.

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.

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.

That key maps to HKEY_CLASSES_ROOT\Installer\Products\.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top