This might sound off topic, but bear with me please because I think it's a programming question at its core.
I have an installer for a really old application that I need to get installed on my Windows 8.1 PC. The installer does a check for Visual C++ 2005 SP 1, and if you don't have it, it prompts you to install it, and it redirects you to download it, except that download page redirects to a Microsoft 404.
I have VC++ 2005 SP 1 installed with both x86 and x64.
So, I decompiled the installer using JustDecompile, and the installer was in WinForms and used this code below to check for VC++ 2005 SP 1.
Basically if this line of code was true, it would show a message that you need to get VC++.
if (Form1.MsiQueryProductState("{7299052B-02A4-4627-81F2-1818DA5D550D}") != 5)
I've read about it and that was an acceptable way to check for VC++ 2005 in the time of the dinosaurs, but I believe that GUID above which is a product code is no longer accurate for Win 8.1 because I've gotten VC++ 2005 SP 1 directly from Microsoft and it's still not finding it.
Now, I'd like to figure out how to work around this problem. Does anyone know how the method MsiQueryProductState
determines if you have something installed for a given product code? Does it look in the registry somewhere? If so, I could maybe work around this by faking it in the registry or something.
Any other suggestions appreciated!
Edit to answer questions from comments
From what I can tell when I decompiled this installer, it's a custom WinForms application. It's an EXE, not an MSI. It has a single form named Form1, which displays a list of products you can install. You select which products you want and click the Install button, and on clicking the Install button it calls a method that first checks for VC++.
It checks for VC++ with the following code, which has a hard coded product code for VC++. If the return value of MsiQueryProductStatus != 5, then it prompts you that you have to install VC++ and won't let you continue.
Form1.MsiQueryProductState("{7299052B-02A4-4627-81F2-1818DA5D550D}") != 5
And here's how Form1 defines MsiQueryProductState.
[DllImport("msi.dll", CharSet=CharSet.None, ExactSpelling=false)]
private static extern int MsiQueryProductState(string szProduct);
So I need to figure out either how to get VC++ with the product code 7299052B-02A4-4627-81F2-1818DA5D550D installed, or else I need to figure out how to trick MsiQueryProductState into thinking I have the VC++ with that product code installed.