Launch from Windows installer fails to drop privileges

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Launch from Windows installer fails to drop privileges

Post by GeneFC »

I do not believe the exact history was ever spelled out. However, the steps to reproduce were stated a few weeks ago

*****

To reproduce:
- Download the 0.19 Windows 10 64-bit installer executable from FreeCAD
- Run the installer, approve Administrator, install to Program Files, tick the "Launch" checkbox at the end of the installer
- FreeCAD now running as Administrator

*****

Only people with Administrator credentials can do this. The entire complaint is based around some innocent ordinary user getting all confused and creating security problems.

Utterly impossible for ordinary users. Administrators should know how the system works.

Enough for me.

Gene
curtmcd
Posts: 14
Joined: Tue Aug 17, 2021 11:25 pm

Re: Launch from Windows installer fails to drop privileges

Post by curtmcd »

GeneFC wrote: Wed Sep 15, 2021 9:19 pmBut it was an Administrator who started the installation. Windows does not keep a history of users. Any reversion to a previous user would be a guess.
The problem is recognized in the FreeCAD source code comments, along with the solution I've mentioned twice before -- fork a separate process to do the Admin escalation and install, then go ahead and launch in the original process.

My response to the bewildering rationalization in the problem report is 'It is definitely a bug. The installer does not behave like all others as claimed -- name one. The launch button is currently not a convenience, but an inconvenience and a disservice to all new FreeCAD Windows users because it leads to unexpected trouble as described in the forum. The user expectation is not to "check if it went fine", but to use the program immediately. Admins rarely install this program; users do. Running an process that temporarily escalates privileges does not reclassify the physical human to be an IT Admin any more than the Unix "passwd" command does. New users to FreeCAD are subject to this installer and wouldn't know not to use the Launch button "feature" because they have never seen another installer broken like this.'

uwestoehr, haven't you worked on the gpg4win installer? It works correctly.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Launch from Windows installer fails to drop privileges

Post by uwestoehr »

GeneFC wrote: Wed Sep 15, 2021 9:46 pm Utterly impossible for ordinary users. Administrators should know how the system works.
+1
Exactly.

And for the last time: The installer provides you an option, if you don't want it, don't use it. I will not remove an optional feature just because some users might want to not use it. That's why the feature is optional and not mandatory.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Launch from Windows installer fails to drop privileges

Post by sgrogan »

GeneFC wrote: Wed Sep 15, 2021 9:46 pm Utterly impossible for ordinary users. Administrators should know how the system works.
Only sort of.
An ordinary Win user buys a new PC, fires it up, adds a username and password (or not). This user has admin privileges, that's why the installer can elevate privileges.
I don't know how easy/hard it is to elevate and de-elevate privileges with NCIS (this is what is used to build the installer)

I'm not against de-elevating the permissions, I'm leaning this way. Or an annoying pop-up that says "are you sure".

@uwestoehr, do you know how hard it would be to de-elevate privileges?

I think most Win users don't appreciate the privileges, similar to the indiscriminate use of sudo on Linux.
"fight the good fight"
User avatar
chennes
Veteran
Posts: 3882
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Launch from Windows installer fails to drop privileges

Post by chennes »

From a technical standpoint, I don't think core NSIS supports this directly, but this plugin seems to allow it.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Launch from Windows installer fails to drop privileges

Post by sgrogan »

chennes wrote: Thu Sep 16, 2021 8:44 pm From a technical standpoint, I don't think core NSIS supports this directly, but this plugin seems to allow it.
Thanks!
There may be some "Limitations"
Uwe, what do you think? From a "least privileges" point of view, could be an option?
"fight the good fight"
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Launch from Windows installer fails to drop privileges

Post by uwestoehr »

sgrogan wrote: Thu Sep 16, 2021 8:19 pm An ordinary Win user buys a new PC, fires it up, adds a username and password (or not). This user has admin privileges, that's why the installer can elevate privileges.
This is then no elevation. Then the user is already admin, so nothing is elevated - there is then only one level, the admin level. Therefore you will then not have to enter an admin password because your account is the admin.

Nobody forces you to use an optional feature you don't like and I will not remove an optional feature that was built in purposely since some users need/like this. And of course the run FC after installation button was and is meant to be run by the Win user who executed the installer, not someone else.

And also for the last time: the installer is just an executable like every other program. Run the cmd.exe with admin privileges. Then start e.g. the python.exe from this and Python has admin privileges. Windows just follows your will - you wanted the admin level and you get it. If you don't want admin level, then just don't request them.

I won't comment on this anymore. Everything is said and I am not responsible to explain admins their rights and duties on their OS.
(The thread here appears to me like "I requested admin privileges and now I have them but I don't wanted them".)
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Launch from Windows installer fails to drop privileges

Post by uwestoehr »

chennes wrote: Thu Sep 16, 2021 8:44 pm From a technical standpoint, I don't think core NSIS supports this directly, but this plugin seems to allow it.
This would contradict the idea of the option to run FC _from within the installer_. This feature is that the user who run the installer will run FC.
If you want to install FC for all users and run FC afterwards as non-admin user, just end the installer (since the installation is over) then start FC the normal way from your user account.
curtmcd
Posts: 14
Joined: Tue Aug 17, 2021 11:25 pm

Re: Launch from Windows installer fails to drop privileges

Post by curtmcd »

uwestoehr wrote: Thu Sep 16, 2021 11:44 pm
sgrogan wrote: Thu Sep 16, 2021 8:19 pm An ordinary Win user buys a new PC, fires it up, adds a username and password (or not). This user has admin privileges, that's why the installer can elevate privileges.
This is then no elevation. Then the user is already admin, so nothing is elevated - there is then only one level, the admin level. Therefore you will then not have to enter an admin password because your account is the admin.
This is incorrect. The user is not admin when they run the installer, they are not asking to run FreeCAD itself as Admin as in your bogus example of cmd.exe, and there is privilege escalation though standard UAC for the installer not FreeCAD. I don't think you understand this from a user's perspective rather than a developer or administrator.

You have improperly closed a real and important bug based on an odd opinion without addressing any of the points made. I'm left feeling there is no point in reporting any more bugs if such an incredibly basic one takes so much effort, only to get dismissed in such a manner, with other developers in approval of such nonsense.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Launch from Windows installer fails to drop privileges

Post by chrisb »

Let's stay factual. I will get a Windows computer with a standard installation and document what I see from a user's perspective who makes a first time install.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply