Archive: Multi-User Install Logic


Multi-User Install Logic
Can anyone point me to a document that explains the logic of installing software on a machine with multiple users. For instance, many example NSIS scripts put the software in C:\Program Files\MyApp (or something of the sort) and then makes the install user specific by placing info under the HKCU key in the reg. Okay, suppose two users install my app on the same machine. The second install over-writes the copy of my app already in place in c:\Program Files\MyApp (which is fine assuming that both installs are of the same version number). But now one user decides to uninstall. Doesn't that effectively unstall MyApp for the second user as well? What is the right way to handle this sort of thing?

JAS


So in that scenario you shouldnt use HKCU, you should use HKLM\software instead. For the startmenu you should use $ALLUSERSPROFILE\startmenu. (cmd > set [enter] - it's a windows variable)

That will make the install into a generic one availiable to all users - I assume this is what you are asking? Ofcourse if one user uninstalls they'll all uninstall

Hope this helps


Well, that's part of what I need to know. Using your info, I can see that I could offer the installer the choice between making the app available to all users, or installing it only for the current user. But I am still left with my question about what happens if two users of the same machine chose the second of these options (i.e. if each of them installs only for himself). In that circumstance, doesn't one user deciding to uninstall effectively unstall for the other user as well?

JAS


Well yes, it would delete the files rendering the program unusable to others. However if they both installed it then one user would still have (useless) start menu shortcuts


So, I suppose, the only way to avoid this is to have the installer keep a record in the registry of how many users there are. Am I the only one who has ever worried about this?

JAS


You could just tell your users not to uninstall things without permission...