In a similar way that a --optionfile can be used to guide responses for an installation, is there a way that a system administrator for a corporate account could place a config type file adjacent to the setup*.exe file that would allow that system administrator to customize what components are seen/installed for users on their network. We'd like to do this so that we can avoid installing software that they're not licensed to use and give the admins control over what end users might install.

Thanks, LongTrail

asked 05 Jun '12, 15:59

LongTrail's gravatar image

LongTrail
1111
accept rate: 0%


This can easily be built by using xmlFileGet/iniFileGet actions. For example:

<iniFileGet>
    <file>${installer_directory}/setup.ini</file>
    <section>Features</section>
    <key>component1</key>
    <variable>enable_component1</variable>
</iniFileGet>
<if>
    <actionList>
        <setInstallerVariable>
            <name>project.component(component1).show</name>
            <value>0</value>
        </setInstallerVariable>
        <setInstallerVariable>
            <name>project.component(component1).selected</name>
            <value>0</value>
        </setInstallerVariable>
    </actionList>
    <conditionRuleList>
        <isFalse>
            <value>${enable_component1}</value>
        </isFalse>
    </conditionRuleList>
</if>

This will read setup.ini and check if key component1 in section [Features] is set to 1, yes or true. Simply setting it to anything else or removing this key will cause component1 not to be shown and installed.

This can be exdended to make it more difficult to guess component names by doing:

<!-- get MD5 checksum of some static string + component name to
   make guessing key names more difficult -->
<md5>
    <text>somesecretstring__component1</text>
    <variable>keyname</variable>
</md5>
<iniFileGet>
    <file>${installer_directory}/setup.ini</file>
    <key>${keyname}</key>
    <section>Features</section>
    <variable>enable_component1</variable>
</iniFileGet>
<if>
    <actionList>
        <setInstallerVariable>
            <name>project.component(component1).show</name>
            <value>0</value>
        </setInstallerVariable>
        <setInstallerVariable>
            <name>project.component(component1).selected</name>
            <value>0</value>
        </setInstallerVariable>
    </actionList>
    <conditionRuleList>
        <isFalse>
            <value>${enable_component1}</value>
        </isFalse>
    </conditionRuleList>
</if>
link

answered 06 Jun '12, 09:04

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Thank you, I think this may help.

(06 Jun '12, 15:48) LongTrail
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:

×22
×2
×2

Asked: 05 Jun '12, 15:59

Seen: 1,104 times

Last updated: 06 Jun '12, 15:48