cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Greg_R
Level 4

Using MsiQueryProductStateA - INSTALLSTATE undefined identifier

I apologize for this probably newbie question, but I'm trying to get my InstallScript to recognize the variable "INSTALLSTATE_DEFAULT", which is an INSTALLSTATE. The text for INSTALLSTATE_DEFAULT does turn blue, which I would think means that it's a recognized define/variable.

I'm checking the value that is being returned after calling MsiQueryProductStateA before attempting to install a redistributable (vcredist_x86.exe) and if it is anything but INSTALLSTATE_DEFAULT, I want to install the redistributable. However, when compiling, INSTALLSTATE_DEFAULT is coming back as an undefined identifier.

I know the underlying value is 5, but I'd prefer to use the actual variable define instead of the number 5.

Do I need to include some extra header or prototype the INSTALLSTATE variable somehow?

Thank you very much in advance for any help.

Greg R
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

If it's not already being #include-d, perhaps #include "ISMsiQuery.h"?
0 Kudos
Greg_R
Level 4

Hi Robert, thank you for your help. I had previously tried including "ISMsiQuery.h" but I was also getting errors that it cannot open the file. I am currently including "ifx.h" without any directories specified in front of it. So what I did is search for "ifx.h" and found that it is located in the following two spots:

Scripts\iswi\Include
Scripts\Ifx\Include

It looks like it's by default includes start in the Source\Ifx\Include directory so I'm now doing the following include and it compiles fine:

#include "..\..\iswi\Include\ISMsiQuery.h"

I don't know if that's what I was intended to do but it appears to work.
0 Kudos