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!
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: Launch from Windows installer fails to drop privileges

Post by kisolre »

curtmcd wrote: Thu Aug 19, 2021 6:42 am I would like to install 0.20, as the bug tracker web page says to post bugs for 0.20 only. Where do you get that?
From the download page you can get to here: https://github.com/FreeCAD/FreeCAD-Bund ... kly-builds but since there is no installer there this will not help in this case.
User avatar
Shalmeneser
Veteran
Posts: 9560
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Launch from Windows installer fails to drop privileges

Post by Shalmeneser »

v0.20 : Look at the bottom of Download page : "FreeCAD weekly builds page" link.
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 »

As a followup, FreeCAD "installation" is very minimal compared to most programs.

* The main program is placed in the location of the user's choice. Default is Program Files, but not mandated.

* The user folders are setup in C:\\Users\#####\AppData\Roaming\FreeCAD.

* A start shortcut is established.

* A very small amount is added to the registry. The only thing FreeCAD uses in the registry is the window positions, sizes, and docking. The QT module puts those items in the registry.

If you have installed FreeCAD even once it will be no problem at all to use the non-install "unpack and run" development versions.

Gene
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 »

curtmcd wrote: Thu Aug 19, 2021 6:42 am
Shalmeneser wrote: Wed Aug 18, 2021 7:01 pm
curtmcd wrote: Wed Aug 18, 2021 6:44 pmThey did cause at least one user grief in the first half hour of their experience.
No new user would try to install 0.18 and 0.19 in the same half hour. :roll:
You should try v0.20, it's even better ! :lol:
This is a bug report, not an attack on FreeCAD.

I had installed 0.18 in March and forgotten about it. The 0.19 installer ran the 0.18, and also ran it as Administrator.

I would like to install 0.20, as the bug tracker web page says to post bugs for 0.20 only. Where do you get that?
Thanks. It is a bug. I run as local admin and can't reproduce yet,
0.20.xxxxx are dev versions that run without installation. They don't touch the registry, but do share the .cfg (and other) files in C:\\Users\#####\AppData\Roaming\FreeCAD. You just unzip them and run.

If in fact the installer gives FreeCAD admin privileges after install it's a big deal. Again I can't reproduce yet.
"fight the good fight"
curtmcd
Posts: 14
Joined: Tue Aug 17, 2021 11:25 pm

Re: Launch from Windows installer fails to drop privileges

Post by curtmcd »

Thanks all.
sgrogan wrote: Fri Aug 20, 2021 4:50 pmThanks. It is a bug. I run as local admin and can't reproduce yet,
0.20.xxxxx are dev versions that run without installation. They don't touch the registry, but do share the .cfg (and other) files in C:\\Users\#####\AppData\Roaming\FreeCAD. You just unzip them and run.

If in fact the installer gives FreeCAD admin privileges after install it's a big deal. Again I can't reproduce yet.
Since the bug is in the installer, to reproduce with 0.20 would require building the Windows release package. I'm sure the problem would still be there.

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 (and possibly not 0.19 if more than one version is installed).
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 »

curtmcd wrote: Fri Aug 20, 2021 7:29 pm and possibly not 0.19 if more than one version is installed).
The FreeCAD executable file is always FreeCAD.exe, without any version identification. If the shortcut points to a location that contains FreeCAD.exe it will open whatever it finds.

It might be useful in the future to include some sort of forced uninstaller like occurs for some programs, but a lot of folks like to have more than one version installed.

Gene
chrisb
Veteran
Posts: 54207
Joined: Tue Mar 17, 2015 9:14 am

Re: Launch from Windows installer fails to drop privileges

Post by chrisb »

uwestoehr wrote: pinged by pinger macro
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
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 »

curtmcd wrote: Fri Aug 20, 2021 7:29 pm 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 (and possibly not 0.19 if more than one version is installed).
Thanks.
So the question is this the desired behavior. From the GUI I would guess not. But from non-gui installation I can see a use case for, after granting FreeCAD admin as part of the installation, that starting FreeCAd as admin, too maybe set some prefs could be desirable.
At any rate, starting a previous version as admin doesn't make sense to me.

For Win users read the OP. It is only if you launch FreeCAD as part of the installation process, that the problem occurs. That tripped me up as well.
"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 »

I am the author of the Win installer but have not yet understood the problem.

The installer allows you to install FC of al users of Windows or not. If you install only for the current users no admin privileges are necessary. To be able to install for all users, you need admin privileges. So when doing this from a user's account the installer correctly asks your for the admin password.

After the installation, you can start FC immediately. If you do this while having installed for al users, FC is started as being executed from your admin account of course. This makes sense since also as admin you might want to check if everything works fine.
(Note also that the admin account is designed in Windows as the one to install and organize things for all users, not to be used as a normal user. A least for security reasons this is even a no-go.)

You can also install FC without a GUI, by using the command line, see section 3.2 here: https://nsis.sourceforge.io/Docs/Chapte ... allerusage
(replace "installer.exe" by the name of the FC installer .exe)

What is in your opinion a bug that should be fixed?
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: Sat Aug 21, 2021 8:54 pm - Run the installer, approve Administrator, install to Program Files, tick the "Launch" checkbox at the end of the installer
- FreeCAD now running as Administrator (and possibly not 0.19 if more than one version is installed).
That's correct. That is the same as if you e.g. start the cmd.exe with admin privileges and then execute from this e.g. Java. then Java has admin privileges too. (See also my previous post).
Post Reply