How to check if prerequisites are installed on MAC

Comments

1 comment

  • Avatar
    michiel

    You can check if the /Applications/Mathlab.app exists using a <fileTest> rule:

    <showInfo>
         <text>Please install Matlab first</text>
         <ruleList>
           <fileTest>
             <path>/Applications/Mathlab.app</path>
             <condition>not_exists</condition>
           </fileTest>
         </ruleList>
       </showInfo>
    

    Another way is to run the command which matlab using <runProgram> and check the `${program_exit_code}:

     <runProgram>
             <program>which</program>
             <programArguments>matlab</programArguments>
             <abortOnError>0</abortOnError>
             <showMessageOnError>0</showMessageOnError>
           </runProgram>
           <showInfo text="Please install Matlab first">
             <ruleList>
               <compareValues>
                 <value1>1</value1>
                 <value2>${program_exit_code}</value2>
                 <logic>equals</logic>
               </compareValues>
             </ruleList>
           </showInfo>
    

Please sign in to leave a comment.