Reusing variables across setups [message #1739891] |
Fri, 05 August 2016 13:07 |
Christian Wolff Messages: 18 Registered: April 2016 |
Junior Member |
|
|
Hi,
I have multiple setups which (should) use the same variable, each one defines its own variable task with the same variable name "myvar". If I select multiple setups in the installer I am prompted to input the variable multiple times. How would I need to declare these variable tasks so that a user is only asked once and the variable is then reused? If I dont declare a variable task at all it seems I only get asked once, but if I add another project setup to an existing installation at a later time (which also uses this variable) another window pops up asking me for the same variable again.
I think I am just confused about the corrcet usage of variables and unfortunately the documentation (which is already pretty detailed for variables) did not help me much either. Did I miss something?
Thanks in advance!
Christian
EDIT: Apparently I did miss it I now define my variable tasks in the projects catalog and it works. However they are only asked when Eclipse first starts (not before the installation) but I guess since they are only first used at this point in time that this is something I have to live with?
[Updated on: Mon, 08 August 2016 11:09] Report message to a moderator
|
|
|
Re: Reusing variables across setups [message #1742040 is a reply to message #1739891] |
Fri, 05 August 2016 13:30 |
Ed Merks Messages: 33236 Registered: July 2009 |
Senior Member |
|
|
Christian,
Comments below.
On 05.08.2016 15:07, Christian Wolff wrote:
> Hi,
>
> I have multiple setups which (should) use the same variable, each one
> defines its own variable task with the same variable name "myvar". If
> I select multiple setups in the installer I am prompted to input the
> variable multiple times.
Yes, generally each stream is processed separately with variables all
expanded before they are composed into a single peformer. So generally
one doesn't need to worry if some other setup happens to use the same
variable name, perhaps for a totally different purpose.
> How would I need to declare these variable tasks so that a user is
> only asked once and the variable is then reused?
I think adding this annotation would do the trick:
<?xml version="1.0" encoding="UTF-8"?>
<base:Annotation
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:base="http://www.eclipse.org/oomph/base/1.0"
source="http://www.eclipse.org/oomph/setup/GlobalVariable"/>
This should force the Variables page to create a single prompted field
for the variable's value.
(Did you know you can copy full XMI text like the above and paste it
into a setup task?
> If I dont declare a variable task at all it seems I only get asked once,
Yes, normally the scope of the variable affects its uniqueness, but an
undeclared variable has no scope (isn't contained by anything).
> but if I add another project setup to an existing installation at a
> later time (which also uses this variable) another window pops up
> asking me for the same variable again.
Yes, value of the variable isn't stored.
>
> I think I am just confused about the corrcet usage of variables and
> unfortunately the documentation (which is already pretty detailed for
> variables) did not help me much either. Did I miss something?
The secret magical annotation. :-P
>
> Thanks in advance!
> Christian
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02832 seconds