I've defined an installer variable, "some_dir", in Pre-build actions. Its value is "detail". I put a Show Info Dialog in Post-build Actions to display its value. That correctly results in "some_dir is detail" as the installer is being built.

But when I put the same dialog in Post-install Actions I get "some_dir is *unknown variable some_dir***".

I thought the idea of an installer variable was to use it in the installer. What am I doing wrong?

<preBuildActionList>
    <setInstallerVariable>
        <name>some_dir</name>
        <persist>1</persist>
        <value>detail</value>
    </setInstallerVariable>
</preBuildActionList>

Thanks for any help. Using OSX version 16.4.0.

Scott

asked 24 May '16, 15:27

wscjr1's gravatar image

wscjr1
11368
accept rate: 0%


Please note that variables created at build time are not preserved at installation time. Using the <persist> option will only be effective for installation variables to be available at uninstallation time.

In order to solve your issue, you would need to create a <stringParameter> (setting the option <ask> to 0 will make it not visible in the installation wizard), and set its value at build time with a <setInstallerVariable>.

link

answered 24 May '16, 17:38

alejandror's gravatar image

alejandror ♦♦
1.3k127
accept rate: 31%

Thanks, this worked great.

I'd like to comment that the user guide should be more clear on this topic. The term "installer variable" tells me that it's something you can use in the installer. The fact that it isn't, should be made more obvious (at least I didn't see it).

(25 May '16, 15:01) wscjr1
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:

×92
×5

Asked: 24 May '16, 15:27

Seen: 327 times

Last updated: 25 May '16, 15:01