Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Detecting info about installed MSIs from Script


3 replies to this topic

vladb

vladb
  • Members
  • 15 posts

Posted 30 June 2004 - 21:49

I am using an InstallScript interface (it doesn't install anything, just the UI) to launch a bunch of MSIs.

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.

Thanks

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 01 July 2004 - 05:20

Never done this, I suppose you could use the MsiOpenProduct, MsiGetProductInfo or similar Windows Installer API function. Here is more info:

http://msdn.microsof...n_reference.asp

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.

Regards
-Stein Åsmul

vladb

vladb
  • Members
  • 15 posts

Posted 06 July 2004 - 14:54

How do you use WI Api in InstallScript-only project?

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?

Thank you.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 06 July 2004 - 16:09

You probably need to link to msi.dll or msi.lib and include something like "msi.h" if it exists (and possibly other header file). I am not sure where these functions are defined and implemented, but it should say in the SDK.

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.
Regards
-Stein Åsmul