Skip to content
⌘ NSIS Forum Archive

How to block standard users from installing programs into their own profile

2 posts

shekara#

How to block standard users from installing programs into their own profile

I dont want my users to install application to C:\users\***\Downloads or documents or desktop. I want to abort installation with message saying it is invalid installdir. i tried .onVerifyInstDir which does not help in aborting or throwing any message.

Function .onVerifyInstDir
IfFileExists $PROFILE\*.* PathGood
MessageBox MB_ICONEXCLAMATION "$PROFILE\*.*"
Abort ; if $INSTDIR is not a winamp directory, don't let us install there
PathGood:
FunctionEnd

I tried $PROFILE​ which fails as well. any suggestions ? i tried something like ${If} $INSTDIR == "$PROFILE" which is failing.
Anders#
Something like StrLen on $Profile, then StrCpy on $Instdir with the maxlen from step 1, then compare the strings...