I want to replace the VS setup by the Inno Setup. Do check if an old version is installed i found the 'MsiQueryProductState' method. I found several examples looking like this:
function MsiQueryProductState(ProductCode: string): integer;
external 'MsiQueryProductStateA@msi.dll stdcall';
function MsiConfigureProduct(ProductCode: string;
iInstallLevel: integer; eInstallState: integer): integer;
external 'MsiConfigureProductA@msi.dll stdcall';
const
INSTALLSTATE_DEFAULT = 5;
INSTALLLEVEL_MAXIMUM = $ffff;
INSTALLSTATE_ABSENT = 2;
Checking for the product always returned 2 and not the required 5 value (INSTALLSTATE_DEFAULT)
I found the mistake, I'll post it as an answer ...
Thank Freddy