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

Comments

Please log in to comment

Answers

0
Use a property to contain the argument, setting the property's value according to the computername. How you set the value will depend on the complexity of determining the computernames but I suspect you will need a Custom Action.
Answered 10/15/2014 by: VBScab
Red Belt

Please log in to comment
0
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 ;)
Answered 10/15/2014 by: rad33k
Orange Senior Belt

Please log in to comment
0
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.
Answered 10/16/2014 by: EdT
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity