# Set installation variable and create it if it does not exist

**URL:** <https://forum.universal-robots.com/t/set-installation-variable-and-create-it-if-it-does-not-exist/1641>\
**Category:** Java\
**Created:** [February 19, 2018, 8:42am UTC](https://forum.universal-robots.com/t/set-installation-variable-and-create-it-if-it-does-not-exist/1641 "2018-02-19T08:42:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![anon42905246](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@anon42905246](https://forum.universal-robots.com/u/anon42905246)\
**Post date:** [February 19, 2018, 10:04am UTC](https://forum.universal-robots.com/t/set-installation-variable-and-create-it-if-it-does-not-exist/1641/2 "2018-02-19T10:04:55Z")

</div>

> [@generateScript method called twice for the same ProgramNodeContribution](http://forum.universal-robots.com/t/generatescript-method-called-twice-for-the-same-programnodecontribution/1582/2):
>
> In general, the code should be able to handle multiple calls to the generateScript method. It can be called when program is saved, or typically when the program is played. At play instance, it could happen, if the user double-taps (debounce) on the Play button. Note: generateScript is only called, when all nodes in a program context return true on their respective isDefined calls.

Ok, so I didn’t realize, that there is something going on backstage. “generateScript” is called also when program is run. That is great. Now I can be sure, that my variables will be set. My fears were unfounded.

Therefore my case is closed.

---

_[View the full topic](https://forum.universal-robots.com/t/set-installation-variable-and-create-it-if-it-does-not-exist/1641)._
