cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Turning MST parameters into variables.

CChong
By Level 11 Flexeran
Level 11 Flexeran
Hi All,
Thanks for the previous help. I need help with this one..

Using MsiExec.exe command-line parameters, Properties, I want to be able to pass the ProductName and ProductVersion to an installation. I think this is possible with the right syntax,
MsiExec.exe /i "XYZ123.msi TRANSFORM=Certified.mst PRODUCTNAME=XYZ PRODUCTVERSION=123"

In my Certified.mst transform however, I then need to use those properties as variables. Any ideas on how to do this?

An explaination might help..
I package and certify software installations that my helpdesk WILL support. All other rogue installs are not supported. Ideally, I want to build a generic transform that will identify the supported installations by create a custom hidden executable and registry values. Name of the custom executable and the registry hive are based on the variables that are passed to it. This generic transform could then be applied to all of my MSI images.
I read somewhere that you can not pass variables to a MSI or MST, so I'm trying to get around that by using the parameters that it will accept.

Is this possible, or does anyone have a different approach?

Thanx in advance,
David Rico
(3) Replies
You can definitely pass variables to MSI and MST. However the properties must be public properties.... meaning that they must in Upper case in the Properties table.

ProductName and ProductVersion are default properties of any MSI package. Hence when you are creating the transform, you can create a registry entry that refers to [ProductName]. At run time MSI will automatically resolve this property to the actual name of the product.

Hope this helps. If you need more information please let me know.
CChong
By Level 11 Flexeran
Level 11 Flexeran
Thanx for the help. I don't know if this is possible but heres another thought.

Calling the install with,
msiexec.exe /i XYZ123.msi TRANSFORM=Certified.mst (without specifying the parameters.)

Is it possible for the generic Certified.mst to get the ProductName and ProductVersion properties from any MSI file that called it?

- DR
Yes.

ProductName and ProductVersion are mandatory properties for any given MSI package.