From e38fdcea8672f41b20a7d0775c125bbb930b5a26 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Tue, 1 Aug 2006 07:26:55 +0000 Subject: [PATCH] Initial commit of the new Windows installer. Updated README.mingw32. Add Windows version of mt to build-dependencies. More work to support native MinGW using MSYS. Fix build of bconsole so it builds as a console application. Fix /kill option on Director. Export new function db_int64_handler. Fix some more 64bit problems in NSIS. Fix a memory allocation problem in wxWidgets. Rename Makefile.inc.cross to Makefile.inc.in. Move ClientConfig.ini, Start.bat, Stop.bat and winbacula.nsi.in (renamed to winbacula.nsi) to the new installer directory. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3216 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/Makefile | 21 +- bacula/src/win32/Makefile.inc.cross | 72 -- bacula/src/win32/Makefile.inc.in | 74 ++ bacula/src/win32/Makefile.inc.native | 75 -- bacula/src/win32/Makefile.rules | 2 - bacula/src/win32/README.mingw32 | 24 +- bacula/src/win32/bacula.nsi | 160 ----- bacula/src/win32/build-dependencies | 25 +- bacula/src/win32/console/Makefile | 2 +- bacula/src/win32/console/filelist | 38 - bacula/src/win32/console/genmake.sh | 16 - bacula/src/win32/dird/winservice.cpp | 2 +- bacula/src/win32/dll/bacula.def | 1 + .../win32/{ => installer}/ClientConfig.ini | 0 bacula/src/win32/installer/Makefile | 99 +++ bacula/src/win32/{ => installer}/Start.bat | 0 bacula/src/win32/{ => installer}/Stop.bat | 0 .../winbacula.nsi} | 89 ++- bacula/src/win32/patches/nsis.patch | 657 +++++++++++------- bacula/src/win32/patches/wx.patch | 22 + bacula/src/win32/wx-console/filelist | 60 -- bacula/src/win32/wx-console/genmake.sh | 16 - 22 files changed, 687 insertions(+), 768 deletions(-) delete mode 100644 bacula/src/win32/Makefile.inc.cross create mode 100644 bacula/src/win32/Makefile.inc.in delete mode 100644 bacula/src/win32/Makefile.inc.native delete mode 100644 bacula/src/win32/bacula.nsi delete mode 100644 bacula/src/win32/console/filelist delete mode 100644 bacula/src/win32/console/genmake.sh rename bacula/src/win32/{ => installer}/ClientConfig.ini (100%) create mode 100644 bacula/src/win32/installer/Makefile rename bacula/src/win32/{ => installer}/Start.bat (100%) rename bacula/src/win32/{ => installer}/Stop.bat (100%) rename bacula/src/win32/{winbacula.nsi.in => installer/winbacula.nsi} (93%) mode change 100755 => 100644 delete mode 100644 bacula/src/win32/wx-console/filelist delete mode 100644 bacula/src/win32/wx-console/genmake.sh diff --git a/bacula/src/win32/Makefile b/bacula/src/win32/Makefile index f4a29a9ddb..235c6b1a83 100644 --- a/bacula/src/win32/Makefile +++ b/bacula/src/win32/Makefile @@ -6,7 +6,8 @@ DIRS= dll \ stored \ console \ wx-console \ - tools + tools \ + installer .PHONY: $(DIRS) clean all @@ -22,6 +23,20 @@ $(DIRS): echo -e "\n!!!!! Make of $@ failed !!!!!\n\n" ; \ fi -Makefile.inc: Makefile.inc.cross +Makefile.inc: Makefile.inc.in @echo Creating $@ - $(ECHO_CMD)sed -e "s^@TOPDIR@^`(cd ../../..;pwd)`^" < Makefile.inc.cross > $@ + $(ECHO_CMD)TOPDIR=`(cd ../../..;pwd)`; \ + if test -e ../../../cross-tools/mingw32/bin/mingw32-gcc; then \ + BINDIR=$${TOPDIR}/cross-tools/mingw32/bin; \ + INCDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/include; \ + elif test -e /mingw/bin/mingw32-gcc; then \ + BINDIR=/mingw/bin; \ + INCDIR=/mingw/include; \ + else \ + echo -e "\nThe GCC cross compiler isn't installed."; \ + echo -e "You must run build-win32-cross-tools and build-dependencies first.\n"; \ + exit 1; \ + fi ; \ + sed -e "s^@TOPDIR@^$${TOPDIR}^" \ + -e "s^@BINDIR@^$${BINDIR}^" \ + -e "s^@INCDIR@^$${INCDIR}^" < Makefile.inc.in > $@ diff --git a/bacula/src/win32/Makefile.inc.cross b/bacula/src/win32/Makefile.inc.cross deleted file mode 100644 index 31a509ed18..0000000000 --- a/bacula/src/win32/Makefile.inc.cross +++ /dev/null @@ -1,72 +0,0 @@ -# -# Makefile for win32 bacula executables -# Using MinGW cross-compiler on GNU/Linux -# -# Written by Robert Nelson, June 2006 -# - -# Global Configuration - -ECHO_CMD = @ - -TOPDIR = @TOPDIR@ -DEPKGS = $(TOPDIR)/depkgs-mingw32 - -MINGW_BIN = $(TOPDIR)/cross-tools/mingw32/bin -MINGW_INCLUDE = $(TOPDIR)/cross-tools/mingw32/mingw32/include - -CC = $(MINGW_BIN)/mingw32-g++ $(DEFINES) $(INCLUDES) -CXX = $(MINGW_BIN)/mingw32-g++ $(DEFINES) $(INCLUDES) -AR = $(MINGW_BIN)/mingw32-ar -RANLIB = $(MINGW_BIN)/mingw32-ranlib -WINDRES = $(MINGW_BIN)/mingw32-windres -OBJCPY = $(MINGW_BIN)/mingw32-objcopy - -CFLAGS = -Wall -mno-cygwin -m32 -mwin32 -mthreads -O3 -fno-strict-aliasing -LDFLAGS = -Wall -mno-cygwin -Wl,--disable-auto-import - -INCLUDE_DDK = -I$(MINGW_INCLUDE)/ddk -INCLUDE_BACULA = -I../.. -I../compat -INCLUDE_PTHREADS = -I$(DEPKGS)/include/pthreads -INCLUDE_ZLIB = -I$(DEPKGS)/include -INCLUDE_VSS = -I$(DEPKGS)/vss -INCLUDE_ICONS = -I../libwin32 -INCLUDE_OPENSSL = -I$(DEPKGS)/include -INCLUDE_WX = -I$(DEPKGS)/lib/wx_dll/msw -I$(DEPKGS)/include -INCLUDE_MYSQL = -I$(DEPKGS)/include/mysql - -LIBS_PTHREADS = \ - $(DEPKGS)/lib/libpthreadGCE.a - -LIBS_ZLIB = \ - $(DEPKGS)/lib/libz.a - -LIBS_SQL = \ - $(DEPKGS)/lib/libmysql.a - -LIBS_SSL = \ - $(DEPKGS)/lib/libssl.dll.a - -LIBS_CRYPTO = \ - $(DEPKGS)/lib/libcrypto.dll.a - -LIBS_WX = \ - $(DEPKGS)/lib/wx_dll/libwxmsw26_core.a \ - $(DEPKGS)/lib/wx_dll/libwxbase26.a - -LIBS_BACULA = \ - $(LIBDIR)/libbacula.a - -HAVES = \ - -DHAVE_WIN32 \ - -DHAVE_MINGW \ - -DHAVE_ZLIB_H \ - -DHAVE_LIBZ \ - -DHAVE_MYSQL \ - -DHAVE_CRYPTO \ - -DHAVE_OPENSSL \ - -DHAVE_TLS - -BINDIR = ../release -LIBDIR = ../release -OBJDIR = . diff --git a/bacula/src/win32/Makefile.inc.in b/bacula/src/win32/Makefile.inc.in new file mode 100644 index 0000000000..a3b33e597a --- /dev/null +++ b/bacula/src/win32/Makefile.inc.in @@ -0,0 +1,74 @@ +# +# Makefile for win32 bacula executables +# Using MinGW cross-compiler on GNU/Linux +# +# Written by Robert Nelson, June 2006 +# + +# Global Configuration + +ECHO_CMD = @ + +TOPDIR := @TOPDIR@ +DEPKGS := $(TOPDIR)/depkgs-mingw32 + +DOCDIR := $(TOPDIR)/docs +BINDIR := ../release +LIBDIR := ../release +OBJDIR := . + +MINGW_BIN := @BINDIR@ +MINGW_INCLUDE := @INCDIR@ + +CC = $(MINGW_BIN)/mingw32-g++ $(DEFINES) $(INCLUDES) +CXX = $(MINGW_BIN)/mingw32-g++ $(DEFINES) $(INCLUDES) +AR := $(MINGW_BIN)/mingw32-ar +RANLIB := $(MINGW_BIN)/mingw32-ranlib +WINDRES := $(MINGW_BIN)/mingw32-windres +OBJCPY := $(MINGW_BIN)/mingw32-objcopy +NSIS_DIR := $(DEPKGS)/nsis + +CFLAGS := -Wall -mno-cygwin -m32 -mwin32 -mthreads -O3 -fno-strict-aliasing +LDFLAGS := -Wall -mno-cygwin -Wl,--disable-auto-import + +INCLUDE_DDK := -I$(MINGW_INCLUDE)/ddk +INCLUDE_BACULA := -I../.. -I../compat +INCLUDE_PTHREADS := -I$(DEPKGS)/include/pthreads +INCLUDE_ZLIB := -I$(DEPKGS)/include +INCLUDE_VSS := -I$(DEPKGS)/vss +INCLUDE_ICONS := -I../libwin32 +INCLUDE_OPENSSL := -I$(DEPKGS)/include +INCLUDE_WX := -I$(DEPKGS)/lib/wx_dll/msw -I$(DEPKGS)/include +INCLUDE_MYSQL := -I$(DEPKGS)/include/mysql + +LIBS_PTHREADS := \ + $(DEPKGS)/lib/libpthreadGCE.a + +LIBS_ZLIB := \ + $(DEPKGS)/lib/libz.a + +LIBS_SQL := \ + $(DEPKGS)/lib/libmysql.a + +LIBS_SSL := \ + $(DEPKGS)/lib/libssl.dll.a + +LIBS_CRYPTO := \ + $(DEPKGS)/lib/libcrypto.dll.a + +LIBS_WX := \ + $(DEPKGS)/lib/wx_dll/libwxmsw26_core.a \ + $(DEPKGS)/lib/wx_dll/libwxbase26.a + +LIBS_BACULA := \ + $(LIBDIR)/libbacula.a + +HAVES := \ + -DHAVE_WIN32 \ + -DHAVE_MINGW \ + -DHAVE_ZLIB_H \ + -DHAVE_LIBZ \ + -DHAVE_MYSQL \ + -DHAVE_CRYPTO \ + -DHAVE_OPENSSL \ + -DHAVE_TLS diff --git a/bacula/src/win32/Makefile.inc.native b/bacula/src/win32/Makefile.inc.native deleted file mode 100644 index 5ddc40ce93..0000000000 --- a/bacula/src/win32/Makefile.inc.native +++ /dev/null @@ -1,75 +0,0 @@ -# -# Makefile for win32 bacula executables -# Using MinGW cross-compiler on GNU/Linux -# -# Written by Robert Nelson, June 2006 -# - -# Global Configuration - -ECHO_CMD = @ - -TOPDIR = /c/src/bacula-1.38.9 -DEPKGS = $(TOPDIR)/depkgs-mingw - -MINGW_BIN = /mingw/bin -MINGW_INCLUDE = /mingw/include - -CC = $(MINGW_BIN)/g++ $(DEFINES) $(INCLUDES) -CXX = $(MINGW_BIN)/g++ $(DEFINES) $(INCLUDES) -AR = $(MINGW_BIN)/ar -RANLIB = $(MINGW_BIN)/ranlib -WINDRES = $(MINGW_BIN)/windres -OBJCPY = $(MINGW_BIN)/objcopy - -#CFLAGS = -ffunction-sections -fdata-sections -O3 -fno-strict-aliasing -#LDFLAGS = -Wl,--gc-sections -Wl,--disable-auto-import - -CFLAGS = -Wall -mno-cygwin -m32 -mwin32 -mthreads -O3 -fno-strict-aliasing -LDFLAGS = -Wall -mno-cygwin -Wl,--disable-auto-import - -INCLUDE_DDK = -I$(MINGW_INCLUDE)/ddk -INCLUDE_BACULA = -I../.. -I../compat -INCLUDE_PTHREADS = -I$(DEPKGS)/pthreads -INCLUDE_ZLIB = -I$(DEPKGS)/zlib -INCLUDE_VSS = -I"$(subst C:,/c,$(subst \,/,$(VSSSDK_DIR)))" -INCLUDE_ICONS = -I../libwin32 -INCLUDE_OPENSSL = -I$(DEPKGS)/openssl/outinc -INCLUDE_WX = -I$(DEPKGS)/wx/lib/gcc_lib/msw -I$(DEPKGS)/wx/include -INCLUDE_MYSQL = -I$(DEPKGS)/mysql/include - -LIBS_PTHREADS = \ - $(DEPKGS)/pthreads/libpthreadGCE.a - -LIBS_ZLIB = \ - $(DEPKGS)/zlib/libz.a - -LIBS_SQL = \ - $(DEPKGS)/mysql/lib/opt/libmysql.lib - -LIBS_SSL = \ - $(DEPKGS)/openssl/out/libssl.a - -LIBS_CRYPTO = \ - $(DEPKGS)/openssl/out/libcrypto.a - -LIBS_WX = \ - $(DEPKGS)/wx/lib/gcc_lib/libwxmsw26_core.a \ - $(DEPKGS)/wx/lib/gcc_lib/libwxbase26.a - -LIBS_BACULA = \ - $(LIBDIR)/libbacula.a - -HAVES = \ - -DHAVE_WIN32 \ - -DHAVE_MINGW \ - -DHAVE_ZLIB_H \ - -DHAVE_LIBZ \ - -DHAVE_MYSQL \ - -DHAVE_CRYPTO \ - -DHAVE_OPENSSL \ - -DHAVE_TLS - -BINDIR = ../release -LIBDIR = ../release -OBJDIR = . diff --git a/bacula/src/win32/Makefile.rules b/bacula/src/win32/Makefile.rules index 62ee60c462..82d6c0066c 100644 --- a/bacula/src/win32/Makefile.rules +++ b/bacula/src/win32/Makefile.rules @@ -29,14 +29,12 @@ define link_conapp @echo "Linking $@" $(call checkdir,$@) $(ECHO_CMD)$(CXX) $(CFLAGS) $(LDFLAGS) -mconsole $^ $(1) -o $@ - $(makedbg) endef define link_winapp @echo "Linking $@" $(call checkdir,$@) $(ECHO_CMD)$(CXX) $(CFLAGS) $(LDFLAGS) -mwindows $^ $(1) -o $@ - $(makedbg) endef define makedbg diff --git a/bacula/src/win32/README.mingw32 b/bacula/src/win32/README.mingw32 index 354f37ef1c..99cc86b1ff 100644 --- a/bacula/src/win32/README.mingw32 +++ b/bacula/src/win32/README.mingw32 @@ -55,7 +55,7 @@ If that link doesn't work then go to http://www.microsoft.com and search for Normally the files will be installed in: - c:/Program Files/VSSSDK72 + c:/Program Files/Microsoft/VSSSDK72 You only need to copy everything under the c:/Program Files/VSSSDK72/inc directory into ..../depkgs-mingw32/vss/inc. @@ -110,28 +110,16 @@ in question is for openssl): ./build-dependencies openssl -Structure of the new Win32 build environment (from Robert): +Structure of the new Win32 build environment: -I've redesigned the minw32 build somewhat, much thanks to Kern and Howard -for the initial work. - -For doing a build it is very simple, type make in src/win32 or whichever -subdirectory you are working on. For those maintaining it, its a little -more complicated :-) - -Here is some documentation for the maintainers. - -The basic strategy is each makefile in the various subdirectories includes +The basic strategy is each Makefile in the various subdirectories includes Makefile.inc, defines variables and rules specific to what is being built, then includes Makefile.rules which defines all the rules. Makefile.inc defines the locations of all the dependencies and the compiler -and linker flags. It is automatically created from Makefile.inc.cross. Any -changes must be made to Makefile.inc.cross not Makefile.inc or they will be -overwritten the next time Makefile.inc.cross is updated. There is also a -file called Makefile.inc.native. This file is used for MinGW32 running on -Windows. However at this time it probably isn't useful to anyone but me -since the locations aren't updated automatically. +and linker flags. It is automatically created from Makefile.inc.in. Any +changes must be made to Makefile.inc.in not Makefile.inc or they will be +overwritten the next time Makefile.inc.in is updated. Makefile.rules defines a bunch of macros to simplify building. It also includes all the basic rules for building objects, GUI and console diff --git a/bacula/src/win32/bacula.nsi b/bacula/src/win32/bacula.nsi deleted file mode 100644 index 599aa87383..0000000000 --- a/bacula/src/win32/bacula.nsi +++ /dev/null @@ -1,160 +0,0 @@ -;NSIS Modern User Interface version 1.63 -;Start Menu Folder Selection Example Script -;Written by Joost Verburg - -!define MUI_PRODUCT "Bacula" ;Define your own software name here -!define MUI_VERSION "1.33.4" ;Define your own software version here - -!include "MUI.nsh" -!include "util.nsh" - -;-------------------------------- -;Configuration - - ;General - OutFile "bacula-install.exe" - - ;Folder selection page - InstallDir "$PROGRAMFILES\${MUI_PRODUCT}" - - ;Remember install folder - InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" "" - - ;$9 is being used to store the Start Menu Folder. - ;Do not use this variable in your script (or Push/Pop it)! - - ;To change this variable, use MUI_STARTMENUPAGE_VARIABLE. - ;Have a look at the Readme for info about other options (default folder, - ;registry). - - ;Remember the Start Menu Folder - !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" - !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${MUI_PRODUCT}" - !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" - - !define TEMP $R0 - -;-------------------------------- -;Modern UI Configuration - - !define MUI_LICENSEPAGE - !define MUI_COMPONENTSPAGE - !define MUI_DIRECTORYPAGE - !define MUI_STARTMENUPAGE - - !define MUI_ABORTWARNING - - !define MUI_UNINSTALLER - !define MUI_UNCONFIRMPAGE - -;-------------------------------- -;Languages - - !insertmacro MUI_LANGUAGE "English" - -;-------------------------------- -;Language Strings - - ;Description - LangString DESC_SecCopyUI ${LANG_ENGLISH} "Install Bacula client on this system." - -;-------------------------------- -;Data - - LicenseData "License.txt" - -;-------------------------------- -;Installer Sections - -Section "Bacula File Service" SecCopyUI - - ;ADD YOUR OWN STUFF HERE! - - SetOutPath "$INSTDIR" - File baculafd\Release\bacula-fd.exe - File pthreads\pthreadVCE.dll - IfFileExists "$INSTDIR\bacula-fd.conf" sconf - File bacula-fd.conf - goto doDir - sconf: - File /oname=bacula-fd.conf.N bacula-fd.conf - doDir: - CreateDirectory "$INSTDIR\working" - - ;Store install folder - WriteRegStr HKCU "Software\${MUI_PRODUCT}" "" $INSTDIR - - !insertmacro MUI_STARTMENU_WRITE_BEGIN - - ;Create shortcuts - CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}" - CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" - Call IsNT - Pop $R0 - StrCmp $R0 "false" do98sc - - CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Start Service.lnk" "$SYSDIR\net.exe" "start bacula" "$INSTDIR\bacula-fd.exe" 2 - CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Stop Service.lnk" "$SYSDIR\net.exe" "stop bacula" "$INSTDIR\bacula-fd.exe" 3 - goto scend - do98sc: - - CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Start Service.lnk" "$INSTDIR\bacula-fd.exe" "-c bacula-fd.conf" "$INSTDIR\bacula-fd.exe" 2 - CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Stop Service.lnk" "$INSTDIR\bacula-fd.exe" "/kill" "$INSTDIR\bacula-fd.exe" 3 - scend: - !insertmacro MUI_STARTMENU_WRITE_END - - ;Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" - - ; Install service - ExecWait '"$INSTDIR\bacula-fd.exe" /install -c "$INSTDIR\bacula-fd.conf"' - -SectionEnd - -;Display the Finish header -;Insert this macro after the sections if you are not using a finish page -!insertmacro MUI_SECTIONS_FINISHHEADER - -;-------------------------------- -;Descriptions - -!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN -!insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI) -!insertmacro MUI_FUNCTIONS_DESCRIPTION_END - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - - ;ADD YOUR OWN STUFF HERE! - ExecWait '"$INSTDIR\bacula-fd.exe" /kill' - Sleep 1000 - ExecWait '"$INSTDIR\bacula-fd.exe" /remove' - Sleep 1000 - - Delete "$INSTDIR\bacula-fd.exe" - Delete "$INSTDIR\bacula-fd.conf.N" - Delete "$INSTDIR\pthreadVCE.dll" - Delete "$INSTDIR\Uninstall.exe" - RMDir "$INSTDIR\working" - ;Remove shortcut - ReadRegStr ${TEMP} "${MUI_STARTMENUPAGE_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}" - - StrCmp ${TEMP} "" noshortcuts - - Delete "$SMPROGRAMS\${TEMP}\Uninstall.lnk" - Delete "$SMPROGRAMS\${TEMP}\Start Service.lnk" - Delete "$SMPROGRAMS\${TEMP}\Stop Service.lnk" - RMDir "$SMPROGRAMS\${TEMP}" ;Only if empty, so it won't delete other shortcuts - - noshortcuts: - - RMDir "$INSTDIR" - - DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}" - - ;Display the Finish header - !insertmacro MUI_UNFINISHHEADER - -SectionEnd diff --git a/bacula/src/win32/build-dependencies b/bacula/src/win32/build-dependencies index 1dbca6e7af..35a8a34d40 100755 --- a/bacula/src/win32/build-dependencies +++ b/bacula/src/win32/build-dependencies @@ -1,3 +1,5 @@ +#!/bin/sh + VERBOSE=n OVERWRITE=n @@ -36,16 +38,19 @@ SCRIPT_DIR=`pwd` cd ../../.. TOP_DIR=`pwd` -if [ ! -e ${TOP_DIR}/cross-tools/mingw32/bin/mingw32-gcc ] +if [ -e ${TOP_DIR}/cross-tools/mingw32/bin/mingw32-gcc ] +then + cd ${TOP_DIR}/cross-tools/mingw32/bin + BIN_DIR=`pwd` +elif [ -e /mingw/bin/mingw32-gcc ] then + BIN_DIR=/mingw/bin +else echo The GCC cross compiler isn\'t installed. echo You must run build-win32-cross-tools first exit 1 fi -cd ${TOP_DIR}/cross-tools/mingw32/bin -BIN_DIR=`pwd` - [ ! -e ${TOP_DIR}/depkgs-mingw32 ] && mkdir ${TOP_DIR}/depkgs-mingw32 cd ${TOP_DIR}/depkgs-mingw32 DEPPKG_DIR=`pwd` @@ -221,7 +226,12 @@ process_mysql() { get_source "${URL_MYSQL}" "${DIR_MYSQL}" echo Converting mysql lib file - ${BIN_DIR}/../mingw32/bin/reimp --dlltool ${BIN_DIR}/mingw32-dlltool --as ${BIN_DIR}/mingw32-as lib/opt/libmysql.lib + if [ -e ${BIN_DIR}/reimp ] + then + reimp --dlltool ${BIN_DIR}/mingw32-dlltool --as ${BIN_DIR}/mingw32-as lib/opt/libmysql.lib + else + ${BIN_DIR}/../mingw32/bin/reimp --dlltool ${BIN_DIR}/mingw32-dlltool --as ${BIN_DIR}/mingw32-as lib/opt/libmysql.lib + fi echo Installing mysql cp -p liblibmysql.a ../../lib/libmysql.a rm -rf ../../include/mysql @@ -281,7 +291,7 @@ process_wxWidgets() echo Building wxWidgets cd build/msw > make.log - do_make makefile.mingw32 SHARED=1 VENDOR=bacula + do_make makefile.mingw32 SHARED=1 VENDOR=bacula DEBUG_INFO=1 echo Installing wxWidgets cd ../.. rm -rf ../../include/wx @@ -368,7 +378,7 @@ process_mt() do_patch mt.patch fi echo Building mt - do_make Makefile prefix=${DEPPKG_DIR} all + do_make Makefile PREFIX=${DEPPKG_DIR} all echo Installing mt do_make Makefile PREFIX=${DEPPKG_DIR} install } @@ -386,6 +396,7 @@ then process_scons process_nsis process_mtx + process_mt else for dependency in "$@" do diff --git a/bacula/src/win32/console/Makefile b/bacula/src/win32/console/Makefile index 8b6f5f5e9f..8d4b05744a 100644 --- a/bacula/src/win32/console/Makefile +++ b/bacula/src/win32/console/Makefile @@ -48,6 +48,6 @@ clean: # $(BINDIR)/bconsole.exe: $(CONSOLE_OBJS) $(LIBS_BACULA) - $(call link_winapp,$(CONSOLE_LIBS)) + $(call link_conapp,$(CONSOLE_LIBS)) include ../Makefile.rules diff --git a/bacula/src/win32/console/filelist b/bacula/src/win32/console/filelist deleted file mode 100644 index 152c443b71..0000000000 --- a/bacula/src/win32/console/filelist +++ /dev/null @@ -1,38 +0,0 @@ -..\lib\address_conf -..\lib\alist -..\lib\base64 -..\lib\berrno -..\lib\bnet -..\lib\bsys -..\lib\btime -..\lib\btimers -..\lib\cram-md5 -..\lib\crc32 -..\lib\dlist -..\lib\edit -..\lib\getopt -..\lib\hmac -..\lib\idcache -..\lib\jcr -..\lib\lex -..\lib\md5 -..\lib\mem_pool -..\lib\message -..\lib\parse_conf -..\lib\queue -..\lib\res -..\lib\rwlock -..\lib\scan -..\lib\serial -..\lib\sha1 -..\lib\smartall -..\lib\tls -..\lib\util -..\lib\watchdog -..\lib\winapi -..\compat\compat -..\compat\print -.\authenticate -.\console -.\console_conf -.\StdAfx diff --git a/bacula/src/win32/console/genmake.sh b/bacula/src/win32/console/genmake.sh deleted file mode 100644 index 880c5223de..0000000000 --- a/bacula/src/win32/console/genmake.sh +++ /dev/null @@ -1,16 +0,0 @@ -rm -f bconsole.mak -sed -e 's/^\(.*\)\\\(.*\)$/FILENAME=\2\nSOURCE=\1\\\2.cpp\n@@OBJMAKIN@@\n/g' filelist > objtargets1.tmp -sed -e '/@@OBJMAKIN@@/r bconsole-obj.mak.in' -e '/@@OBJMAKIN@@/d' objtargets1.tmp > objtargets.tmp -sed -e 's/^\(.*\)\\\(.*\)$/\t-@erase "\$(INTDIR)\\\2.obj"/g' filelist > relclean.tmp -sed -e 's/^\(.*\)\\\(.*\)$/\t"\$(INTDIR)\\\2.obj" \\/g' filelist > relobjs.tmp -sed -e 's/^\(.*\)\\\(.*\)$/\t-@erase "\$(INTDIR)\\\2.obj\n\t-@erase "\$(INTDIR)\\\2.sbr"/g' filelist > debclean.tmp -sed -e 's/^\(.*\)\\\(.*\)$/\t"\$(INTDIR)\\\2.obj" \\/g' filelist > debobjs.tmp -sed -e 's/^\(.*\)\\\(.*\)$/\t"\$(INTDIR)\\\2.sbr" \\/g' filelist > debsbrs.tmp -sed -e '/@@OBJTARGETS@@/r objtargets.tmp' -e '/@@OBJTARGETS@@/d' \ - -e '/@@REL-CLEAN@@/r relclean.tmp' -e '/@@REL-CLEAN@@/d' \ - -e '/@@REL-OBJS@@/r relobjs.tmp' -e '/@@REL-OBJS@@/d' \ - -e '/@@DEB-CLEAN@@/r debclean.tmp' -e '/@@DEB-CLEAN@@/d' \ - -e '/@@DEB-OBJS@@/r debobjs.tmp' -e '/@@DEB-OBJS@@/d' \ - -e '/@@DEB-SBRS@@/r debsbrs.tmp' -e '/@@DEB-SBRS@@/d' \ - bconsole.mak.in > bconsole.mak -rm *.tmp diff --git a/bacula/src/win32/dird/winservice.cpp b/bacula/src/win32/dird/winservice.cpp index 604c6db64a..15521bf521 100644 --- a/bacula/src/win32/dird/winservice.cpp +++ b/bacula/src/win32/dird/winservice.cpp @@ -98,7 +98,7 @@ PostToBacula(UINT message, WPARAM wParam, LPARAM lParam) // Post the message to Bacula PostMessage(hservwnd, message, wParam, lParam); #endif - return TRUE; + return FALSE; } diff --git a/bacula/src/win32/dll/bacula.def b/bacula/src/win32/dll/bacula.def index 45814c567f..6d8f502c1e 100644 --- a/bacula/src/win32/dll/bacula.def +++ b/bacula/src/win32/dll/bacula.def @@ -33,6 +33,7 @@ _Z10_db_unlockPKciP4B_DB _Z11db_strerrorP4B_DB ;_Z11list_dashesP4B_DBPFvPvPKcES1_ ;_Z11list_resultP3JCRP4B_DBPFvPvPKcES3_11e_list_type +_Z16db_int64_handlerPviPPc _Z18db_end_transactionP3JCRP4B_DB ;_Z18get_sql_record_maxP3JCRP4B_DB ;_Z19split_path_and_fileP3JCRP4B_DBPKc diff --git a/bacula/src/win32/ClientConfig.ini b/bacula/src/win32/installer/ClientConfig.ini similarity index 100% rename from bacula/src/win32/ClientConfig.ini rename to bacula/src/win32/installer/ClientConfig.ini diff --git a/bacula/src/win32/installer/Makefile b/bacula/src/win32/installer/Makefile new file mode 100644 index 0000000000..deee361d7c --- /dev/null +++ b/bacula/src/win32/installer/Makefile @@ -0,0 +1,99 @@ +# +# Makefile for win32 bacula executables +# Using MinGW cross-compiler on GNU/Linux +# +# Written by Robert Nelson, June 2006 +# + +include ../Makefile.inc + +VERSION := $(shell sed -ne 's/.*[ \t]VERSION[ \t]\+"\(.*\)"/\1/p' < ../../version.h) + +DEFINES := \ + -DVERSION=$(VERSION) \ + -DBINDIR=$(BINDIR) \ + -DDOCDIR=$(DOCDIR) \ + -DDEPKGS=$(DEPKGS) \ + -DMINGW_BIN=$(MINGW_BIN) + +INSTALL_EXE := winbacula-$(VERSION).exe + +BACULA_BINARIES := \ + bacula.dll \ + bacula-dir.exe \ + bacula-fd.exe \ + bacula-sd.exe \ + bconsole.exe \ + bcopy.exe \ + bextract.exe \ + bls.exe \ + bscan.exe \ + btape.exe \ + dbcheck.exe \ + wx-console.exe + +DEPKGS_BINARIES := \ + libeay32.dll \ + libmysql.dll \ + pthreadGCE.dll \ + ssleay32.dll \ + zlib1.dll \ + openssl.exe \ + loaderinfo.exe \ + mt.exe \ + mtx.exe \ + scsitape.exe \ + tapeinfo.exe \ + wxbase26_gcc_bacula.dll \ + wxmsw26_core_gcc_bacula.dll + +SCRIPTS := \ + ../scripts/mtx-changer.cmd.in \ + ../cats/create_mysql_database.cmd \ + ../cats/drop_mysql_database.cmd \ + ../cats/make_mysql_tables.cmd \ + ../cats/make_mysql_tables.sql \ + ../cats/drop_mysql_tables.cmd \ + ../cats/drop_mysql_tables.sql \ + ../cats/update_mysql_tables.cmd \ + ../cats/update_mysql_tables.sql \ + ../cats/grant_mysql_privileges.cmd \ + ../cats/grant_mysql_privileges.sql \ + ../cats/make_catalog_backup.cmd \ + ../cats/delete_catalog_backup.cmd + +########################################################################## + +# Targets + +.PHONY: all clean installer + +all: + +installer: $(INSTALL_EXE) + +clean: + @echo "Cleaning `pwd`" + $(CMD_ECHO)-rm -f $(INSTALL_EXE) $(BACULA_BINARIES) $(DEPKGS_BINARIES) + $(CMD_ECHO)-rm -f $(BACULA_BINARIES) $(addsuffix .dbg,$(basename $(BACULA_BINARIES))) + $(CMD_ECHO)-rm -f $(DEPKGS_BINARIES) $(addsuffix .dbg,$(basename $(DEPKGS_BINARIES))) + +# +# Rules +# + +define Strip_Binary +$$(notdir $(1)): $(1) + $(ECHO_CMD)cp -f $$^ $$@ + $$(call makedbg,$$@) +endef + +$(foreach file,$(addprefix $(DEPKGS)/bin/, $(DEPKGS_BINARIES)),$(eval $(call Strip_Binary,$(file)))) + +$(foreach file,$(addprefix $(BINDIR)/, $(BACULA_BINARIES)),$(eval $(call Strip_Binary,$(file)))) + +$(INSTALL_EXE): winbacula.nsi $(BACULA_BINARIES) $(SCRIPTS) $(DEPKGS_BINARIES) + NSISDIR=$(NSIS_DIR) \ + $(NSIS_DIR)/makensis -V3 $(DEFINES) winbacula.nsi + +include ../Makefile.rules diff --git a/bacula/src/win32/Start.bat b/bacula/src/win32/installer/Start.bat similarity index 100% rename from bacula/src/win32/Start.bat rename to bacula/src/win32/installer/Start.bat diff --git a/bacula/src/win32/Stop.bat b/bacula/src/win32/installer/Stop.bat similarity index 100% rename from bacula/src/win32/Stop.bat rename to bacula/src/win32/installer/Stop.bat diff --git a/bacula/src/win32/winbacula.nsi.in b/bacula/src/win32/installer/winbacula.nsi old mode 100755 new mode 100644 similarity index 93% rename from bacula/src/win32/winbacula.nsi.in rename to bacula/src/win32/installer/winbacula.nsi index 61ca944592..ab4e063cbd --- a/bacula/src/win32/winbacula.nsi.in +++ b/bacula/src/win32/installer/winbacula.nsi @@ -35,15 +35,7 @@ ; /start !define PRODUCT "Bacula" -!define VERSION "@VERSION@" - -!define PTHREADS_DIR "..\..\..\depkgs-win32\pthreads\release" -!define MINGW_DIR "C:\MinGW\bin" - -!define BUILD_TOOLS "MinGW" - -;!define BUILD_TOOLS "VC8" -;!define VC_REDIST_DIR "C:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT" +!define BUILD_TOOLS "MinGW" ; ; Include the Modern UI @@ -179,17 +171,22 @@ Function CopyDependencies SetOutPath "$INSTDIR\bin" ${If} $DependenciesDone = 0 -!if BUILD_TOOLS == "VC8" - File "${PTHREADS_DIR}\pthreadVCE.dll" +!if "${BUILD_TOOLS}" == "VC8" File "${VC_REDIST_DIR}\msvcm80.dll" File "${VC_REDIST_DIR}\msvcp80.dll" File "${VC_REDIST_DIR}\msvcr80.dll" File "${VC_REDIST_DIR}\Microsoft.VC80.CRT.manifest" !endif -!if BUILD_TOOLS == "MinGW" - File "${PTHREADS_DIR}\pthreadGCE.dll" - File "${MINGW_DIR}\mingwm10.dll" +!if "${BUILD_TOOLS}" == "MinGW" + File "${MINGW_BIN}\..\mingw32\bin\mingwm10.dll" !endif + File "libeay32.dll" + File "libmysql.dll" + File "pthreadGCE.dll" + File "ssleay32.dll" + File "zlib1.dll" + File "openssl.exe" + File "bacula.dll" StrCpy $DependenciesDone 1 ${EndIf} FunctionEnd @@ -206,7 +203,7 @@ Section "-Initialize" CreateDirectory "$INSTDIR\bin" CreateDirectory "$APPDATA\Bacula" - File ..\..\LICENSE + File "..\..\..\LICENSE" Delete /REBOOTOK "$INSTDIR\bin\License.txt" SectionEnd @@ -216,7 +213,7 @@ Section "File Service" SecFileDaemon SectionIn 1 2 3 SetOutPath "$INSTDIR\bin" - File "Release\bacula-fd.exe" + File "bacula-fd.exe" StrCpy $R0 0 StrCpy $R1 "$APPDATA\Bacula\bacula-fd.conf" @@ -254,12 +251,18 @@ Section "Storage Service" SecStorageDaemon SectionIn 2 3 SetOutPath "$INSTDIR\bin" - File "Release\bacula-sd.exe" - File "Release\bcopy.exe" - File "Release\bextract.exe" - File "Release\bls.exe" - File "Release\bscan.exe" - File "Release\btape.exe" + File "loaderinfo.exe" + File "mt.exe" + File "mtx.exe" + File "scsitape.exe" + File "tapeinfo.exe" + File "bacula-sd.exe" + File "bcopy.exe" + File "bextract.exe" + File "bls.exe" + File "bscan.exe" + File "btape.exe" + File /oname=mtx-changer.cmd ..\scripts\mtx-changer.cmd.in StrCpy $R0 0 StrCpy $R1 "$APPDATA\Bacula\bacula-sd.conf" @@ -267,7 +270,7 @@ Section "Storage Service" SecStorageDaemon StrCpy $R0 1 StrCpy $R1 "$R1.new" - File /oname=$R1 ..\stored\bacula-sd.conf.in + File /oname=$R1 "..\..\stored\bacula-sd.conf.in" ${If} $OptSilent <> 1 ${AndIf} $R0 <> 1 @@ -292,8 +295,20 @@ Section "Director Service" SecDirectorDaemon SectionIn 2 3 SetOutPath "$INSTDIR\bin" - File "Release\bacula-dir.exe" - File "Release\dbcheck.exe" + File "bacula-dir.exe" + File "dbcheck.exe" + File ..\cats\create_mysql_database.cmd + File ..\cats\drop_mysql_database.cmd + File ..\cats\make_mysql_tables.cmd + File ..\cats\make_mysql_tables.sql + File ..\cats\drop_mysql_tables.cmd + File ..\cats\drop_mysql_tables.sql + File ..\cats\update_mysql_tables.cmd + File ..\cats\update_mysql_tables.sql + File ..\cats\grant_mysql_privileges.cmd + File ..\cats\grant_mysql_privileges.sql + File ..\cats\make_catalog_backup.cmd + File ..\cats\delete_catalog_backup.cmd StrCpy $R0 0 StrCpy $R1 "$APPDATA\Bacula\bacula-dir.conf" @@ -301,7 +316,7 @@ Section "Director Service" SecDirectorDaemon StrCpy $R0 1 StrCpy $R1 "$R1.new" - File /oname=$R1 ..\dird\bacula-dir.conf.in + File /oname=$R1 "..\..\dird\bacula-dir.conf.in" ${If} $OptSilent <> 1 ${AndIf} $R0 <> 1 @@ -329,7 +344,7 @@ SectionGroup "Consoles" Section "Command Console" SecConsole SectionIn 3 - File Release\bconsole.exe + File "bconsole.exe" Call CopyDependencies StrCpy $R0 0 @@ -338,7 +353,7 @@ Section "Command Console" SecConsole StrCpy $R0 1 StrCpy $R1 "$R1.new" - File /oname=$R1 ..\console\bconsole.conf.in + File /oname=$R1 "..\..\console\bconsole.conf.in" ${If} $OptSilent <> 1 ${AndIf} $R0 <> 1 @@ -357,8 +372,10 @@ SectionEnd Section "Graphical Console" SecWxConsole SectionIn 1 2 3 - File Release\wx-console.exe Call CopyDependencies + File "wxbase26_gcc_bacula.dll" + File "wxmsw26_core_gcc_bacula.dll" + File "wx-console.exe" StrCpy $R0 0 StrCpy $R1 "$APPDATA\Bacula\wx-console.conf" @@ -366,7 +383,7 @@ Section "Graphical Console" SecWxConsole StrCpy $R0 1 StrCpy $R1 "$R1.new" - File /oname=$R1 ..\wx-console\wx-console.conf.in + File /oname=$R1 "..\..\wx-console\wx-console.conf.in" ${If} $OptSilent <> 1 ${AndIf} $R0 <> 1 @@ -392,7 +409,7 @@ Section "Documentation (Acrobat Format)" SecDocPdf SetOutPath "$INSTDIR\doc" CreateDirectory "$INSTDIR\doc" - File ..\..\..\docs\manual\bacula.pdf + File "${DOCDIR}\manual\bacula.pdf" CreateShortCut "$SMPROGRAMS\Bacula\Manual.lnk" '"$INSTDIR\doc\bacula.pdf"' SectionEnd @@ -401,9 +418,9 @@ Section "Documentation (HTML Format)" SecDocHtml SetOutPath "$INSTDIR\doc" CreateDirectory "$INSTDIR\doc" - File ..\..\..\docs\manual\bacula\*.html - File ..\..\..\docs\manual\bacula\*.png - File ..\..\..\docs\manual\bacula\*.css + File "${DOCDIR}\manual\bacula\*.html" + File "${DOCDIR}\manual\bacula\*.png" + File "${DOCDIR}\manual\bacula\*.css" CreateShortCut "$SMPROGRAMS\Bacula\Manual (HTML).lnk" '"$INSTDIR\doc\bacula.html"' SectionEnd @@ -770,8 +787,8 @@ Function InstallDaemon ExecWait '"$INSTDIR\bin\$0.exe" /install' ${If} $OsIsNT <> 1 - File Start.bat - File Stop.bat + File "Start.bat" + File "Stop.bat" ${EndIf} ; Start the service? (default skipped if silent, use /start to force starting) diff --git a/bacula/src/win32/patches/nsis.patch b/bacula/src/win32/patches/nsis.patch index 7037410c99..6b9d832dce 100644 --- a/bacula/src/win32/patches/nsis.patch +++ b/bacula/src/win32/patches/nsis.patch @@ -1,296 +1,427 @@ Index: SCons/Config/gnu ---- ../nsis-2.17-src-rel/SCons/Config/gnu 2006-04-28 08:54:41.000000000 -0700 -+++ ./SCons/Config/gnu 2006-06-19 23:12:11.000000000 -0700 +--- ../release/nsis-2.17-src/SCons/Config/gnu 2006-04-28 08:54:41.000000000 -0700 ++++ ./SCons/Config/gnu 2006-07-31 05:48:44.000000000 -0700 @@ -65,7 +65,7 @@ - cross_env(stub_env) - - if not defenv['DEBUG']: -- stub_env.Append(CCFLAGS = '-Os') # optimize for size -+ stub_env.Append(CCFLAGS = '-Os -fno-strict-aliasing') # optimize for size - stub_env.Append(CCFLAGS = '-Wall') # all warnings - stub_env.Append(CCFLAGS = '-x c') # force compile as c - + cross_env(stub_env) + + if not defenv['DEBUG']: +- stub_env.Append(CCFLAGS = '-Os') # optimize for size ++ stub_env.Append(CCFLAGS = '-Os -fno-strict-aliasing') # optimize for size + stub_env.Append(CCFLAGS = '-Wall') # all warnings + stub_env.Append(CCFLAGS = '-x c') # force compile as c + @@ -82,7 +82,7 @@ - makensis_env = defenv.Copy() - - if not defenv['DEBUG']: -- makensis_env.Append(CCFLAGS = '-O2') # optimize -+ makensis_env.Append(CCFLAGS = '-O2 -fno-strict-aliasing') # optimize - makensis_env.Append(CCFLAGS = '-Wall') # all warnings - - conf = FlagsConfigure(makensis_env) + makensis_env = defenv.Copy() + + if not defenv['DEBUG']: +- makensis_env.Append(CCFLAGS = '-O2') # optimize ++ makensis_env.Append(CCFLAGS = '-O2 -fno-strict-aliasing') # optimize + makensis_env.Append(CCFLAGS = '-Wall') # all warnings + + conf = FlagsConfigure(makensis_env) @@ -97,7 +97,7 @@ - cross_env(plugin_env) - - if not defenv['DEBUG']: -- plugin_env.Append(CCFLAGS = '-Os') # optimize for size -+ plugin_env.Append(CCFLAGS = '-Os -fno-strict-aliasing') # optimize for size - plugin_env.Append(CCFLAGS = '-Wall') # level 3 warnings - - if not defenv['DEBUG']: + cross_env(plugin_env) + + if not defenv['DEBUG']: +- plugin_env.Append(CCFLAGS = '-Os') # optimize for size ++ plugin_env.Append(CCFLAGS = '-Os -fno-strict-aliasing') # optimize for size + plugin_env.Append(CCFLAGS = '-Wall') # level 3 warnings + + if not defenv['DEBUG']: @@ -111,7 +111,7 @@ - cp_util_env = defenv.Copy() - - if not defenv['DEBUG']: -- cp_util_env.Append(CCFLAGS = '-O2') # optimize -+ cp_util_env.Append(CCFLAGS = '-O2 -fno-strict-aliasing') # optimize - cp_util_env.Append(CCFLAGS = '-Wall') # all warnings - - conf = FlagsConfigure(cp_util_env) + cp_util_env = defenv.Copy() + + if not defenv['DEBUG']: +- cp_util_env.Append(CCFLAGS = '-O2') # optimize ++ cp_util_env.Append(CCFLAGS = '-O2 -fno-strict-aliasing') # optimize + cp_util_env.Append(CCFLAGS = '-Wall') # all warnings + + conf = FlagsConfigure(cp_util_env) +Index: Source/build.cpp +--- ../release/nsis-2.17-src/Source/build.cpp 2006-04-14 03:05:01.000000000 -0700 ++++ ./Source/build.cpp 2006-07-31 13:26:38.000000000 -0700 +@@ -2384,7 +2384,7 @@ + return PS_ERROR; + } + #ifdef NSIS_CONFIG_CRC_SUPPORT +- crc_writer_sink crc_sink((unsigned long *) &crc); ++ crc_writer_sink crc_sink((unsigned int *) &crc); + firstheader_writer w(&crc_sink); + w.write(&fh); + +Index: Source/build.h +--- ../release/nsis-2.17-src/Source/build.h 2005-04-02 04:04:06.000000000 -0800 ++++ ./Source/build.h 2006-07-31 13:28:44.000000000 -0700 +@@ -38,7 +38,7 @@ + #ifdef NSIS_CONFIG_CRC_SUPPORT + extern "C" + { +- unsigned long NSISCALL CRC32(unsigned long crc, const unsigned char *buf, unsigned int len); ++ unsigned int NSISCALL CRC32(unsigned int crc, const unsigned char *buf, unsigned int len); + }; + #endif + +Index: Source/crc32.c +--- ../release/nsis-2.17-src/Source/crc32.c 2004-03-12 12:43:54.000000000 -0800 ++++ ./Source/crc32.c 2006-07-31 13:27:12.000000000 -0700 +@@ -3,18 +3,18 @@ + #ifdef NSIS_CONFIG_CRC_SUPPORT + + // this is based on the (slow,small) CRC32 implementation from zlib. +-unsigned long NSISCALL CRC32(unsigned long crc, const unsigned char *buf, unsigned int len) ++unsigned int NSISCALL CRC32(unsigned int crc, const unsigned char *buf, unsigned int len) + { +- static unsigned long crc_table[256]; ++ static unsigned int crc_table[256]; + + if (!crc_table[1]) + { +- unsigned long c; ++ unsigned int c; + int n, k; + + for (n = 0; n < 256; n++) + { +- c = (unsigned long)n; ++ c = (unsigned int)n; + for (k = 0; k < 8; k++) c = (c >> 1) ^ (c & 1 ? 0xedb88320L : 0); + crc_table[n] = c; + } Index: Source/DialogTemplate.cpp ---- ../nsis-2.17-src-rel/Source/DialogTemplate.cpp 2006-03-24 10:36:24.000000000 -0800 -+++ ./Source/DialogTemplate.cpp 2006-06-20 00:04:01.000000000 -0700 +--- ../release/nsis-2.17-src/Source/DialogTemplate.cpp 2006-03-24 10:36:24.000000000 -0800 ++++ ./Source/DialogTemplate.cpp 2006-07-31 05:48:44.000000000 -0700 @@ -93,7 +93,7 @@ - if (IS_INTRESOURCE(x)) { \ - *(WORD*)seeker = 0xFFFF; \ - seeker += sizeof(WORD); \ -- *(WORD*)seeker = ConvertEndianness(WORD(DWORD(x))); \ -+ *(WORD*)seeker = ConvertEndianness(WORD(ULONG_PTR(x))); \ - seeker += sizeof(WORD); \ - } \ - else { \ + if (IS_INTRESOURCE(x)) { \ + *(WORD*)seeker = 0xFFFF; \ + seeker += sizeof(WORD); \ +- *(WORD*)seeker = ConvertEndianness(WORD(DWORD(x))); \ ++ *(WORD*)seeker = ConvertEndianness(WORD(ULONG_PTR(x))); \ + seeker += sizeof(WORD); \ + } \ + else { \ @@ -629,7 +629,7 @@ - } - } - -- assert((DWORD) seeker - (DWORD) pbDlg == dwSize); -+ assert((ULONG_PTR) seeker - (ULONG_PTR) pbDlg == dwSize); - - // DONE! - return pbDlg; + } + } + +- assert((DWORD) seeker - (DWORD) pbDlg == dwSize); ++ assert((ULONG_PTR) seeker - (ULONG_PTR) pbDlg == dwSize); + + // DONE! + return pbDlg; +Index: Source/exehead/fileform.c +--- ../release/nsis-2.17-src/Source/exehead/fileform.c 2005-09-09 09:08:44.000000000 -0700 ++++ ./Source/exehead/fileform.c 2006-07-31 13:26:08.000000000 -0700 +@@ -95,7 +95,7 @@ + static z_stream g_inflate_stream; + #endif + +-extern unsigned long NSISCALL CRC32(unsigned long crc, const unsigned char *buf, unsigned int len); ++extern unsigned int NSISCALL CRC32(unsigned int crc, const unsigned char *buf, unsigned int len); + + const char * NSISCALL loadHeaders(int cl_flags) + { Index: Source/Platform.h ---- ../nsis-2.17-src-rel/Source/Platform.h 2006-05-03 08:43:54.000000000 -0700 -+++ ./Source/Platform.h 2006-06-20 00:14:31.000000000 -0700 +--- ../release/nsis-2.17-src/Source/Platform.h 2006-05-03 08:43:54.000000000 -0700 ++++ ./Source/Platform.h 2006-07-31 05:48:44.000000000 -0700 @@ -16,15 +16,15 @@ - // basic types - typedef unsigned char BYTE, *PBYTE, *LPBYTE; - typedef unsigned short WORD, *LPWORD; --typedef unsigned long DWORD, *LPDWORD; -+typedef unsigned int DWORD, *LPDWORD; - typedef short SHORT; - typedef unsigned short USHORT; - typedef unsigned int UINT; - typedef unsigned int UINT32; - typedef int INT; - typedef int INT32; --typedef long LONG; --typedef unsigned long ULONG; -+typedef int LONG; -+typedef unsigned int ULONG; - typedef long long INT64, LARGE_INTEGER; - typedef unsigned long long UINT64, ULARGE_INTEGER; - typedef int BOOL, *LPBOOL; + // basic types + typedef unsigned char BYTE, *PBYTE, *LPBYTE; + typedef unsigned short WORD, *LPWORD; +-typedef unsigned long DWORD, *LPDWORD; ++typedef unsigned int DWORD, *LPDWORD; + typedef short SHORT; + typedef unsigned short USHORT; + typedef unsigned int UINT; + typedef unsigned int UINT32; + typedef int INT; + typedef int INT32; +-typedef long LONG; +-typedef unsigned long ULONG; ++typedef int LONG; ++typedef unsigned int ULONG; + typedef long long INT64, LARGE_INTEGER; + typedef unsigned long long UINT64, ULARGE_INTEGER; + typedef int BOOL, *LPBOOL; @@ -35,13 +35,14 @@ - typedef const char *LPCCH, *PCSTR, *LPCSTR; - typedef unsigned short WCHAR, *PWCHAR, *LPWCH, *PWCH, *NWPSTR, *LPWSTR, *PWSTR; - typedef const unsigned short *LPCWCH, *PCWCH, *LPCWSTR, *PCWSTR; --typedef unsigned int UINT_PTR; -+typedef unsigned long UINT_PTR; -+typedef unsigned long ULONG_PTR; - // basic stuff - typedef void * HANDLE; --typedef unsigned long HKEY; -+typedef unsigned int HKEY; - // some gdi --typedef unsigned long COLORREF; --typedef unsigned long HBRUSH; -+typedef unsigned int COLORREF; -+typedef unsigned int HBRUSH; - // bool - # define FALSE 0 - # define TRUE 1 + typedef const char *LPCCH, *PCSTR, *LPCSTR; + typedef unsigned short WCHAR, *PWCHAR, *LPWCH, *PWCH, *NWPSTR, *LPWSTR, *PWSTR; + typedef const unsigned short *LPCWCH, *PCWCH, *LPCWSTR, *PCWSTR; +-typedef unsigned int UINT_PTR; ++typedef unsigned long UINT_PTR; ++typedef unsigned long ULONG_PTR; + // basic stuff + typedef void * HANDLE; +-typedef unsigned long HKEY; ++typedef unsigned int HKEY; + // some gdi +-typedef unsigned long COLORREF; +-typedef unsigned long HBRUSH; ++typedef unsigned int COLORREF; ++typedef unsigned int HBRUSH; + // bool + # define FALSE 0 + # define TRUE 1 @@ -129,13 +130,13 @@ - - #ifndef _WIN32 - # ifndef FIELD_OFFSET --# define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f)) -+# define FIELD_OFFSET(t,f) ((ULONG_PTR)&(((t*)0)->f)) - # endif - # ifndef MAKEINTRESOURCE - # define MAKEINTRESOURCE(i) (LPSTR)((DWORD)((WORD)(i))) - # endif - # ifndef IMAGE_FIRST_SECTION --# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (DWORD) h + \ -+# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (ULONG_PTR) h + \ - FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + \ - FIX_ENDIAN_INT16(PIMAGE_NT_HEADERS(h)->FileHeader.SizeOfOptionalHeader) ) ) - # endif + + #ifndef _WIN32 + # ifndef FIELD_OFFSET +-# define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f)) ++# define FIELD_OFFSET(t,f) ((ULONG_PTR)&(((t*)0)->f)) + # endif + # ifndef MAKEINTRESOURCE + # define MAKEINTRESOURCE(i) (LPSTR)((DWORD)((WORD)(i))) + # endif + # ifndef IMAGE_FIRST_SECTION +-# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (DWORD) h + \ ++# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (ULONG_PTR) h + \ + FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + \ + FIX_ENDIAN_INT16(PIMAGE_NT_HEADERS(h)->FileHeader.SizeOfOptionalHeader) ) ) + # endif @@ -166,9 +167,9 @@ - # define FOF_NOERRORUI 0x0400 - #endif - --#ifndef ULONG_PTR --# define ULONG_PTR DWORD --#endif -+//#ifndef ULONG_PTR -+//# define ULONG_PTR ULONG -+//#endif - - #ifndef IDC_HAND - # define IDC_HAND MAKEINTRESOURCE(32649) + # define FOF_NOERRORUI 0x0400 + #endif + +-#ifndef ULONG_PTR +-# define ULONG_PTR DWORD +-#endif ++//#ifndef ULONG_PTR ++//# define ULONG_PTR ULONG ++//#endif + + #ifndef IDC_HAND + # define IDC_HAND MAKEINTRESOURCE(32649) +Index: Source/Plugins.cpp +--- ../release/nsis-2.17-src/Source/Plugins.cpp 2006-04-05 11:42:12.000000000 -0700 ++++ ./Source/Plugins.cpp 2006-07-31 06:50:08.000000000 -0700 +@@ -120,8 +120,8 @@ + DWORD prd = FIX_ENDIAN_INT32(sections[i].PointerToRawData); + PIMAGE_EXPORT_DIRECTORY exports = PIMAGE_EXPORT_DIRECTORY(&dlldata[0] + prd + ExportDirVA - va); + DWORD na = FIX_ENDIAN_INT32(exports->AddressOfNames); +- unsigned long *names = (unsigned long*)((unsigned long) exports + (char *) na - ExportDirVA); +- for (unsigned long j = 0; j < FIX_ENDIAN_INT32(exports->NumberOfNames); j++) ++ unsigned int *names = (unsigned int*)((unsigned long) exports + (char *) na - ExportDirVA); ++ for (unsigned int j = 0; j < FIX_ENDIAN_INT32(exports->NumberOfNames); j++) + { + const string name = string((char*)exports + FIX_ENDIAN_INT32(names[j]) - ExportDirVA); + const string signature = dllName + "::" + name; Index: Source/ResourceEditor.cpp ---- ../nsis-2.17-src-rel/Source/ResourceEditor.cpp 2006-04-05 11:40:09.000000000 -0700 -+++ ./Source/ResourceEditor.cpp 2006-06-20 00:26:25.000000000 -0700 +--- ../release/nsis-2.17-src/Source/ResourceEditor.cpp 2006-04-05 11:40:09.000000000 -0700 ++++ ./Source/ResourceEditor.cpp 2006-07-31 05:48:44.000000000 -0700 @@ -545,7 +545,7 @@ - rdDir.NumberOfIdEntries = ConvertEndianness(rdDir.NumberOfIdEntries); - - CopyMemory(seeker, &rdDir, sizeof(IMAGE_RESOURCE_DIRECTORY)); -- crd->m_dwWrittenAt = DWORD(seeker); -+ crd->m_dwWrittenAt = ULONG_PTR(seeker); - seeker += sizeof(IMAGE_RESOURCE_DIRECTORY); - - for (int i = 0; i < crd->CountEntries(); i++) { + rdDir.NumberOfIdEntries = ConvertEndianness(rdDir.NumberOfIdEntries); + + CopyMemory(seeker, &rdDir, sizeof(IMAGE_RESOURCE_DIRECTORY)); +- crd->m_dwWrittenAt = DWORD(seeker); ++ crd->m_dwWrittenAt = ULONG_PTR(seeker); + seeker += sizeof(IMAGE_RESOURCE_DIRECTORY); + + for (int i = 0; i < crd->CountEntries(); i++) { @@ -566,7 +566,7 @@ - rDirE.NameString.NameIsString = (crd->GetEntry(i)->HasName()) ? 1 : 0; - - CopyMemory(seeker, &rDirE, sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY)); -- crd->GetEntry(i)->m_dwWrittenAt = DWORD(seeker); -+ crd->GetEntry(i)->m_dwWrittenAt = ULONG_PTR(seeker); - seeker += sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY); - } - qDirs.pop(); + rDirE.NameString.NameIsString = (crd->GetEntry(i)->HasName()) ? 1 : 0; + + CopyMemory(seeker, &rDirE, sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY)); +- crd->GetEntry(i)->m_dwWrittenAt = DWORD(seeker); ++ crd->GetEntry(i)->m_dwWrittenAt = ULONG_PTR(seeker); + seeker += sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY); + } + qDirs.pop(); @@ -582,7 +582,7 @@ - rDataE.Size = ConvertEndianness(cRDataE->GetSize()); - - CopyMemory(seeker, &rDataE, sizeof(IMAGE_RESOURCE_DATA_ENTRY)); -- cRDataE->m_dwWrittenAt = DWORD(seeker); -+ cRDataE->m_dwWrittenAt = ULONG_PTR(seeker); - seeker += sizeof(IMAGE_RESOURCE_DATA_ENTRY); - - qDataEntries.pop(); + rDataE.Size = ConvertEndianness(cRDataE->GetSize()); + + CopyMemory(seeker, &rDataE, sizeof(IMAGE_RESOURCE_DATA_ENTRY)); +- cRDataE->m_dwWrittenAt = DWORD(seeker); ++ cRDataE->m_dwWrittenAt = ULONG_PTR(seeker); + seeker += sizeof(IMAGE_RESOURCE_DATA_ENTRY); + + qDataEntries.pop(); @@ -594,7 +594,7 @@ - while (!qStrings.empty()) { - CResourceDirectoryEntry* cRDirE = qStrings.front(); - -- PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->NameString.NameOffset = ConvertEndianness(DWORD(seeker) - DWORD(pbRsrcSec)); -+ PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->NameString.NameOffset = ConvertEndianness(DWORD(ULONG_PTR(seeker) - ULONG_PTR(pbRsrcSec))); - - char* szName = cRDirE->GetName(); - WORD iLen = strlen(szName) + 1; + while (!qStrings.empty()) { + CResourceDirectoryEntry* cRDirE = qStrings.front(); + +- PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->NameString.NameOffset = ConvertEndianness(DWORD(seeker) - DWORD(pbRsrcSec)); ++ PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->NameString.NameOffset = ConvertEndianness(DWORD(ULONG_PTR(seeker) - ULONG_PTR(pbRsrcSec))); + + char* szName = cRDirE->GetName(); + WORD iLen = strlen(szName) + 1; @@ -626,7 +626,7 @@ - while (!qDataEntries2.empty()) { - CResourceDataEntry* cRDataE = qDataEntries2.front(); - CopyMemory(seeker, cRDataE->GetData(), cRDataE->GetSize()); -- PIMAGE_RESOURCE_DATA_ENTRY(cRDataE->m_dwWrittenAt)->OffsetToData = ConvertEndianness(seeker - pbRsrcSec + m_dwResourceSectionVA); -+ PIMAGE_RESOURCE_DATA_ENTRY(cRDataE->m_dwWrittenAt)->OffsetToData = ConvertEndianness(DWORD(seeker - pbRsrcSec + m_dwResourceSectionVA)); - - seeker += RALIGN(cRDataE->GetSize(), 8); - + while (!qDataEntries2.empty()) { + CResourceDataEntry* cRDataE = qDataEntries2.front(); + CopyMemory(seeker, cRDataE->GetData(), cRDataE->GetSize()); +- PIMAGE_RESOURCE_DATA_ENTRY(cRDataE->m_dwWrittenAt)->OffsetToData = ConvertEndianness(seeker - pbRsrcSec + m_dwResourceSectionVA); ++ PIMAGE_RESOURCE_DATA_ENTRY(cRDataE->m_dwWrittenAt)->OffsetToData = ConvertEndianness(DWORD(seeker - pbRsrcSec + m_dwResourceSectionVA)); + + seeker += RALIGN(cRDataE->GetSize(), 8); + @@ -636,7 +636,7 @@ - /* - * Set all of the directory entries offsets. - */ -- SetOffsets(m_cResDir, DWORD(pbRsrcSec)); -+ SetOffsets(m_cResDir, ULONG_PTR(pbRsrcSec)); - } - - // Sets the offsets in directory entries + /* + * Set all of the directory entries offsets. + */ +- SetOffsets(m_cResDir, DWORD(pbRsrcSec)); ++ SetOffsets(m_cResDir, ULONG_PTR(pbRsrcSec)); + } + + // Sets the offsets in directory entries @@ -650,7 +650,7 @@ - SetOffsets(resDir->GetEntry(i)->GetSubDirectory(), newResDirAt); - } - else { -- rde->OffsetToData = ConvertEndianness(resDir->GetEntry(i)->GetDataEntry()->m_dwWrittenAt - newResDirAt); -+ rde->OffsetToData = ConvertEndianness(DWORD(resDir->GetEntry(i)->GetDataEntry()->m_dwWrittenAt - newResDirAt)); - } - } - } + SetOffsets(resDir->GetEntry(i)->GetSubDirectory(), newResDirAt); + } + else { +- rde->OffsetToData = ConvertEndianness(resDir->GetEntry(i)->GetDataEntry()->m_dwWrittenAt - newResDirAt); ++ rde->OffsetToData = ConvertEndianness(DWORD(resDir->GetEntry(i)->GetDataEntry()->m_dwWrittenAt - newResDirAt)); + } + } + } @@ -758,7 +758,7 @@ - // Returns -1 if can not be found - int CResourceDirectory::Find(char* szName) { - if (IS_INTRESOURCE(szName)) -- return Find((WORD) (DWORD) szName); -+ return Find((WORD) (ULONG_PTR) szName); - else - if (szName[0] == '#') - return Find(WORD(atoi(szName + 1))); + // Returns -1 if can not be found + int CResourceDirectory::Find(char* szName) { + if (IS_INTRESOURCE(szName)) +- return Find((WORD) (DWORD) szName); ++ return Find((WORD) (ULONG_PTR) szName); + else + if (szName[0] == '#') + return Find(WORD(atoi(szName + 1))); @@ -836,7 +836,7 @@ - if (IS_INTRESOURCE(szName)) { - m_bHasName = false; - m_szName = 0; -- m_wId = (WORD) (DWORD) szName; -+ m_wId = (WORD) (ULONG_PTR) szName; - } - else { - m_bHasName = true; + if (IS_INTRESOURCE(szName)) { + m_bHasName = false; + m_szName = 0; +- m_wId = (WORD) (DWORD) szName; ++ m_wId = (WORD) (ULONG_PTR) szName; + } + else { + m_bHasName = true; @@ -851,7 +851,7 @@ - if (IS_INTRESOURCE(szName)) { - m_bHasName = false; - m_szName = 0; -- m_wId = (WORD) (DWORD) szName; -+ m_wId = (WORD) (ULONG_PTR) szName; - } - else { - m_bHasName = true; + if (IS_INTRESOURCE(szName)) { + m_bHasName = false; + m_szName = 0; +- m_wId = (WORD) (DWORD) szName; ++ m_wId = (WORD) (ULONG_PTR) szName; + } + else { + m_bHasName = true; Index: Source/ResourceEditor.h ---- ../nsis-2.17-src-rel/Source/ResourceEditor.h 2006-04-28 08:54:42.000000000 -0700 -+++ ./Source/ResourceEditor.h 2006-06-20 00:20:39.000000000 -0700 +--- ../release/nsis-2.17-src/Source/ResourceEditor.h 2006-04-28 08:54:42.000000000 -0700 ++++ ./Source/ResourceEditor.h 2006-07-31 05:48:44.000000000 -0700 @@ -173,7 +173,7 @@ - - void Destroy(); - -- DWORD m_dwWrittenAt; -+ ULONG_PTR m_dwWrittenAt; - - private: - IMAGE_RESOURCE_DIRECTORY m_rdDir; + + void Destroy(); + +- DWORD m_dwWrittenAt; ++ ULONG_PTR m_dwWrittenAt; + + private: + IMAGE_RESOURCE_DIRECTORY m_rdDir; @@ -197,7 +197,7 @@ - - CResourceDataEntry* GetDataEntry(); - -- DWORD m_dwWrittenAt; -+ ULONG_PTR m_dwWrittenAt; - - private: - bool m_bHasName; + + CResourceDataEntry* GetDataEntry(); + +- DWORD m_dwWrittenAt; ++ ULONG_PTR m_dwWrittenAt; + + private: + bool m_bHasName; @@ -226,7 +226,7 @@ - DWORD GetSize(); - DWORD GetCodePage(); - -- DWORD m_dwWrittenAt; -+ ULONG_PTR m_dwWrittenAt; - - private: - BYTE* m_pbData; + DWORD GetSize(); + DWORD GetCodePage(); + +- DWORD m_dwWrittenAt; ++ ULONG_PTR m_dwWrittenAt; + + private: + BYTE* m_pbData; +Index: Source/script.cpp +--- ../release/nsis-2.17-src/Source/script.cpp 2006-03-28 10:22:34.000000000 -0800 ++++ ./Source/script.cpp 2006-07-31 20:56:03.000000000 -0700 +@@ -4748,8 +4748,8 @@ + { + struct + { +- long l; +- long h; ++ int l; ++ int h; + } words; + long long ll; + }; +@@ -6075,8 +6075,8 @@ + { + struct + { +- long l; +- long h; ++ int l; ++ int h; + } words; + long long ll; + }; Index: Source/util.cpp ---- ../nsis-2.17-src-rel/Source/util.cpp 2006-04-28 08:54:42.000000000 -0700 -+++ ./Source/util.cpp 2006-06-20 00:41:16.000000000 -0700 +--- ../release/nsis-2.17-src/Source/util.cpp 2006-04-28 08:54:42.000000000 -0700 ++++ ./Source/util.cpp 2006-07-31 05:48:44.000000000 -0700 @@ -312,7 +312,7 @@ - FIX_ENDIAN_INT32_INPLACE(rdEntry.OffsetToData); - MY_ASSERT(!rdEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); - -- PRESOURCE_DIRECTORY rdIcons = PRESOURCE_DIRECTORY(rdEntry.DirectoryOffset.OffsetToDirectory + DWORD(rdRoot)); -+ PRESOURCE_DIRECTORY rdIcons = PRESOURCE_DIRECTORY(rdEntry.DirectoryOffset.OffsetToDirectory + ULONG_PTR(rdRoot)); - - MY_ASSERT((size_t)rdIcons - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); - + FIX_ENDIAN_INT32_INPLACE(rdEntry.OffsetToData); + MY_ASSERT(!rdEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); + +- PRESOURCE_DIRECTORY rdIcons = PRESOURCE_DIRECTORY(rdEntry.DirectoryOffset.OffsetToDirectory + DWORD(rdRoot)); ++ PRESOURCE_DIRECTORY rdIcons = PRESOURCE_DIRECTORY(rdEntry.DirectoryOffset.OffsetToDirectory + ULONG_PTR(rdRoot)); + + MY_ASSERT((size_t)rdIcons - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); + @@ -325,7 +325,7 @@ - FIX_ENDIAN_INT32_INPLACE(icoEntry.OffsetToData); - - MY_ASSERT(!icoEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); -- PRESOURCE_DIRECTORY rd = PRESOURCE_DIRECTORY(icoEntry.DirectoryOffset.OffsetToDirectory + DWORD(rdRoot)); -+ PRESOURCE_DIRECTORY rd = PRESOURCE_DIRECTORY(icoEntry.DirectoryOffset.OffsetToDirectory + ULONG_PTR(rdRoot)); - - MY_ASSERT((size_t)rd - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); - + FIX_ENDIAN_INT32_INPLACE(icoEntry.OffsetToData); + + MY_ASSERT(!icoEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); +- PRESOURCE_DIRECTORY rd = PRESOURCE_DIRECTORY(icoEntry.DirectoryOffset.OffsetToDirectory + DWORD(rdRoot)); ++ PRESOURCE_DIRECTORY rd = PRESOURCE_DIRECTORY(icoEntry.DirectoryOffset.OffsetToDirectory + ULONG_PTR(rdRoot)); + + MY_ASSERT((size_t)rd - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); + @@ -334,7 +334,7 @@ - - MY_ASSERT(datEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); - -- PIMAGE_RESOURCE_DATA_ENTRY rde = PIMAGE_RESOURCE_DATA_ENTRY(datEntry.OffsetToData + DWORD(rdRoot)); -+ PIMAGE_RESOURCE_DATA_ENTRY rde = PIMAGE_RESOURCE_DATA_ENTRY(datEntry.OffsetToData + ULONG_PTR(rdRoot)); - - MY_ASSERT((size_t)rde - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); - + + MY_ASSERT(datEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); + +- PIMAGE_RESOURCE_DATA_ENTRY rde = PIMAGE_RESOURCE_DATA_ENTRY(datEntry.OffsetToData + DWORD(rdRoot)); ++ PIMAGE_RESOURCE_DATA_ENTRY rde = PIMAGE_RESOURCE_DATA_ENTRY(datEntry.OffsetToData + ULONG_PTR(rdRoot)); + + MY_ASSERT((size_t)rde - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); + @@ -355,10 +355,10 @@ - } - - // Set offset -- DWORD dwOffset = FIX_ENDIAN_INT32(rde->OffsetToData) + DWORD(rdRoot) - dwResourceSectionVA - DWORD(exeHeader); -+ DWORD dwOffset = FIX_ENDIAN_INT32(rde->OffsetToData) + ULONG_PTR(rdRoot) - dwResourceSectionVA - ULONG_PTR(exeHeader); - *(LPDWORD) seeker = FIX_ENDIAN_INT32(dwOffset); - -- MY_ASSERT(dwOffset > exeHeaderSize || dwOffset < (DWORD)rdRoot - (DWORD)exeHeader, "invalid data offset - icon resource probably compressed"); -+ MY_ASSERT(dwOffset > exeHeaderSize || dwOffset < (ULONG_PTR)rdRoot - (ULONG_PTR)exeHeader, "invalid data offset - icon resource probably compressed"); - } - - LPBYTE seeker = uninstIconData; + } + + // Set offset +- DWORD dwOffset = FIX_ENDIAN_INT32(rde->OffsetToData) + DWORD(rdRoot) - dwResourceSectionVA - DWORD(exeHeader); ++ DWORD dwOffset = FIX_ENDIAN_INT32(rde->OffsetToData) + ULONG_PTR(rdRoot) - dwResourceSectionVA - ULONG_PTR(exeHeader); + *(LPDWORD) seeker = FIX_ENDIAN_INT32(dwOffset); + +- MY_ASSERT(dwOffset > exeHeaderSize || dwOffset < (DWORD)rdRoot - (DWORD)exeHeader, "invalid data offset - icon resource probably compressed"); ++ MY_ASSERT(dwOffset > exeHeaderSize || dwOffset < (ULONG_PTR)rdRoot - (ULONG_PTR)exeHeader, "invalid data offset - icon resource probably compressed"); + } + + LPBYTE seeker = uninstIconData; +Index: Source/writer.cpp +--- ../release/nsis-2.17-src/Source/writer.cpp 2006-03-11 03:13:07.000000000 -0800 ++++ ./Source/writer.cpp 2006-07-31 13:27:37.000000000 -0700 +@@ -64,7 +64,7 @@ + } + + #ifdef NSIS_CONFIG_CRC_SUPPORT +-extern "C" unsigned long NSISCALL CRC32(unsigned long crc, const unsigned char *buf, unsigned int len); ++extern "C" unsigned int NSISCALL CRC32(unsigned int crc, const unsigned char *buf, unsigned int len); + + void crc_writer_sink::write_data(const void *data, const size_t size) + { +Index: Source/writer.h +--- ../release/nsis-2.17-src/Source/writer.h 2006-03-11 03:13:07.000000000 -0800 ++++ ./Source/writer.h 2006-07-31 13:27:58.000000000 -0700 +@@ -57,12 +57,12 @@ + #ifdef NSIS_CONFIG_CRC_SUPPORT + class crc_writer_sink : public writer_sink { + public: +- crc_writer_sink(unsigned long *crc) : m_crc(crc) {} ++ crc_writer_sink(unsigned int *crc) : m_crc(crc) {} + + virtual void write_data(const void *data, const size_t size); + + private: +- unsigned long *m_crc; ++ unsigned int *m_crc; + + }; + #endif diff --git a/bacula/src/win32/patches/wx.patch b/bacula/src/win32/patches/wx.patch index 268497ffe0..04af98c229 100644 --- a/bacula/src/win32/patches/wx.patch +++ b/bacula/src/win32/patches/wx.patch @@ -35,3 +35,25 @@ # Should debugging info be included in the executables? The default value # "default" means that debug info will be included if BUILD=debug +--- ../release/wxWidgets-2.6.3/include/wx/string.h 2005-12-15 11:26:27.000000000 -0800 ++++ ./include/wx/string.h 2006-07-31 20:50:32.000000000 -0700 +@@ -229,7 +229,7 @@ + #endif + // VC++ free must take place in same DLL as allocation when using non dll + // run-time library (e.g. Multithreaded instead of Multithreaded DLL) +-#if defined(__VISUALC__) && defined(_MT) && !defined(_DLL) ++#if 1 || defined(__VISUALC__) && defined(_MT) && !defined(_DLL) + void Unlock() { if ( !IsEmpty() && --nRefs == 0) Free(); } + // we must not inline deallocation since allocation is not inlined + void Free(); +--- ../release/wxWidgets-2.6.3/src/common/string.cpp 2005-11-30 05:30:08.000000000 -0800 ++++ ./src/common/string.cpp 2006-07-31 20:48:53.000000000 -0700 +@@ -172,7 +172,7 @@ + // wxStringData class deallocation + // =========================================================================== + +-#if defined(__VISUALC__) && defined(_MT) && !defined(_DLL) ++#if 1 || defined(__VISUALC__) && defined(_MT) && !defined(_DLL) + # pragma message (__FILE__ ": building with Multithreaded non DLL runtime has a performance impact on wxString!") + void wxStringData::Free() + { diff --git a/bacula/src/win32/wx-console/filelist b/bacula/src/win32/wx-console/filelist deleted file mode 100644 index da2a6cbc21..0000000000 --- a/bacula/src/win32/wx-console/filelist +++ /dev/null @@ -1,60 +0,0 @@ -..\lib\address_conf -..\lib\alist -..\lib\alloc -..\lib\attr -..\lib\base64 -..\lib\berrno -..\lib\bget_msg -..\lib\bnet -..\lib\bnet_server -..\lib\bshm -..\lib\bsys -..\lib\btime -..\lib\cram-md5 -..\lib\crc32 -..\lib\crypto -..\lib\daemon -..\lib\dlist -..\lib\edit -..\lib\fnmatch -..\lib\hmac -..\lib\htable -..\lib\idcache -..\lib\jcr -..\lib\lex -..\lib\md5 -..\lib\mem_pool -..\lib\message -..\lib\parse_conf -..\lib\queue -..\lib\res -..\lib\rwlock -..\lib\scan -..\lib\semlock -..\lib\serial -..\lib\sha1 -..\lib\signal -..\lib\smartall -..\lib\btimers -..\lib\tls -..\lib\tree -..\lib\util -..\lib\var -..\lib\watchdog -..\lib\winapi -..\lib\workq -..\compat\compat -..\compat\print -.\authenticate -.\console_conf -..\..\wx-console\console_thread -..\..\wx-console\main -..\..\wx-console\wxblistctrl -..\..\wx-console\wxbmainframe -..\..\wx-console\wxbrestorepanel -..\..\wx-console\wxbtableparser -..\..\wx-console\wxbtreectrl -..\..\wx-console\wxbutils -..\..\wx-console\wxbconfigpanel -..\..\wx-console\wxbconfigfileeditor -..\..\wx-console\wxbhistorytextctrl diff --git a/bacula/src/win32/wx-console/genmake.sh b/bacula/src/win32/wx-console/genmake.sh deleted file mode 100644 index d8e10acf8b..0000000000 --- a/bacula/src/win32/wx-console/genmake.sh +++ /dev/null @@ -1,16 +0,0 @@ -rm wx-console.mak -sed -e 's/^\(.*\)\\\(.*\)$/FILENAME=\2\nSOURCE=\1\\\2.cpp\n@@OBJMAKIN@@\n/g' filelist > objtargets1.tmp -sed -e '/@@OBJMAKIN@@/r wx-console-obj.mak.in' -e '/@@OBJMAKIN@@/d' objtargets1.tmp > objtargets.tmp -sed -e 's/^\(.*\)\\\(.*\)$/\t-@erase "\$(INTDIR)\\\2.obj"/g' filelist > relclean.tmp -sed -e 's/^\(.*\)\\\(.*\)$/\t"\$(INTDIR)\\\2.obj" \\/g' filelist > relobjs.tmp -sed -e 's/^\(.*\)\\\(.*\)$/\t-@erase "\$(INTDIR)\\\2.obj\n\t-@erase "\$(INTDIR)\\\2.sbr"/g' filelist > debclean.tmp -sed -e 's/^\(.*\)\\\(.*\)$/\t"\$(INTDIR)\\\2.obj" \\/g' filelist > debobjs.tmp -sed -e 's/^\(.*\)\\\(.*\)$/\t"\$(INTDIR)\\\2.sbr" \\/g' filelist > debsbrs.tmp -sed -e '/@@OBJTARGETS@@/r objtargets.tmp' -e '/@@OBJTARGETS@@/d' \ - -e '/@@REL-CLEAN@@/r relclean.tmp' -e '/@@REL-CLEAN@@/d' \ - -e '/@@REL-OBJS@@/r relobjs.tmp' -e '/@@REL-OBJS@@/d' \ - -e '/@@DEB-CLEAN@@/r debclean.tmp' -e '/@@DEB-CLEAN@@/d' \ - -e '/@@DEB-OBJS@@/r debobjs.tmp' -e '/@@DEB-OBJS@@/d' \ - -e '/@@DEB-SBRS@@/r debsbrs.tmp' -e '/@@DEB-SBRS@@/d' \ - wx-console.mak.in > wx-console.mak -rm *.tmp \ No newline at end of file -- 2.39.2