How can I find out the name of the user which has launched the installer?

asked 14 Sep '11, 04:16

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%


There is an internal variable automatically set by the installer: ${system_username}. It works in all supported platforms, including Windows.

However, if you launched the installer using sudo and want to check the logged user, you can use ${env(SUDO_USER)}:

<!-- SUDO_USER is defined just when using sudo -->

<setInstallerVariable name="username" value="${env(SUDO_USER)}"/>

<setInstallerVariable name="username" value="${system_username}">
   <ruleList>
      <!-- Accessing non-existent environment variables result in an empty string -->
      <compareText text="${username}" logic="equals" value=""/>
   </ruleList>
</setInstallerVariable>

Thanks to Fabrizio Vitale for providing this information.

link

answered 14 Sep '11, 04:19

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%

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:

×156
×11
×9

Asked: 14 Sep '11, 04:16

Seen: 1,321 times

Last updated: 14 Sep '11, 04:19