|
|
#1 |
|
Junior Member
Join Date: Feb 2006
Posts: 5
|
Is it possible to make an installer which can check permissions of user and make installation in HKLM or HKCU?
E.g. how to make InstallDirRegKey sensitive to current permissions? If user can, installer can use InstallationPath in the HKLM, otherwise put it in the HKCU. Is it possilbe? |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
I am not sure, but SHCTX from Manual, F.7 2.06 does this in gegistry instructions. May be this also works with attributes?
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2006
Posts: 5
|
But how to call it before InstallDirRegKey?
Seems the SetShellVarContext must be in section only: Error: command SetShellVarContext not valid outside section or function Or is it possible to put InstallDirRegKey in section? And also I wanna set SetShellVarContext to 'all' only if admin privileges. Is it possible? |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
InstallDirRegKey if first requested on 'dir' page, while Context might be defined on .onInit function. But I tested InstallDirRegKey attribute parameters and it looks like SHCTX is not accepted. So you need a bit more programming - read $INSTDIR string from HKLM or HKCU depending on the current context (if registry value exists). Few lines of code only
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Feb 2006
Posts: 5
|
It works! Thanks!
But InstallDirRegKey seems useless in this situation. |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Dec 2004
Location: Turkey
Posts: 447
|
correct
, feel fee to improve the NSIS source to improve the behaviour...
"Just do it" |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Feb 2006
Posts: 5
|
"fee" or "free"?
![]() Actually I am not sure how to improve... SetShellVarContext is also function-level stuff, and it is meanless to add SHCTX support for InstallDirRegKey. |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Feb 2006
Posts: 5
|
I suppose the solution can be something like this:
To allow multiple InstallDirRegKey directives, and it will check registry for a first existing key, install path will be amended to it. In this case you can write InstallDirRegKey HKLM ... InstallDirRegKey HKCU ... What do you think? Does it make sense? |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|