From b9a12e672c8b60302a6f9c72f7164459c706407c Mon Sep 17 00:00:00 2001 From: Uwe Date: Sun, 13 Feb 2022 22:05:11 +0100 Subject: [PATCH] [Win installer] add support for logging the installer will now write a text file 'install.log' to the installation folder of FreeCAD --- src/WindowsInstaller/README.md | 18 ++++++++++++------ src/WindowsInstaller/setup/install.nsh | 7 ++++++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/WindowsInstaller/README.md b/src/WindowsInstaller/README.md index 777ce80e43..4972812d28 100644 --- a/src/WindowsInstaller/README.md +++ b/src/WindowsInstaller/README.md @@ -13,18 +13,24 @@ To build the installer you can do the following: 4. Specify in Settings.nsh if it should be an installer for 32bit by commenting the line
!define MULTIUSER_USE_PROGRAMFILES64 5. Install the latest version 3.x of NSIS (https://nsis.sourceforge.io/Download) -6. Copy the file ~\nsprocess\Include\nsProcess.nsh to the folder
+6. Download these special release files of NSIS that support large strings:
+ https://nsis.sourceforge.io/Special_Builds#Large_strings
+ and copy the containing files into the corresponding NSIS installations folders +7. Download these special release files of NSIS that support logging:
+ https://nsis.sourceforge.io/Special_Builds#Advanced_logging
+ and copy the containing files into the corresponding NSIS installations folders +8. Copy the file ~\nsprocess\Include\nsProcess.nsh to the folder
\Include of NSIS's installation folder.
Copy the file ~\nsprocess\Plugins\x86-unicode\nsProcess.dll to the folder
- \Plugins\x86-unicode of NSIS's installation folder. + \Plugins\x86-unicode of NSIS's installation folder.
(You can alternatively get nsProcess from https://nsis.sourceforge.io/NsProcess_plugin) -7. Copy all FreeCAD files to the folder "~\FreeCAD" +9. Copy all FreeCAD files to the folder "~\FreeCAD" e.g. "C:\FreeCAD\Installer\FreeCAD" -8. If you use a version of FreeCAD that was compiled using another MSVC version than MSVC 2019, +10. 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 3). -9. Right-click on the file FreeCAD-installer.nsi and choose "Compile NSIS script" +11. Right-click on the file FreeCAD-installer.nsi and choose "Compile NSIS script" to compile the installer. -10. The folder ~\MSVCRedist contains already all MSVC 2019 x64 redistributable DLLs necessary +12. The folder ~\MSVCRedist contains already all MSVC 2019 x64 redistributable DLLs necessary for FreeCAD 0.20dev. 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) diff --git a/src/WindowsInstaller/setup/install.nsh b/src/WindowsInstaller/setup/install.nsh index 4054667ac4..aa173c7083 100644 --- a/src/WindowsInstaller/setup/install.nsh +++ b/src/WindowsInstaller/setup/install.nsh @@ -20,8 +20,13 @@ Section -ProgramFiles SecProgramFiles ${if} $Pointer == "-1" StrCpy $INSTDIR "$INSTDIR\${APP_DIR}" ${endif} + + # turn on logging + # Note that this can first be done here since the log file is written to $INSTDIR + # to $INSTDIR must have a valid path before logging can be turned on + LogSet on - # Install and register the core FreeCAD files + # Install and register the core FreeCAD files # Initializes the plug-ins dir ($PLUGINSDIR) if not already initialized. # $PLUGINSDIR is automatically deleted when the installer exits.