octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GSoC project about binary packaging


From: Patrick Noffke
Subject: Re: GSoC project about binary packaging
Date: Tue, 2 Jul 2013 14:06:24 -0500

On Sun, Jun 23, 2013 at 3:11 PM, Michael Goffioul
<address@hidden> wrote:
> 1) MinGW build with installer
>

Sorry to come into this discussion late.  Am I correct that the
Windows installer file can only be created on a Windows machine (i.e.
you have to run NSIS on Windows)?  I see nsis is cross-compiled, but
I'm not sure what good that does if you want to make a full installer
from Linux.

Anyway, I just wanted to throw this out there.  It is possible to
build a Windows Installer (.msi) file from Linux.  I've done this
using the msi-tools[1] package on Fedora 18.  If you want, you can
also use WiX natively on Windows.  Both are similar, though the Linux
version implements a subset of the WiX features.  Either way involves
writing a .wxs file[2] to describe your installer, then run wixl (or
equivalent (candle.exe and light.exe) on Windows) to build the .msi
file.

You can create fancy UI screens for user-selectable options if you
want.  I've done this before (on Windows -- I'd have to test again
with msi-tools), and could help if this is useful.  I'd have to dig up
some of my past .wxs files, but you can also check out the WiX
tutorial here:  http://wix.tramontana.co.hu/tutorial

For easy importing of a whole bunch of DLLs, you can use the wixl-heat
(I think just heat.exe on Windows) to generate fragment files.  Then
you just include the fragment files as input files along with your
main .wxs file when running wixl.  Here is a snippet from a makefile
that runs on Linux, which imports all the necessary cross-compiled
DLLs from the mingw64-distribution (includes Qt5 and some others), and
builds the final .msi file.

        ls $(MINGW_SYSROOT)/mingw/bin/Qt5*.dll | \
          wixl-heat --component-group Qt5DLLs -p $(MINGW_SYSROOT)/mingw/bin/ > \
          $(PRODUCT_BUILD_DIR)/Qt5DLLs.wxs.in
        cat $(PRODUCT_BUILD_DIR)/Qt5DLLs.wxs.in | \
          sed s,"TARGETDIR","INSTALLDIR", | \
          sed s,"SourceDir","$(MINGW_SYSROOT)/mingw/bin", \
            > $(PRODUCT_BUILD_DIR)/Qt5DLLs.wxs
        find $(MINGW_SYSROOT)/mingw/lib/qt5/plugins -name \*.dll | \
          wixl-heat --component-group Qt5Plugins -p
$(MINGW_SYSROOT)/mingw/lib/qt5/plugins/ > \
          $(PRODUCT_BUILD_DIR)/Qt5Plugins.wxs.in
        cat $(PRODUCT_BUILD_DIR)/Qt5Plugins.wxs.in | \
          sed s,"TARGETDIR","INSTALLDIR", | \
          sed s,"SourceDir","$(MINGW_SYSROOT)/mingw/lib/qt5/plugins", \
            > $(PRODUCT_BUILD_DIR)/Qt5Plugins.wxs
        ls $(MINGW_SYSROOT)/mingw/bin/lib*.dll \
           $(MINGW_SYSROOT)/mingw/bin/zlib1.dll \
           $(MINGW_SYSROOT)/mingw/bin/qwt*.dll \
           $(MINGW_SYSROOT)/mingw/bin/iconv.dll \
           $(MINGW_SYSROOT)/mingw/bin/pthread*.dll \
          | \
          wixl-heat --component-group MinGWOtherLibs -p
$(MINGW_SYSROOT)/mingw/bin/ > \
          $(PRODUCT_BUILD_DIR)/MinGWOtherLibs.wxs.in
        cat $(PRODUCT_BUILD_DIR)/MinGWOtherLibs.wxs.in | \
          sed s,"TARGETDIR","INSTALLDIR", | \
          sed s,"SourceDir","$(MINGW_SYSROOT)/mingw/bin", \
            > $(PRODUCT_BUILD_DIR)/MinGWOtherLibs.wxs
        wixl \
           $(PRODUCT_BUILD_DIR)/Qt5DLLs.wxs \
           $(PRODUCT_BUILD_DIR)/Qt5Plugins.wxs \
           $(PRODUCT_BUILD_DIR)/MinGWOtherLibs.wxs \
           $(PRODUCT_BUILD_DIR)/UpdateUtility/UpdateUtility.wxs \
          -o $(PRODUCT_BUILD_DIR)/UpdateUtility/UpdateUtility.msi

The name of my application is "UpdateUtility."  MINGW_SYSROOT was set using:

MINGW_SYSROOT=$(shell x86_64-w64-mingw32-gcc -print-sysroot)

This should obviously change to correspond to the cross-compiler being used.

[1] https://wiki.gnome.org/msitools
[2] http://wix.sourceforge.net/manual-wix2/wxs.htm

Patrick


reply via email to

[Prev in Thread] Current Thread [Next in Thread]