I see an option to set command-line parameters such as,

<directoryparameter> <name>installdir</name> ... <clioptionname>prefix</clioptionname> ... </directoryparameter>

But, how do I pass that parameter when I'm installing the package via dpkg -i?

asked 03 Jun '12, 04:54

drdrea's gravatar image

drdrea
1111
accept rate: 0%


It is not possible to pass parameters when installing as .deb/.rpm file. Also, as the files are pre-packaged in the archive, it is not possible to change installation directory - what is provided as the default value for the project will always be used.

InstallBuilder does not provide support for user interaction that rpm/dpkg interfaces provide. However, you can set environment variables and access them in the installer - for example:

<postInstallationActionList>
  <setInstallerVariable>
    <name>remote_hostname</name>
    <value>${ENV(REMOTE_HOSTNAME)}</value>
    <ruleList>
      <compareTextLength>
        <length>0</length>
        <logic>does_not_equal</logic>
        <text>${ENV(REMOTE_HOSTNAME)}</text>
      </compareTextLength>
    </ruleList>
  </setInstallerVariable>
</postInstallationActionList>

This will set InstallBuilder's remote_hostname variable if environment variable REMOTE_HOSTNAME is set. You can then install it using:

REMOTE_HOSTNAME=1.2.3.4 dpkg -i package.deb

However, it is not something that can be relied upon not to change in the future and can mainly be used as a workaround.

link

answered 04 Jun '12, 02:56

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Try this code on Post-installation actons

<runProgram>
<program>dpkg</program>
<programArguments>-i YorFile.deb</programArguments>
<runAs>root</runAs>
<useMSDOSPath>0</useMSDOSPath>
<workingDirectory>YourApplicationPath</workingDirectory></runProgram>
link

answered 04 Nov '14, 07:21

Bhavesh%20Patel's gravatar image

Bhavesh Patel
1
accept rate: 0%

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:

×4

Asked: 03 Jun '12, 04:54

Seen: 1,994 times

Last updated: 04 Nov '14, 07:21