I need to install my files into something like something like C:/apps/${product_shortname}-${product_version}

I see in the installdir parameter that it is referencing ${platform_install_prefix} which must dynamically select the default value for each OS. How do I go about modifying ${platform_install_prefix} for each OS?

I read this answer: http://answers.bitrock.com/questions/57/how-do-i-specify-a-different-default-installation-directory-for-unix-and-windows but I do not have a field for "Installation Directory" on the Customization/Installer tab that is referenced in this answer. I'm using BitRock InstallBuilder 8 Multiplatform (Professional).

asked 01 Jun '12, 14:57

courtenayt's gravatar image

courtenayt
1222
accept rate: 0%


You can simply reuse the <preInstallationActionList> action from that answer which sets the installation directory. In this case it would be:

<preInstallationActionList>
  <setInstallerVariable>
    <name>installdir</name>
      <value>${env(SYSTEMDRIVE)}/apps/${product_shortname}-${product_version}</value>
      <ruleList>
        <platformTest>
          <type>windows</type>
        </platformTest>
      </ruleList>
  </setInstallerVariable>
</preInstallationActionList>

which will set the installation directory to C:/apps, D:/apps or other disk depending on which drive is the system drive.

link

answered 04 Jun '12, 03:04

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

That's great. Thank you!

link

answered 04 Jun '12, 10:14

courtenayt's gravatar image

courtenayt
1222
accept rate: 0%

As I see this breaks --prefix switch. Is it possible to add some rule to detect --prefix is not used?

link

answered 22 Sep '14, 17:26

DominikS's gravatar image

DominikS
1
accept rate: 0%

To add on to wojciechka's answer, if you don't want to affect the user's ability to override the default, via --prefix or the UI, then use a <initializationActionList> to initialize the installdir with a reasonable default.

link

answered 24 Sep '14, 00:29

DevHopeful_2012's gravatar image

DevHopeful_2012
176131521
accept rate: 9%

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:

×36
×29

Asked: 01 Jun '12, 14:57

Seen: 2,217 times

Last updated: 24 Sep '14, 00:29