[Coordination]Windows freecad installer update to 0.18

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

[Coordination]Windows freecad installer update to 0.18

Post by sgrogan »

Picking up from here:https://forum.freecadweb.org/viewtopic. ... 54#p294892

I use this as the base https://github.com/FreeCAD/FreeCAD/blob ... taller.nsi
I had to change the redist exe name because it's different for VS2013 and VS2015. I also change the Python 2.7 to 3.6, not sure what we are doing here?
uwestoehr wrote: Mon Mar 18, 2019 10:02 pm So when installing FC, the installer can check if MSVC runtime is installed, if not and if the user doesn't have admin permissions, it distributes the DLLs with FC. This is how I do it in the installer for LyX.
The redist dll's are hard to update. I have the same misgivings for the developer builds, only they just last a few days and are deleted, nothing with the reg.

We don't offer to start, review the release notes, create a desktop short cut, or start menu entry.
Any chance we could improve the compression?

I appreciate the help uwe :)
"fight the good fight"
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [Coordination]Windows freecad installer update to 0.18

Post by uwestoehr »

sgrogan wrote: Mon Mar 18, 2019 10:05 pm The redist dll's are hard to update.
We don't offer to start, review the release notes, create a desktop short cut, or start menu entry.
Any chance we could improve the compression?
I appreciate the help uwe :)
OK, give me some time and I'll come up with an installer. I hope tomorrow or at least on Wednesday.
Note that you don't have to execute the MSVC runtime. Just deploy the DLLs.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Coordination]Windows freecad installer update to 0.18

Post by sgrogan »

uwestoehr wrote: Mon Mar 18, 2019 11:45 pm OK, give me some time and I'll come up with an installer. I hope tomorrow or at least on Wednesday.
Thanks
uwestoehr wrote: Mon Mar 18, 2019 11:45 pm Note that you don't have to execute the MSVC runtime. Just deploy the DLLs.
Yes, I know how to do this, but I don't know if it will be accepted as a solution.
"fight the good fight"
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: [Coordination]Windows freecad installer update to 0.18

Post by apeltauer »

Next problem: as fare as I know, if you want to install to program files, you need admin permission.
Btw. Installing a program is always a task which should be done by a person with permission. If you do not have this permission, you are not allow do installl stuff... And copying the runtime Dlls is the worst thing you could do! You don’t have any chance to debug a problem with different runtime version!
So in my opinion the installer need admin permission and you should also install the runtime with the installer and not just copy anything around...
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [Coordination]Windows freecad installer update to 0.18

Post by uwestoehr »

uwestoehr wrote: Mon Mar 18, 2019 11:45 pm
sgrogan wrote: Mon Mar 18, 2019 10:05 pm
OK, give me some time and I'll come up with an installer. I hope tomorrow or at least on Wednesday.
OK, here is my first shot:
https://stühlinger-magazin.de/wordpress ... ller-1.exe

Here is the installer source code:
https://stühlinger-magazin.de/wordpress ... taller.zip
(In the folder "information" you find info abut the installer structure.)

Note that there are for sure still some unresolved issues and a lot of unnecessary stuff.

The key features are:
- you can install FC also without admin permissions
- *.FCStd files are associated to FC
- installer is already translated to more than 10 languages
- installer understands Unicode so users can install FC also to a folder containing for example accented characters
- the MSVC redistributable files are already included
- option to set a desktop icon and option to start FC after installing
sgrogan wrote: Tue Mar 19, 2019 8:14 pm Yes, I know how to do this, but I don't know if it will be accepted as a solution.
I don't understand. You must distribute the MSVC DLLs with programs compiled with it.
Here is a list of distributable DLLs:
https://docs.microsoft.com/en-us/cpp/id ... ew=vs-2017
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [Coordination]Windows freecad installer update to 0.18

Post by uwestoehr »

apeltauer wrote: Tue Mar 19, 2019 9:02 pm Next problem: as fare as I know, if you want to install to program files, you need admin permission.
That is not true. Please read about the Windows user policy to learn more about this topic.
You can furthermore look what happens if you are a simple user by trying out my installer (I just posted above) and run it without admin permissions.
apeltauer wrote: Tue Mar 19, 2019 9:02 pm And copying the runtime Dlls is the worst thing you could do!
Sorry, but please investigate a bit more before shooting around with exclamation marks. Of course one must distribute the DLLs used by the program one compiled with MSVC. This is exactly the same as with the Qt DLLs. It is hereby important to distribute the DLLS of the MSVC and Qt version with which the program was compiled. MSVC and Qt provides really good documentation, so please read it.
And if you want to debug a program, you must compile it with debug symbols. But we are distributing a program to be run normally, no debug builds. For debug builds you would also have to distribute the debug DLLs.
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: [Coordination]Windows freecad installer update to 0.18

Post by apeltauer »

