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

Modifying user defined property


1 reply to this topic

druben

druben
  • Members
  • 12 posts

Posted 16 October 2001 - 22:15

I'm using ISWI automation in a vb .exe to modify a property in the property table of my .ism install. I've tried creating and accessing it as both a GLOBAL and Private property. I can access any of the default properties, such as ProductName and ProductVersion using the following example code, but this code fails for my property:

Dim oISM

Set oISM = CreateObject("ISWiAutomation.ISWiProject")

ismPath = "i:\src\install\iswi\exarchive.ism"

oISM.OpenProject ismPath

MsgBox "Old PRODUCTBUILD number: " & oISM.PRODUCTBUILD

Set oISM = Nothing

When I get to the MsgBox line, I get an error "438" stating "Object doesn't support this property or method". If I use a the ISWiProperties (collection object) just to view all the properties, I can read my property.

I have also tried using the ISWIProperties to access properties ie:
Dim pProperty
pProperty = oISM.ISWIProperties.Item("PRODUCTBUILD")

with the same results. If I use the above method to get a Windows Installer property (ProductVersion), I get an error "9" - Item could not be found.

Any ideas?


Thanks in advance for all help.
D. Ruben




druben

druben
  • Members
  • 12 posts

Posted 17 October 2001 - 14:51

Since I posted, I figured out how to access the properties within the property table.

Using the ISWiAutomation.ISWiProject object you can access properties in the summary stream, such as ProductVersion, ProductName, Package, Product and Updgrade codes. These can be accessed using the project object pointer, ie.  oISM.ProductVersion

If you wish to access properties within the Property table, use the ISWiPoperties collection object, like the following:

Set pProperty = oISM.ISWiProperties("PropertyName")

where PropertyName is the actual name of the property. To change the value of the property after getting a pointer to it, do the following:

pProperty.value = "Some other value"

To change the comment use:

pProperty.comment = "Another comment"

Good Luck!