Windows Installer: Difference between revisions

Add categories, ensure MS Windows.
m (→‎Testing using virtual machines: Add more path templates.)
(Add categories, ensure MS Windows.)
Line 1: Line 1:
:''This article is about how to make the Windows installer; if you'd like just to use the installer, see [[Octave for Microsoft Windows]].''
:''This article is about how to make the Microsoft Windows installer; if you'd like just to use the installer, see [[Octave for Microsoft Windows]].''
GNU Octave is primarily developed on GNU/Linux and other POSIX compliant systems. There have been many efforts in the past to build ports of GNU Octave for Microsoft Windows.
GNU Octave is primarily developed on GNU/Linux and other POSIX compliant systems. There have been many efforts in the past to build ports of GNU Octave for Microsoft Windows.
This page contains instructions about creating a Windows installer using [[MXE|mxe-octave]] (a fork of [http://mxe.cc/ MXE]).
This page contains instructions about creating a MS Windows installer using [[MXE|mxe-octave]] (a fork of [http://mxe.cc/ MXE]).
This means, '''the Microsoft Windows installer is [https://en.wikipedia.org/wiki/Cross_compiler cross-compiled] using a GNU/Linux system'''.
This means, '''the MS Windows installer is [https://en.wikipedia.org/wiki/Cross_compiler cross-compiled] using a GNU/Linux system'''.


==Steps to create Windows Installer==
==Creating the MS Windows Installer==


===General steps===
===General steps===
Line 19: Line 19:
====<code>./configure</code>====
====<code>./configure</code>====


The current Windows installers are build in three "flavors": for common 64- and 32-bit systems ('''"w64"''' and '''"w32"''') and for 64-bit systems exceeding 32 GB of main memory to store large data structures ('''"w64-64"''').
The current Microsoft Windows installers are build in three "flavors": for common 64- and 32-bit systems ('''"w64"''' and '''"w32"''') and for 64-bit systems exceeding 32 GB of main memory to store large data structures ('''"w64-64"''').


{| class="wikitable"
{| class="wikitable"
Line 58: Line 58:


* <code>--enable-devel-tools</code>: Include gdb and an MSYS shell in the binary.
* <code>--enable-devel-tools</code>: Include gdb and an MSYS shell in the binary.
** If you seriously want to work with gdb, you need <code>--disable-strip-dist-files</code> as configure option to keep debug symbols in the installed binaries for debugging on Windows. Beware as the total Octave distribution will be > 2 GB, the max. size for an NSIS installer. Your only options are to make 7z-dist, zip-dist or tar-dist installers.
** If you seriously want to work with gdb, you need <code>--disable-strip-dist-files</code> as configure option to keep debug symbols in the installed binaries for debugging on MS Windows. Beware as the total Octave distribution will be > 2 GB, the max. size for an NSIS installer. Your only options are to make 7z-dist, zip-dist or tar-dist installers.
* <code>--enable-binary-packages</code>: Cross-compile binary modules in [[Octave Forge]] packages. This saves time when installing them once the installation runs on Microsoft Windows.
* <code>--enable-binary-packages</code>: Cross-compile binary modules in [[Octave Forge]] packages. This saves time when installing them once the installation runs on Microsoft Windows.
* <code>--with-ccache</code>: The usage of [https://ccache.dev/ ccache] may speed up repetitive compilation drastically.
* <code>--with-ccache</code>: The usage of [https://ccache.dev/ ccache] may speed up repetitive compilation drastically.
Line 70: Line 70:
====<code>make</code>====
====<code>make</code>====


* Use <code>make all 7z-dist</code>, <code>make all tar-dist</code> or <code>make all zip-dist</code> instead of <code>make all nsis-installer</code> if you want to build just an archive of the files to install on Windows instead of an installer wizard.
* Use <code>make all 7z-dist</code>, <code>make all tar-dist</code> or <code>make all zip-dist</code> instead of <code>make all nsis-installer</code> if you want to build just an archive of the files to install on MS Windows instead of an installer wizard.
* By default, packages will be built one at a time, but you may use <code>make JOBS=4</code> (choose a number other than 4 that is appropriate for your system) to build each package in parallel.  You may also combine this with the <code>-j</code> option for Make to build more than one package at a time, but be careful as using <code>make -j4 JOBS=4</code> can result in as many as 16 jobs running at once.
* By default, packages will be built one at a time, but you may use <code>make JOBS=4</code> (choose a number other than 4 that is appropriate for your system) to build each package in parallel.  You may also combine this with the <code>-j</code> option for Make to build more than one package at a time, but be careful as using <code>make -j4 JOBS=4</code> can result in as many as 16 jobs running at once.
* Include gdb in the installer by running <code>make gdb</code> before making the <code>nsis-installer</code> target.
* Include gdb in the installer by running <code>make gdb</code> before making the <code>nsis-installer</code> target.
Line 101: Line 101:
* It can happen that you meet problems with Java. To build Octave with Java support built-in, mxe-octave needs:
* It can happen that you meet problems with Java. To build Octave with Java support built-in, mxe-octave needs:
** A Java JDK (Java Development Kit) on the '''host''' system. In other words, the javac (Java compiler) and jar (Java archiver) executables should be in the PATH-system-variable.
** A Java JDK (Java Development Kit) on the '''host''' system. In other words, the javac (Java compiler) and jar (Java archiver) executables should be in the PATH-system-variable.
** Java include files for windows ("w32", even for "w64" builds). They should reside in {{Path|<mxe-octave build dir>/usr/x86_64-w64-mingw32/include/java/win32}}. If they are not present, mxe-octave downloads them automatically, but this can occasionally go wrong. On a multi-boot system a solution (note: dirty hack warning!) is symlinking to the Windows include files on the Windows partition from the mxe-octave location.
** Java include files for MS Windows ("w32", even for "w64" builds). They should reside in {{Path|<mxe-octave build dir>/usr/x86_64-w64-mingw32/include/java/win32}}. If they are not present, mxe-octave downloads them automatically, but this can occasionally go wrong. On a multi-boot system a solution (note: dirty hack warning!) is symlinking to the MS Windows include files on the MS Windows partition from the mxe-octave location.


===Troubleshooting===
===Troubleshooting===
Line 116: Line 116:
Microsoft provides several virtual machine (e.g. VirtualBox) disk images of MS Windows for 90 days of testing https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/. While primarily meant for testing the MS-Edge browser, the license (given on that page) for these images does not limit the use of these images to just MS-Edge. So it is perfectly possible to also test GNU Octave.
Microsoft provides several virtual machine (e.g. VirtualBox) disk images of MS Windows for 90 days of testing https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/. While primarily meant for testing the MS-Edge browser, the license (given on that page) for these images does not limit the use of these images to just MS-Edge. So it is perfectly possible to also test GNU Octave.


The key idea is to create a shared folder inside the virtual machine to the mxe-octave build directory. It is advised to make it read-only.  Either install (or unpack) Octave into Windows 10, or create a shortcut to {{Path|octave.vbs}} in the {{Path|<mxe-octave build dir>/dist/octave}} subdirectory on the Linux side.
The key idea is to create a shared folder inside the virtual machine to the mxe-octave build directory. It is advised to make it read-only.  Either install (or unpack) Octave into MS Windows 10, or create a shortcut to {{Path|octave.vbs}} in the {{Path|<mxe-octave build dir>/dist/octave}} subdirectory on the Linux side.


Some advantages:
Some advantages:
* No dedicated MS Windows machine or rebooting from Linux is needed;
* No dedicated MS Windows machine or rebooting from Linux is needed;
* The <strike>latest</strike> Windows 10 version is always available;
* The <strike>latest</strike> MS Windows 10 version is always available;
* Building the installer archives (zip, 7z, ...) isn't needed. One can interrupt the build process after the local installation of Octave has been made in the dist/octave subdirectory of mxe-octave, i.e., when the message "generating installer" (or "zip...") is shown. This saves about 10-15 minutes. Of course one can also use the common distribution formats for the virtual MS Windows machine.
* Building the installer archives (zip, 7z, ...) isn't needed. One can interrupt the build process after the local installation of Octave has been made in the dist/octave subdirectory of mxe-octave, i.e., when the message "generating installer" (or "zip...") is shown. This saves about 10-15 minutes. Of course one can also use the common distribution formats for the virtual MS Windows machine.


Line 131: Line 131:
<references/>
<references/>


[[Category:Building]]
[[Category:Packaging]]
[[Category:Packaging]]
[[Category:Microsoft Windows]]