Detecting info about installed MSIs from Script
Posted 30 June 2004 - 21:49
From InstallScript, how do I detect if an MSI package is installed, and how do I find out its version?
Do I look for the exe's? (I hope there's a better way)
Do I look in the registry for the GUID? (where? which one? component or package or product?)
I would like to use the same method as windows installer to detect installed or previous versions.
Posted 01 July 2004 - 05:20
Another, slightly crazy, way to do it could be to add the upgrade codes for all the other setups to the parent setup's upgrade table and set a different property for each product detected (you could then detect what products are installed by checking which properties are set. I think the properties will be set with either the package code or the product code of the product it found with the upgrade code you specified). You would flag these upgrade table entries to be detection only, and not for use in a major upgrade.
Edited by Glytzhkof, 01 July 2004 - 05:22.
Posted 06 July 2004 - 14:54
The Windows Installer API isn't included be default in installscript projects.
I tried importing iswi.h and it doesn't let me! It says cannot include file. It works perfeclty fine in InstallScript MSI but I want IS-only. Why is that? Did anyone use msi functions in installscript only?
Posted 06 July 2004 - 16:09
I have never used Installscript to call this, but as I recall I added msi.lib and a couple of includes when I called WI API from an EXE I once created in visual studio.