takluyver / pynsist

Build Windows installers for Python applications
https://pynsist.readthedocs.io/
Other
912 stars 120 forks source link

install for all users if installler is run with admin privilegs #258

Closed franzhaas closed 7 months ago

franzhaas commented 1 year ago

Dear all,

I ended up copying the nsis template and removed 1 line.:

!define MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER

Is there a more convenient way to do that?

Thanks in advance, Franz

takluyver commented 1 year ago

Hi Franz,

When you say 'with admin privileges', do you mean you're logged in as a user with admin rights, or are you doing something extra, like right-clicking and selecting run as admin. I think when I wrote this (years ago), I was aiming for it to do user installs by default for all users, even if they had admin access. But I haven't actually used Windows day-to-day since the XP era, so I'm pretty out of touch with how things behave nowadays.

franzhaas commented 1 year ago

Hi takluyver,

I have 2 use cases.

1.) i run a tool provided by our IT which creates a temporary user with admin rights and allows me to run a terminal as this user.

in both cases, I would like to have it installed system-wide.

Thanks for looking into this, Franz

takluyver commented 1 year ago

So are you running the installer from the command prompt in 'silent' mode (without the UI)? It looks like the multiuser support has command line options /AllUsers or /CurrentUser to select one or the other - does that help?

franzhaas commented 1 year ago

Hi takluyver,

amazing.... this works!

Thanks a lot! Franz

takluyver commented 1 year ago

No problem, glad it helped!

Do you think Pynsist should change the default behaviour? I'm still not quite sure how admin permissions work on Windows or what's common for other installers. :slightly_smiling_face:

franzhaas commented 1 year ago

I am sorry, I have no idea.