How do I make the installer perform a string substitution as part of the installation?

asked 06 Sep '11, 08:32

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%


You can perform string substitutions with the substitution action. This action allows you to specify pattern/value pairs that will be substituted in certain files. It takes a list of glob file patterns separated by ';' and a list of the pattern/value pairs.

       <substitute>
         <files>*/launcher/launchMyJavaApp.sh;*/bin/*.sh</files>
         <substitutionList>
           <substitution>
             <pattern>@@INSTALLDIR@@</pattern>
             <value>${installdir}</value>
           </substitution>
           <substitution>
             <pattern>@@JAVADIR@@</pattern>
             <value>${installdir}/jre</value>
           </substitution>
         </substitutionList>
       </substitute>

Suppose the user sets /home/user/application as installdir and the original launchMyJavaApp.sh looked like:

#!/bin/sh
export MYAPPDIR=@@INSTALLDIR@@
@@JAVADIR@@/bin/java com.some.class.Name

Then the script will look like the following after installation:

#!/bin/sh
export MYAPPDIR=/home/user/application
/home/user/application/jre/bin/java com.some.class.Name

You can find more information about this action in Actions section of the product documentation included with InstallBuilder.

link

answered 06 Sep '11, 08:35

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%

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:

×13
×10

Asked: 06 Sep '11, 08:32

Seen: 1,785 times

Last updated: 12 Sep '11, 04:18