Old 5th September 2006, 16:39   #1
joachim
Junior Member
 
Join Date: Sep 2006
Location: Germany
Posts: 2
Install for all users or current user: Can NSIS help?

Hi,
Modern apps should allow the user to install, even without admin rights. A user with admin rights should be given the choice how to install. Depending on what choice the user makes the installer should write to HKEY_LOCAL_MACHINE or to HKEY_CURRENT_USER.

This is expecially important when dlls must be registered, because without admin rights the registration in HKEY_CLASSES_ROOT will usually fail. Instead of HKCR one should use either HKLM\Software\Classes or HKCU\Software\Classes.

Does NSIS provide any support for this?
Is there a page that asks this question or must I create one myself? Is there a standard variable to use during installation and uninstallation?

Cheers,
Joachim
joachim is offline   Reply With Quote
Old 5th September 2006, 16:43   #2
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
I have seen some NSIS installers ask this question using a custom page designed with InstallOptions, but I do not beleive there is a built in page to ask this.
Backland is offline   Reply With Quote
Old 5th September 2006, 16:53   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Use InstallOptions to create the dialog and depending on the radio buttons state, SetShellVarContext to all or current.

-Stu
Afrow UK is offline   Reply With Quote
Old 5th September 2006, 23:42   #4
joachim
Junior Member
 
Join Date: Sep 2006
Location: Germany
Posts: 2
Thanks for the answers.
I managed to create such a custom page, but of course the strings on this page will remain untranslated.

As for SetShellVarContext I found out, that this information must be saved somewhere, so that it is again available for the uninstall step. This variable I placed in the registry among my other app-settings. "HKCU/Software/Appname/InstalledForAllUsers".

By now it seems to work but I would still appreciate if original dialogs of NSIS could contain something of that kind.

Joachim
joachim is offline   Reply With Quote
Old 1st October 2009, 09:47   #5
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 145
Hi,

I also need to use such a page in my script. Is there already an easier solution (standard page in NSIS, or a plug-in, or something else...)?
TrifonovS is offline   Reply With Quote
Old 1st October 2009, 12:29   #6
Zinthose
Senior Member
 
Join Date: May 2009
Posts: 152
NSIS already permits this ability using the "MultiUser" header included. Take a look at:
http://nsis.sourceforge.net/Docs/MultiUser/Readme.html
http://nsis.sourceforge.net/Docs/MultiUser/Readme.html
Zinthose is offline   Reply With Quote
Old 6th October 2009, 09:11   #7
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 145
Hi guys,
The MultiUser header solved my problem, but here it comes the next one (I don't know if this forum is suitable for such discussion). I have to deliver information to the applications that I installed what kind of installation is selected, because they also must access the corresponding registry area. What is the normal way to do this? I suppose that I have to write a registry value under HKLM that corresponds to the selection... Is this the right way?
TrifonovS is offline   Reply With Quote
Old 6th October 2009, 10:01   #8
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You can use the registry, or write to an ini file in the app's directory, or whatever you prefer.

Of course if it's a single-user install, you can also use HKCU instead of HKLM.
MSG is offline   Reply With Quote
Old 6th October 2009, 10:11   #9
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 145
If I write to HKCU by installation for the current user only, how the applications will know where to find this registry key (HKCU or HKLM)? Isn't correct to write such a common key always in HKLM? Depending on this key the applications can get information in which area they have to work. Sorry for the stupid questions, but I really don't have experience with this...
TrifonovS is offline   Reply With Quote
Old 6th October 2009, 10:22   #10
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Like I said, you can use HKCU if it's a single-user install. If you want things to work the same for all users, then yes of course you have to use HKLM.
MSG is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump