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

Get Msiexec arguments

I'd like to get the arguments passed to the command line msiexec...

Example : msiexec /i my_Msi.msi BU=HELLO

I'd like to know How I can retrieve the string BU=HELLO whitin a script in my project.

If someone can help....
(4) Replies
Hi there,

In MSI terms, it's really a property you are passing here, so depending in your script you could just read the value of the property.

For example, in a vb script that runs as an immediate custom actions, this could be a simple one liner:
strBUValue = Property("BU")

Hope it helps,
In fact, I must know if the property INSTALLDIR was past as argument in the command line to install my package... I can't know if the property has changed, because I don't know the first value of this property then I must really check for the command line used to install my package...
The initial value of INSTALLDIR, or identifiers in Directory table for that matter, will be determined after "daisy-chaining" during CostFinalize action, if the identifiers are not being set from command line or by custom actions prior to CostFinalize action. For explanations on "daisy-chaining", please refer to Directory table in MSDN.

You can use the same function mentioned by Marco to determine the value of INSTALLDIR by replacing BU with INSTALLDIR.
Exactly what I need...
Thanks for all !