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

Installer.ProductState doesn't work...


3 replies to this topic

dxue

dxue
  • Full Members
  • 33 posts

Posted 29 November 2004 - 20:17

I found that Windows Installer's ProductState(ProductCode) method doesn't work with product that was installed by InstallShield. I created a installer using InstallShield Script project with the release configuration set as Single EXE. After installation on the target machine, I have another piece of VBScript code in which I created an Windows Installer object and call the object's ProductState() method with the correct product code as the parameter. What surprised me is that the return code of the call is always -1, product not installed. This function always works with products installed by MSI packages. Does this mean that I have to do go to InstallShield's own location that caches all the installed packages and scan all the folders there to find the right answer? Does anyone know anything about it?

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 29 November 2004 - 21:53

Windows Installer methods and APIs only work for Windows Installer - no suprise. If you install your product using Windows Installer (MSI) it should work. You can create MSI setups with IsntallShield.
However if you decide to build your setup as a legacy InstallScript project, without Windows Installer, then you cannot use MSI functions to retrieve the product state.

dxue

dxue
  • Full Members
  • 33 posts

Posted 30 November 2004 - 01:24

Hi Stephan,

Thanks for your reply. So Windows Installer and InstallShield keep seperate pools of installed products. Interesting thing is that the VerProductCompare() method in InstallShield X does give the correct state of the product even if it was installed using MSI. My assumption is that this InstallShield method first checks InstallShield pool of installed prodcut, then checks for the cached msi packages under Windows\\Installers directory for the package with the product code. Is that true.


Dong

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 30 November 2004 - 08:55

VerProductCompareVersions compares the version of the product being installed with the version of the already installed product. I think that it uses a GUID to identify the product. I don't think that a (pure) InstallScript project and a MSI project would (should) have the same GUID.