From NSIS Wiki

--Anders 17:21, 26 March 2008 (PDT)


TinyCppUnit is a tiny reimplementation of CppUnit and contains just enough functionality to work with NSIS. Its only redeeming feature is that you don't have to link to the CppUnit .lib file (that might not work with your compiler). (5 KB)

Building NSIS



MinGW GCC 4.5.2

The latest w32api headers don't actually work with this GCC version without some patching:

  • Add __AW and __STR macros to _mingw.h
    #define __AW__(AW, AW_) AW ## AW_
    #if ( \
     (!defined(__TEST_SQL_NOUNICODEMAP) && defined(UNICODE)) || \
     (!defined(__TEST_SQL_NOUNICODEMAP) && defined(_UNICODE)) || \
     defined(FORCE_UNICODE) || \
     (defined(__TEST_SQL_NOUNICODEMAP) && !defined(SQL_NOUNICODEMAP) && \
       (defined(UNICODE) || defined(_UNICODE))) \
    # define __AW(AW) __AW__(AW, W)
    # define __STR(AW) __AW__(L, AW)
    # define __AW(AW) __AW__(AW, A)
    # define __STR(AW) __AW__(, AW)
  • Fix unknwn.h by adding #include <windows.h> to the top of the file or use this patch:
    Index: Source/7zip/Common/MyUnknown.h
    --- Source/7zip/Common/MyUnknown.h	(revision 6530)
    +++ Source/7zip/Common/MyUnknown.h	(working copy)
    @@ -30,6 +30,14 @@
     #include <basetyps.h>
    +#ifdef __MINGW32__
    + * MinGW/w32api BUGFIX
    + * w32api-4.0.3-1-mingw32-dev will error on LPUNKNOWN usage in commdlg.h if windows.h is not included before unknwn.h
    + */
    +#include <windows.h>
     #include <unknwn.h>
  • Add #ifndef NSISCALL & #endif around SHGetImageList() in shellapi.h

We are now ready to build:

mingw-get install "g++<4.6"
set path=%path%;c:\MinGW\bin
cd SVN-r6530\NSIS\trunk
scons ZLIB_W32=dep\zlib-win32 PREFIX=c:\NSIS SKIPUTILS="NSIS Menu" SKIPTESTS=Examples\makensis.nsi install
Personal tools