My application requires few prerequisites like MATLAB runtime to be installed before my application runs. So on windows there is registry check rule which is helpful to check if the software is already installed. Ho can the same be done on MAC. I want to check if the software is already insalled, if no then my installer has to prompt for its installation.

asked 07 Mar, 00:52

RamyaVen's gravatar image

RamyaVen
1223
accept rate: 0%


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>
link

answered 16 Mar, 11:27

Michiel's gravatar image

Michiel ♦
82114
accept rate: 22%

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:

×130
×2

Asked: 07 Mar, 00:52

Seen: 1,213 times

Last updated: 16 Mar, 11:27