You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: technical/ReleasePackages.md
+69-33Lines changed: 69 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,43 +4,79 @@ layout: default
4
4
5
5
# Building release packages
6
6
7
-
This page describes how to build FreeCAD installer packages for the different supported platforms.
7
+
This page describes how to build FreeCAD packages for the different supported platforms.
8
8
9
-
## Windows
10
-
11
-
### Installer
9
+
## Windows Installer
12
10
13
11
The main entry point to build a Windows installer is within the FreeCAD sources, at https://github.com/FreeCAD/FreeCAD/tree/master/src/WindowsInstaller . To build the installer:
14
12
15
-
1. Open the file *Settings.nsh* with a text editor and adapt there the following paths to the ones on your machine, e.g.: `!define FILES_FREECAD "C:\FreeCAD\Installer\FreeCAD"` and `!define FILES_DEPS "C:\FreeCAD\Installer\MSVCRedist"`
16
-
2. If you want to build a 32bit installer, comment out `!define MULTIUSER_USE_PROGRAMFILES64` in *Settings.nsh*
17
-
3. Install the latest version 3.x of NSIS from [NSID Download page](https://nsis.sourceforge.io/Download)
18
-
4. Download a special release files of NSIS that support large strings from [NSIS Special Builds](https://nsis.sourceforge.io/Special_Builds#Large_strings) and copy the containing files into the corresponding NSIS installation folder
19
-
5. Download a special release files of NSIS that support logging from [NSIS Special Builds](https://nsis.sourceforge.io/Special_Builds#Advanced_logging) and copy the containing files into the corresponding NSIS installation folder
20
-
6. Copy the file *~\nsprocess\Include\nsProcess.nsh* to the *\Include* folder of NSIS's installation folder
21
-
7. Copy the file *~\nsprocess\Plugins\x86-unicode\nsProcess.dll* to the *\Plugins\x86-unicode* folder of NSIS's installation folder. You can alternatively get nsProcess from [NsProcess plugin - NSIS](https://nsis.sourceforge.io/NsProcess_plugin).
22
-
23
-
Now you have 2 options:
24
-
25
-
- Either you got an already compiled FreeCAD, then copy all FreeCAD files to the *~\FreeCAD* folder e.g. *C:\FreeCAD\Installer\FreeCAD*
26
-
- Or you compiled FreeCAD on your own as described [on the FreeCAD wiki](https://wiki.freecad.org/Compile_on_Windows). Then:
27
-
- Open the file *Settings.nsh* as described in step 3. above and set `!define FILES_FREECAD` to the folder you specified as `CMAKE_INSTALL_PREFIX`
28
-
- Copy into that folder the file *Delete.bat* that is part of the installer
29
-
- Change to that folder and search it for ***_debug.***
30
-
- Delete all found files
31
-
- Repeat this for the searches with ***_d.***, ***.pyc** and ***.pdb**
32
-
- Open a command line in Windows and navigate to the FreeCAD folder
33
-
- run the comamand `Delete.bat`
34
-
35
-
The above steps assure that the installer only contains files users need. Moreover it assures that the overall files size is below 2 GB and we can use the most compact compression for the installer.
36
-
37
-
8. If you use a version of FreeCAD that was compiled using another MSVC version than MSVC 2019, copy its distributable DLLs to the folder FILES_DEPS (see step 1 above).
38
-
9. Right-click on the file *FreeCAD-installer.nsi* and choose **Compile NSIS script** to compile the installer.
39
-
10. The folder *~\MSVCRedist* contains already all MSVC 2019 x64 redistributable DLLs necessary for FreeCAD. If another MSVC version was used to compile FreeCAD, replace the DLLs by the ones of the used MSVC. (They are usually available in the folder *C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC*)
40
-
41
-
For test builds of the installer you can turn off the compression. This speeds up the build time for the installer a lot but increases its file size. The compression is turned off by uncommenting the line `SetCompressor /SOLID lzma` in the file *Settings.nsh*.
42
-
43
-
### Conda
13
+
### Creating a Windows installer for FreeCAD
14
+
15
+
These are instructions for building an NSIS-based installer for FreeCAD. They were designed for FreeCAD 0.21 and later,
16
+
and presume that you have cloned a copy of FreeCAD's source code, and therefore have the directory *src/WindowsInstaller*.
17
+
18
+
#### Install NSIS
19
+
To set up your system for building an NSIS installer:
20
+
1. Install the latest version 3.x of NSIS (https://nsis.sourceforge.io/Download)
21
+
2. Download these special release files of NSIS that support large strings:</br>
and copy the contained files into the corresponding NSIS installation folders
27
+
4. Download and install the nsProcess plugin from https://nsis.sourceforge.io/NsProcess_plugin -- you will need the version that supports Unicode, so make sure to follow the appropriate instructions on their site to install that one (as of this writing it involves manually copying and renaming the plugin DLL file).
28
+
29
+
#### Build the installer
30
+
Next, update the installer settings for the current version of FreeCAD. Starting from the *src/WindowsInstaller* folder in the FreeCAD source tree:
31
+
1. Set the appropriate version strings for the release you are creating. These are used to construct the filename of the installer, among other things. If you have to upload a new version of the installer for the exact same release of FreeCAD, increment `APP_VERSION BUILD` as needed.
32
+
```
33
+
!define APP_VERSION_MAJOR 0
34
+
!define APP_VERSION_MINOR 21
35
+
!define APP_VERSION_REVISION 0
36
+
!define APP_VERSION_EMERGENCY "RC1"
37
+
!define APP_VERSION_BUILD 1
38
+
```
39
+
2. Within the folder *src/WindowsInstaller*, create a new folder called MSVCRedist and copy the following files from your MSVC installation into it:
40
+
```
41
+
vcruntime140.dll
42
+
concrt140.dll
43
+
msvcp140.dll
44
+
vcamp140.dll
45
+
vccorlib140.dll
46
+
vcomp140.dll
47
+
```
48
+
3. Open the file *Settings.nsh* with a text editor (both jEdit and Visual Studio Code are good editors for NSIS files). Edit the following paths to correspond to your system: `FILES_FREECAD` corresponds to your installation directory (e.g. `CMAKE_INSTALL_PREFIX` if you self-compiled) and `FILES_DEPS` is the folder you created with the MSVC redistributable files in it.
4. Ensure the FreeCAD files are in place. Here you have two options:
54
+
* If you are working from an already-compiled version of FreeCAD provided to you by an outside source: in this case, simply ensure that `FILES_FREECAD` is set to the directory containing those files.
55
+
* If you compiled FreeCAD on your own as described [here](https://wiki.freecad.org/Compile_on_Windows) (and using the Install option outlined there). Then:
56
+
* Open the file *Settings.nsh* as described in step 3. above and set there</br>
57
+
`!define FILES_FREECAD` to the folder you specified as `CMAKE_INSTALL_PREFIX`
58
+
* Copy into that folder the file *Delete.bat* that is part of the installer
59
+
* open a command line in Windows and change to the folder
60
+
* run the comamand</br>
61
+
`Delete.bat`
62
+
* (These steps assure that the installer only contains files users need. Moreover it assures that the
63
+
overall files size is below 2 GB and we can use the most compact compression for the installer.)
64
+
5. Right-click on the file *FreeCAD-installer.nsi* and choose **Compile NSIS script**
65
+
to compile the installer.
66
+
67
+
68
+
NOTE: For test builds of the installer you can turn off the LZMA compression and use the much faster default compression. This speeds up
69
+
the build time for the installer but significantly increases the final installer file size. The LZMA compression is turned off by commenting
70
+
out the line
71
+
```
72
+
!SetCompressor lzma
73
+
```
74
+
in the file *Settings.nsh*.
75
+
76
+
77
+
## Conda builds for Linux, Mac, and Windows
78
+
79
+
The same system that builds the "Development Weekly" builds is used to build the release versions of the Linux AppImages, Mac app bundles, and a standalone Windows executable (e.g. a non-installer version).
0 commit comments