user2301
user2301

Reputation: 1967

NSIS: Set current user directory as default installation directory in nsis

what predefined variable to use to set the current user directory as default installtion directory in the script?

$INSTDIR path as "C:\Users{CURRENT_USER_ID}\Tools", where {CURRENT_USER_ID} is the unique logged in domain ID of the user.(for e.g. ed00345)

; The default installation directory
InstallDir C:\Users\{Current_USER_ID}\Tools

; Set output path to the installation directory.
SetOutPath $INSTDIR

Upvotes: 2

Views: 1826

Answers (1)

Anders
Anders

Reputation: 101764

From the documentation:

$PROFILE

The user's profile directory. A typical path is C:\Documents and Settings\Foo.

This constant is available on Windows 2000 and above.

InstallDir "$Profile\Tools"

but you should not really install programs there, please use $LocalAppData\Programs instead.

Upvotes: 5

Related Questions