How to create MSI Condition in shortcuts?
Hello All.
I'd like to ask on how I can control the installation of shortcuts using condition.
I have 3 different shortcuts it should be installed depending the computername.
The computer name starts with 3 letter abbreviation then random number.
those 3 shortcut has the same target exe but different argument. So How I can configure it?
Do I need script or custom action?
Thanks
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
anonymous_9363
10 years ago
Posted by:
rad33k
10 years ago
Hi,
as the Argument column in shortcut table is Formatted type, you may try with one shortcut in Shortcut Table and some [Property] in Argument Column. Of course you will need to set this property somwhere before accordingly to your computername - I would prefer VBS CustiomAction like this:
If COMPUTERNAME = "asd" Then
Session.Propety("ARGS")="argument asd"
ElseIf ...
Also you can control installation of shortcuts by component state so by setting conditions on components (Condition column in Component table) you can define if shortcut will be installed or not (when Component's condition is not meet, associated shortcut is not installed).
EDIT: Just like VBSCab said 3 min faster than me ;)
as the Argument column in shortcut table is Formatted type, you may try with one shortcut in Shortcut Table and some [Property] in Argument Column. Of course you will need to set this property somwhere before accordingly to your computername - I would prefer VBS CustiomAction like this:
If COMPUTERNAME = "asd" Then
Session.Propety("ARGS")="argument asd"
ElseIf ...
Also you can control installation of shortcuts by component state so by setting conditions on components (Condition column in Component table) you can define if shortcut will be installed or not (when Component's condition is not meet, associated shortcut is not installed).
EDIT: Just like VBSCab said 3 min faster than me ;)
Posted by:
EdT
10 years ago
The approach also depends on whether you wish to create advertised or non-advertised shortcuts. The above methods work for advertised shortcuts, but an alternative way does not use the shortcut table but instead creates shortcuts using VBScript. You can therefore do this using custom actions and have total flexibility on what parameters are passed to the script.