/build/static/layout/Breadcrumb_cap_w.png

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)

Posted by: anonymous_9363 9 years ago
Red Belt
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.
Posted by: rad33k 9 years ago
Fourth Degree Brown Belt
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 ;)
Posted by: EdT 9 years ago
Red Belt
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.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