views:

31

answers:

1

I'm working to simplify using an InstallShield template by setting components, parameters, and environment variables from an .ini file via the automation interface. I'm stumped as to the right way to set the environment variables called out in the project.

Are environment variables part of the ISWiProperties collection, or is there some other interface to access them? I walked the ISWiProperties list, and none of it seemed relevant.

+1  A: 

I've been doing alot of this lately ( basically writing my own custom DSL using XML and processing it with C# Linq-to-xml calling into ISAuto COM ) and I'm finding a great many places where the object model simply doesn't expose what you need. In those cases I save the project in binary format and use WiX DTF ( insert favorite MSI interop library for whatever language you are programming in ) to do raw MSI sql authoring similar to using the direct editor.

However for what you are talking about, according to the documentation, there is a AddEnvironmentVar method on the ISWiComponent object that returns a ISWiEnvironmentVar object.

From the help:

m_ISWiFeature.ISWiComponents("MyComponent").AddEnvironmentVar "MyEnvironment"

The ISWiEnvironmentVar class then has a number of attributes for the different settings.

Christopher Painter