passing variables to msi
Hi,
I saw in another MSI, that its possible to pass variables to an MSI, which will change the values of a item.
The example attached DATAPATH= to the end of the msiexec command, which consequently changed the value of a registry key within the MSI.
Is this difficult? or does WI just search the MSI for an item with the same name, and applies the new value?
Rather than controlling a registry key, i'm looking to control the value of a shortcut.
Because the software i'm trying to deploy is server based, i'm trying to make it easier for future admins, to quickly change the servers path (incase the software is migrated).
I'm hoping for something like msiexec /i "C:\foo.msi" foo="\\resources_server\foo.exe"
Which would then change the installed start menu shortcut "foo"s target to "\\resources_server\foo.exe"
Is this possible?
Thanks,
Matthew Millar
I saw in another MSI, that its possible to pass variables to an MSI, which will change the values of a item.
The example attached DATAPATH= to the end of the msiexec command, which consequently changed the value of a registry key within the MSI.
Is this difficult? or does WI just search the MSI for an item with the same name, and applies the new value?
Rather than controlling a registry key, i'm looking to control the value of a shortcut.
Because the software i'm trying to deploy is server based, i'm trying to make it easier for future admins, to quickly change the servers path (incase the software is migrated).
I'm hoping for something like msiexec /i "C:\foo.msi" foo="\\resources_server\foo.exe"
Which would then change the installed start menu shortcut "foo"s target to "\\resources_server\foo.exe"
Is this possible?
Thanks,
Matthew Millar
0 Comments
[ + ] Show comments
Answers (5)
Please log in to answer
Posted by:
MSIPackager
14 years ago
Yes it's easy - you need to use a public property (as opposed to a private property) to pass the values on the command line.
A public property must be all uppercase characters e.g. SERVERPATH - you then reference it internally in your MSI / MST as [SERVERPATH]
You should initialise the property with a default value in the property table, then pass the alternative value on the command line as you saw - i.e. msiexec /i myapp.msi SERVERPATH=\\server\path /qb
Google "public properties" for more info from M$ [:)]
A word of warning though: if your package is repaired it will revert to the value in the property table, not what you passed on the command line. For this reason I prefer to create transform/s (MST) for the different configurations then install via msiexec /i myapp.msi transforms=mytransform.mst /qb (or whatever)
Cheers,
Rob.
A public property must be all uppercase characters e.g. SERVERPATH - you then reference it internally in your MSI / MST as [SERVERPATH]
You should initialise the property with a default value in the property table, then pass the alternative value on the command line as you saw - i.e. msiexec /i myapp.msi SERVERPATH=\\server\path /qb
Google "public properties" for more info from M$ [:)]
A word of warning though: if your package is repaired it will revert to the value in the property table, not what you passed on the command line. For this reason I prefer to create transform/s (MST) for the different configurations then install via msiexec /i myapp.msi transforms=mytransform.mst /qb (or whatever)
Cheers,
Rob.
Posted by:
shweta_kar
14 years ago
Posted by:
staffmm
14 years ago
Posted by:
cygan
14 years ago
I've got alot of reading up to do about MSI
what you need is a
1) quick grasp of the windows installer technology
2) knowledge of the msi tables , what they do and how to populate or manipulate them
3) grasp of ORCA
4) custom actions ie immediate/ deferred (when and how to use them)
5) troubleshooting tools ie procmon, regmon, filemon, installrite, regspy, wisecompcapture etc etc
6) using properties ie private / public / system etc
this will give you a good foundation to build on
Posted by:
anonymous_9363
14 years ago
Stumbled across this series of articles the other day. Nice backgrounder...
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.