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 ♦♦
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}">
      <!-- Accessing non-existent environment variables result in an empty string -->
      <compareText text="${username}" logic="equals" value=""/>

Thanks to Fabrizio Vitale for providing this information.


answered 14 Sep '11, 04:19

Jake's gravatar image

Jake ♦♦
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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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



Asked: 14 Sep '11, 04:16

Seen: 1,321 times

Last updated: 14 Sep '11, 04:19