我希望用Inno Setup来替换VS安装程序。如果发现旧版本已经安装,可以使用'MsiQueryProductState'方法进行检查。 我找到了几个类似以下示例的例子:
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;
检查产品始终返回2而不是所需的5个值(INSTALLSTATE_DEFAULT)
我找到了错误,我将其发布为答案...
感谢Freddy