How do I install desktop Application shortcut Icons only if a certain rule has been met?

I have an installer that will be used on a local computer and a remote computer, but I only want the icons installed on the local computer. I already have a dialog that asks the user which system the current installation is for, so I have a variable I can reference, I just need to know how to make a rule for the shortcut icons to check before they are installed??

asked 11 Nov '11, 14:25

Curtis%20Rubel's gravatar image

Curtis Rubel
16112
accept rate: 0%


Basically you can just add a ruleList section to the end of your shortcut section......

<shortcut> 
   <comment>Start VistaMUSE IOS</comment>
   <exec>/usr/local/bin/start_vm.sh</exec>
   <icon>utilities-system-monitor</icon>
   <name>Start IOS</name> 
   <path></path> 
   <platforms>linux</platforms>
   <runasadmin>0</runasadmin>
   <runinterminal>0</runinterminal>
   <windowsexec></windowsexec>
   <windowsexecargs></windowsexecargs>
   <windowsicon></windowsicon>
   <windowspath></windowspath>
   <rulelist> 
     <comparevalues>
       <logic>equals</logic>
       <value1>${installComputer}</value1>
       <value2>Host</value2> 
     </comparevalues> 
   </rulelist> 
</shortcut>
link

answered 11 Nov '11, 15:24

Curtis%20Rubel's gravatar image

Curtis Rubel
16112
accept rate: 0%

You can also use a <createShortcuts> action, which do not require adding the shortcut to any folder. It is especially useful when creating shortcuts on demand in the final page:

<createShortcuts>
    <progressText>Do you want to create a shortcut in the Desktop?</progressText>
    <destination>~/Desktop</destination>
    <shortcutList>
      <shortcut>
         <comment>Start VistaMUSE IOS</comment>
         <exec>/usr/local/bin/start_vm.sh</exec>
         <icon>utilities-system-monitor</icon>
         <name>Start IOS</name> 
         <runasadmin>0</runasadmin>
         <runinterminal>0</runinterminal>
      </shortcut>
    </shortcutList>
    <rulelist> 
      <comparevalues>
        <logic>equals</logic>
        <value1>${installComputer}</value1>
        <value2>Host</value2> 
      </comparevalues> 
   </rulelist> 
</createShortcuts>

You can find additional information in this article

link

answered 13 Nov '11, 10:31

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Why can't a component contain a shortcutList? Why can't a startMenuShortcutList in a component specify a ruleList?

The object type <component> cannot contain tag <shortcutlist>

Isn't this essentially the same as a startMenuShortcutList?

Error: tag element <rulelist> can't be a child of <startmenushortcutlist>

(30 Mar '12, 00:05) DevHopeful_2012

In installbuilder, *List elements are just meant to contain its child type. In this particular case, the <shortcutList> can only contain <shortcut> elements, which are the ones that can contain the rules. Actions behave in a similar way.

Regarding the differences between the <startMenuShortcutList> and a regular <shortcutList> is that the <startMenuShortcutList> have a predefined location (the start menu), where <shortcutList> are specified inside folders, which define the location (the <destination> of the folder)

(03 Apr '12, 16:49) juanjo ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×42
×29
×13

Asked: 11 Nov '11, 14:25

Seen: 4,825 times

Last updated: 03 Apr '12, 16:49