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

How to put self-gen ProdCode into distr source ?


2 replies to this topic

vips

vips
  • Members
  • 9 posts

Posted 14 November 2003 - 10:09

Hello all,

I have the following problem:

I have the self-written database application that performs the product version calculation each time when developers introduces new features or bugfixes to the project. I suppose that Product Code is GUID and my app automatically generate the Product Code when the Product version changes.

How can I automatically put these values (new version and self-gen Product Code) to the InstallShield Express source ?

Should I use another installator shell to perform this task ? It seems that InstallShield Express supports no automation at all sad.gif

Thanks in advance,
Valery

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 20 November 2003 - 02:27

I have never used Installshield Express, but I assume it also saves the project file as a regular MSI file. If this is indeed the case you can access it using regular Windows Installer automation. Here is a sample:

CODE
Dim oneWindowsInstaller, oneInstallerDatabase, oneView, oneRecordObject

' Update the "Update" table in the MSI database file
Set oneWindowsInstaller = CreateObject("WindowsInstaller.Installer")
Set oneInstallerDatabase = oneWindowsInstaller.OpenDatabase( "c:\test.ism" , 1)

' Set up SQL query for the upgrade table - DETECT NEWER VERSION INSTALLED
Set oneView = oneInstallerDatabase.OpenView ("SELECT * FROM Upgrade WHERE ActionProperty = 'CHECKCURRENTINSTALL'")

   ' Execute the view, so its methods can be used.
   oneView.Execute

   'Fetch records
   Set oneRecordObject = oneView.Fetch

  ' Assign new values to recordset
  oneRecordObject.StringData (2) = "Value you want to change"
  oneView.Modify 4, oneRecordObject
  oneView.Close

Set oneRecordObject = Nothing

' Commit database changes
oneInstallerDatabase.Commit

' Release objects
Set oneWindowsInstaller = Nothing
Set oneInstallerDatabase = Nothing
set oneView = Nothing

Edited by Glytzhkof, 20 November 2003 - 02:30.

Regards
-Stein Åsmul

vips

vips
  • Members
  • 9 posts

Posted 20 November 2003 - 05:49

Thank you, Glytzhkof, I'll try it...

Actually I found the automation interface in IS Developer that allows to change the values in the source

Anyway this is a good example, thanks again smile.gif