Launch from Windows installer fails to drop privileges

Having trouble installing or compiling FreeCAD? Get help here.
curtmcd
Posts: 10
Joined: Tue Aug 17, 2021 11:25 pm

Launch from Windows installer fails to drop privileges

Postby curtmcd » Tue Aug 17, 2021 11:45 pm

Hi all. First post here. I may have found a bug immediately after doing an all-users install of FreeCAD 0.18 on a Windows 10 64-bit machine.

When FreeCAD came up after installation, none of my network drives were visible from the "Open..." or "Save As..." menus. There was nothing wrong with the network drives. They were available in other applications, e.g. Windows Explorer.

I'm assuming what happens is when FreeCAD is launched for the first time by the installer itself, the installer fails to drop Administrator privileges and runs FreeCAD as Administrator so the user's network drives are not visible. After closing FreeCAD and restarting it, the network drives function normally.

Besides being an annoyance to new users, this would also be a security bug of unknown consequences. If there is agreement, I can file a bug in mantis.

Thanks,
-Curt
GeneFC
Posts: 2647
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Launch from Windows installer fails to drop privileges

Postby GeneFC » Wed Aug 18, 2021 12:07 am

Version 0.18 is outdated for new installs. Unlikely that a "bug" would be fixed even if verified.

Try with the current release version 0.19.

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

Re: Launch from Windows installer fails to drop privileges

Postby curtmcd » Wed Aug 18, 2021 12:24 am

GeneFC wrote: Wed Aug 18, 2021 12:07 am Version 0.18 is outdated for new installs. Unlikely that a "bug" would be fixed even if verified.
I'm curious why you put the word "bug" in quotes. Is this not of concern?
GeneFC wrote: Wed Aug 18, 2021 12:07 am Try with the current release version 0.19.
I can't. I had downloaded the installer today from the front page "DOWNLOAD NOW" button. The file name is:

FreeCAD-0.19.2.7b5e18a-WIN-x64-installer1.exe

However, after installing this latest version, "Help... About" reports:

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

So, that is a second bug.
User avatar
sgrogan
Posts: 6428
Joined: Wed Oct 22, 2014 5:02 pm

Re: Launch from Windows installer fails to drop privileges

Postby sgrogan » Wed Aug 18, 2021 12:55 am

curtmcd wrote: Wed Aug 18, 2021 12:24 am I can't. I had downloaded the installer today from the front page "DOWNLOAD NOW" button. The file name is:

FreeCAD-0.19.2.7b5e18a-WIN-x64-installer1.exe
Where did you get "DOWNLOAD NOW" ? This is a bug.
The version is correct.

Maybe you have 2 versions installed?
One at C:\Program Files\FreeCAD
The other at C:\Users\USERNAME\AppData\Local\FreeCAD 0.19

If so we can fix this.
"fight the good fight"
curtmcd
Posts: 10
Joined: Tue Aug 17, 2021 11:25 pm

Re: Launch from Windows installer fails to drop privileges

Postby curtmcd » Wed Aug 18, 2021 3:23 am

Thank you sgrogan, you are correct. Both 0.18 and 0.19 showed up in Add/Remove Programs, both in C:\Program Files.

I was confused because the 0.19 installer launched 0.18, and I had forgotten I'd ever installed 0.18.

I uninstalled both versions from Add/Remove Programs and re-installed 0.19 to reproduce the first bug. it's also still there. I was able to save a file to C:\Program Files\foo.FCStd.
openBrain
Posts: 6325
Joined: Fri Nov 09, 2018 5:38 pm

Re: Launch from Windows installer fails to drop privileges

Postby openBrain » Wed Aug 18, 2021 5:01 am

To me it doesn't look like a bug but the known limitation of the Qt/native file dialog. I'll find a link about how to change.

Edit : here the link https://forum.freecadweb.org/viewtopic. ... 80#p273068
GeneFC
Posts: 2647
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Launch from Windows installer fails to drop privileges

Postby GeneFC » Wed Aug 18, 2021 12:36 pm

curtmcd wrote: Wed Aug 18, 2021 12:24 am I'm curious why you put the word "bug" in quotes. Is this not of concern?
Bugs do not exist until they are verified. A strange occurrence is not necessarily a bug. It could even be intended behavior.

About half of the new forum members report "bugs" with their first post. In almost all cases the issue is not a bug at all.

I was not trying to say your concern is unimportant.

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

Re: Launch from Windows installer fails to drop privileges

Postby curtmcd » Wed Aug 18, 2021 6:44 pm

GeneFC wrote: Wed Aug 18, 2021 12:36 pm Bugs do not exist until they are verified. A strange occurrence is not necessarily a bug. It could even be intended behavior.
In this case there are two real bugs in the installer. I'd understand arguing about how they should be prioritized. They did cause at least one user grief in the first half hour of their experience.
About half of the new forum members report "bugs" with their first post. In almost all cases the issue is not a bug at all.
I can see where that could be annoying, at least in cases where reproduction would be difficult or time-consuming. Guidelines say that potential bugs should be discussed here before being filed. Anyway, enough with the meta-argument.

I see a comment in src/WindowsInstaller/include/gui.nsh

# The option to run FreeCAD from the finish page is currently disabled because
# it may run with Administrator priviledges, therefore causing a different
# user directory to be used. This could be fixed by creating a separate
# process without UAC elevation.
User avatar
Shalmeneser
Posts: 1263
Joined: Wed Dec 23, 2020 12:04 am

Re: Launch from Windows installer fails to drop privileges

Postby Shalmeneser » 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:
curtmcd
Posts: 10
Joined: Tue Aug 17, 2021 11:25 pm

Re: Launch from Windows installer fails to drop privileges

Postby curtmcd » 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?