First off all, i want to make my point clear. In my opinion if you want to install anything on your windows, you should have the permission. If you just have an user account, some one does not want you to modify the windows (except your user stuff, of course). Why companies dont let the user install all software, i think there is reason... :)
And this is just my good and bad experience i am talking about.
If you can install anything you want to c:\program files\ with just user privileges, fine, do it. But if it comes to c++ runtimes, please do not just copy anything around. You do not have an overview of all the c++ runtimes your system holds. If you use the installer you can see them in your "Porgrams and Feature" control panel.
Sorry, but please investigate a bit more before shooting around with exclamation marks. Of course one must distribute the DLLs used by the program one compiled with MSVC. This is exactly the same as with the Qt DLLs. It is hereby important to distribute the DLLS of the MSVC and Qt version with which the program was compiled. MSVC and Qt provides really good documentation, so please read it.
This is not my experience with windows software deployment. Qt is deployed by nearly every single program, because their are so many different version out there, even own compiled versions. The problem on windows is, as fare as i know, the dll loading mechanism at runtime. Windows loads a dll with the same name only once. If you just copy your runtime dll to your program and another program installed the runtimes with the installer no one can identify what c++ runtime version is loaded on runtime. I had the problem with own deployed software and bought software. So this is just a hint from my side. And by debuging i did not mean to go through the source code, I meant to check why the program suddenly crashs or dont even start. And all the times it had something with the runtimes...

But again how i started, this is just my opinion and experience with software deployment.
BR Manuel
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [Coordination]Windows freecad installer update to 0.18

Post by uwestoehr »

apeltauer wrote: Wed Mar 20, 2019 6:23 am In my opinion if you want to install anything on your windows, you should have the permission. If you just have an user account, some one does not want you to modify the windows (except your user stuff, of course).
I often wonder why even developers have unclear information about the Windows user policy. Of course every user can install programs. It is also defined what "installing" means. There are very good reasons to install programs only for a certain user. Take for example the laptops at my work - everyone can use them. Some need special software to run an oscilloscope, some use it to control motors in our laboratory, some use it to change program code at the site of our customers etc. And when I use the PC why should I be confronted with oscilloscope software?
So the admin install only software that should be available for all users of the PC. All other programs should only be installed locally for the user.
And this is why Windows offers the feature to install "roaming", "local" or "LocalLow". That is why there are different sections in the Win registry with different access permissions.
For further info I refer to the Windows documentation.
To summarize: it is up to the user if he wants to have a program installed for all users of the PC or only for the current user. The current user can also be the admin.

Concerning your DLL arguing, again, we are providing here release builds for users. No debugging builds. The release builds must just work by double-clicking on the FreeCAD.exe .

apeltauer wrote: Wed Mar 20, 2019 6:23 am If you just copy your runtime dll to your program and another program installed the runtimes with the installer no one can identify what c++ runtime version is loaded on runtime.
That is not true. The local folder has priority over the global DLLs. This assures that e.g. a user can have Qt 5.12 installed and this doesn't interfere with a program he starts that was compiled using Qt 5.6. The same is with Python, MSVC... Therefore FreeCAD installs already its own Python, its own Qt and MSVC is no exception.
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: [Coordination]Windows freecad installer update to 0.18

Post by apeltauer »

Sorry when I interrupted the discussion...
I often wonder why even developers have unclear information about the Windows user policy. Of course every user can install programs. It is also defined what "installing" means. There are very good reasons to install programs only for a certain user. Take for example the laptops at my work - everyone can use them. Some need special software to run an oscilloscope, some use it to control motors in our laboratory, some use it to change program code at the site of our customers etc. And when I use the PC why should I be confronted with oscilloscope software?
So the admin install only software that should be available for all users of the PC. All other programs should only be installed locally for the user.
And this is why Windows offers the feature to install "roaming", "local" or "LocalLow". That is why there are different sections in the Win registry with different access permissions.
For further info I refer to the Windows documentation.
To summarize: it is up to the user if he wants to have a program installed for all users of the PC or only for the current user. The current user can also be the admin.
But I can not go with your statement that every one should do what he wants to do. With this statement no it department and no people are needed to run a company and protect it. And again, if you dont have permissions to install anything on your work pc, it still think there is a reason!

Btw: A qoute froms totdays Microsoft Security Road Show I just has participant. What are the biggest security issues a company is facing today.
1. The people itself
2. The "Shadow IT", because every body wants to be smarter then the IT guys and developer...
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [Coordination]Windows freecad installer update to 0.18

Post by uwestoehr »

apeltauer wrote: Wed Mar 20, 2019 1:58 pm But I can not go with your statement that every one should do what he wants to do.
I did not say that. Every user has certain permissions. So it is well defined what he is allowed to do and what not.
So why should we forbid standard Windows user to use FreeCAD despite he can do this? Despite my installer still has some bugs (I will provide a fixed version later today, just give it a try as non-admin user and report back if you can use FreeCAD with all its functions or not.
apeltauer wrote: Wed Mar 20, 2019 1:58 pm And again, if you dont have permissions to install anything on your work pc, it still think there is a reason!
Please understand - every user can install things - nobody has "no rights to install anything". This is technically impossible and would make a PC useless.
I have no clue what you think "installing" means. Setting in the registry to open a certain file type with a certain application is for example an installing action. Some installers don't do more than this and this is something than can of course be done by every user.

I will have to end this discussion now. Please read about the Windows user policy before opening this discussion again.
Post Reply