Hello,

During the installation it needs to download and install Mono in Linux. How to do this please?

asked 08 Apr '15, 03:09

Codename%20K's gravatar image

Codename K
246596371
accept rate: 50%


Mono may be installed in multiple ways and even bundled as part of the application. If Mono is installed as part of application deployment, this simply requires adding the files and creating appropriate scripts that run Mono binaries relative to installation path.

If using the built-in package system, below is an almost complete example of how to check if Mono is installed on dpkg (Ubuntu / Debian) and RPM (CentOS, RHEL and SLES) based systems:

<runProgram> <program>dpkg-query</program> <programArguments>-W libmono2.02.0-cil</programArguments> <ruleList> <programTest condition="is_in_path" name="dpkg-query" /> </ruleList> </runProgram> <if> <actionList> <setInstallerVariable name="mono_installed" value="1" /> </actionList> <conditionRuleList> <compareValues logic="equals" value1="1" value2="${program_exit_code}" /> </conditionRuleList> <elseActionList> <setInstallerVariable name="mono_installed" value="0" /> </elseActionList> <ruleList> <programTest condition="is_in_path" name="dpkg-query" /> </ruleList> </if>

Similarly for RPM it would be mono-core. And check for first one would be:

<runProgram> <program>rpm</program> <programArguments>-q mono-core</programArguments> <ruleList> <programTest condition="is_in_path" name="rpm"/> </ruleList> </runProgram> <if> <actionList> <setInstallerVariable name="mono_installed" value="1"/> </actionList> <conditionRuleList> <compareValues logic="equals" value1="1" value2="${program_exit_code}"/> </conditionRuleList> <elseActionList> <setInstallerVariable name="mono_installed" value="0"/> </elseActionList> <ruleList> <programTest condition="is_in_path" name="rpm"/> </ruleList> </if>

It is then possible to use an <isFalse> rule to check ${mono_installed} and if not, try to run yum or apt-get command appropriately to install it.

For example for Debian/Ubuntu it would be:

<runProgram> <program>apt-get</program> <programArguments>-y install mono-runtime</programArguments> <ruleList> <isFalse> <value>${mono_installed}</value> </isFalse> <programTest> <condition>is_in_path</condition> <name>apt-get</name> </programTest> </ruleList> </runProgram>

link

answered 12 Apr '15, 07:35

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

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:

×73
×36
×24
×9
×9
×5

Asked: 08 Apr '15, 03:09

Seen: 1,364 times

Last updated: 12 Apr '15, 07:35