* Master/nsis.make: Generalize to install in other than Applications.

* Master/rules.make: Remove nsis include for now
* nsi-app.template, Documentation/make.texi: updates.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@25771 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2007-12-20 16:42:38 +00:00
parent e196fe254d
commit 7783e60fdb
5 changed files with 61 additions and 73 deletions

View file

@ -1,3 +1,9 @@
2007-12-20 Adam Fedor <fedor@gnu.org>
* Master/nsis.make: Generalize to install in other than Applications.
* Master/rules.make: Remove nsis include for now
* nsi-app.template, Documentation/make.texi: updates.
2007-12-20 Nicola Pero <nicola.pero@meta-innovation.com> 2007-12-20 Nicola Pero <nicola.pero@meta-innovation.com>
* configure.ac: Emit a warning if GNUSTEP_MAKEFILES contains a * configure.ac: Emit a warning if GNUSTEP_MAKEFILES contains a

View file

@ -171,7 +171,7 @@ build using static libraries instead, as in the above command.
Projects are divided into different types described below. To create a Projects are divided into different types described below. To create a
project of a specific type, just include the particular makefile. For project of a specific type, just include the particular makefile. For
example, to create an application, include this line in your make make example, to create an application, include this line in your main make
file: file:
@example @example
@ -486,13 +486,18 @@ on for most targets and into -F../MyPath flag for apple-apple-apple.
@subsection NSIS Installer (@file{nsis.make}) @subsection NSIS Installer (@file{nsis.make})
The NSIS make project provides rules for automatically generating NSIS The NSIS make project provides rules for automatically generating NSIS
installers for Windows operating systems. You don't need to do anything installers for Windows operating systems. In order to get this functionality,
to take advantage of this - it is included automatically by the make system. include @file{Master/nsis.make} from the Makefiles directory in your
GNUmakefile.
@example
include $(GNUSTEP_MAKEFILES)/Master/nsis.make
@end example
To create an installer file by itself, run @code{make nsifile}. To To create an installer file by itself, run @code{make nsifile}. To
create the full installer executable, run @code{make nsis}. Note that in create the full installer executable, run @code{make nsis}. Note that in
order to do this, you must be either running on a Windows computer with order to do this, you must be either running on a Windows computer with
a release of the NSIS compiler (from @url{nsis.sourceforge.net}) or you a release of the NSIS compiler (from @url{http://nsis.sourceforge.net}) or you
need to be using a cross-compiler and cross-compiled NSIS script compiler. need to be using a cross-compiler and cross-compiled NSIS script compiler.
(NOTE: This does not currently work - you need to use the GUI NSIS compiler (NOTE: This does not currently work - you need to use the GUI NSIS compiler
to compile the installer scripts). to compile the installer scripts).
@ -504,6 +509,7 @@ template with customized script instructions by creating a file called
@file{PACKAGE_NAME.nsi.in}, where @code{PACKAGE_NAME} is the same as the @file{PACKAGE_NAME.nsi.in}, where @code{PACKAGE_NAME} is the same as the
name of your package (see below). name of your package (see below).
You also need to define several variables in your main make file.
Except for @code{PACKAGE_NAME}, which is required, all the following Except for @code{PACKAGE_NAME}, which is required, all the following
variables are optional. variables are optional.

View file

@ -52,98 +52,77 @@
# in your makefile. # in your makefile.
MAKENSIS=makensis MAKENSIS=makensis
# These are the GNUstep Installer locations, so we need to match these # the GNUstep Windows Installer always puts things in, e.g. /GNUstep/System,
# regardless of the local directories # so we need to match these regardless of the local filesystem layout
NSI_SYSTEM_ROOT=\\\\GNUstep\\\\System # Hackish way to get the installation dir/domain
NSI_LOCAL_ROOT=\\\\GNUstep\\\\Local NSI_DOMAIN=System
#FIXME: What should this be?
NSI_USER_ROOT=\\\\GNUstep\\\\Local
NSI_DOMAIN=$(NSI_SYSTEM_ROOT)
ifeq ($(GNUSTEP_INSTALLATION_DOMAIN), LOCAL) ifeq ($(GNUSTEP_INSTALLATION_DOMAIN), LOCAL)
NSI_DOMAIN=$(NSI_LOCAL_ROOT) NSI_DOMAIN=Local
endif endif
# FIXME: What should this be on Windows?
ifeq ($(GNUSTEP_INSTALLATION_DOMAIN), USER) ifeq ($(GNUSTEP_INSTALLATION_DOMAIN), USER)
NSI_DOMAIN=$(NSI_USER_ROOT) NSI_DOMAIN=Local
endif endif
NSI_BASE=$(dir $(GNUSTEP_APPS))
ABS_OBJ_DIR=$(shell (cd "$(GNUSTEP_BUILD_DIR)"; pwd))/obj
# GNUSTEP_FILE_LIST = $(ABS_OBJ_DIR)/package/file-list
# Internal targets GNUSTEP_DELETE_LIST = $(ABS_OBJ_DIR)/package/delete-list
# GNUSTEP_RMDIR_LIST = $(ABS_OBJ_DIR)/package/rmdir-list
REL_INSTALL_DIR=$(GNUSTEP_OBJ_DIR)/package/$(NSI_BASE)
# If we have been called with something like
#
# make DESTDIR=/var/tmp/package-build nsilist=yes install
#
# we are being called inside the nsis installation stage, and we need
# to produce the file list from the installed files.
#
GNUSTEP_FILE_LIST = $(GNUSTEP_OBJ_DIR)/file-list
GNUSTEP_DELETE_LIST = $(GNUSTEP_OBJ_DIR)/delete-list
GNUSTEP_RMDIR_LIST = $(GNUSTEP_OBJ_DIR)/rmdir-list
NSI_FILE_NAME=$(PACKAGE_NAME).nsi NSI_FILE_NAME=$(PACKAGE_NAME).nsi
;NSI_FILE=$(GNUSTEP_OBJ_DIR)/$(NSI_FILE_NAME)
NSI_FILE=$(NSI_FILE_NAME) NSI_FILE=$(NSI_FILE_NAME)
ifneq ($(APP_NAME),) ifneq ($(APP_NAME),)
NSI_TEMPLATE=$(GNUSTEP_MAKEFILES)/nsi-app.template NSI_TEMPLATE=$(GNUSTEP_MAKEFILES)/nsi-app.template
NSI_INSTALL_DIR=$(GNUSTEP_APPS)
else else
NSI_TEMPLATE= NSI_TEMPLATE=
endif endif
NSI_IN=$(PACKAGE_NAME).nsi.in NSI_IN=$(PACKAGE_NAME).nsi.in
ifeq ($(nsilist),yes) .PHONY: nsifile nsis nsis_package_install nsis_build_filelist
# Remove the old file list before installing, and initialize the new one.
before-install:: $(GNUSTEP_OBJ_DIR) nsis_package_install:
$(ECHO_NOTHING)if [ -d $(ABS_OBJ_DIR)/package ]; then \
rm -rf $(ABS_OBJ_DIR)/package; fi;$(END_ECHO)
$(ECHO_NOTHING)$(MAKE) DESTDIR=$(ABS_OBJ_DIR)/package nsilist=yes install$(END_ECHO)
#
# Target to build up the file lists
#
nsis_build_filelist::
$(ECHO_NOTHING)rm -f $(GNUSTEP_FILE_LIST)$(END_ECHO) $(ECHO_NOTHING)rm -f $(GNUSTEP_FILE_LIST)$(END_ECHO)
$(ECHO_NOTHING)rm -f $(GNUSTEP_DELETE_LIST)$(END_ECHO) $(ECHO_NOTHING)rm -f $(GNUSTEP_DELETE_LIST)$(END_ECHO)
$(ECHO_NOTHING)rm -f $(GNUSTEP_RMDIR_LIST)$(END_ECHO) $(ECHO_NOTHING)rm -f $(GNUSTEP_RMDIR_LIST)$(END_ECHO)
# Get the list of files inside DESTDIR
internal-after-install::
$(ECHO_NOTHING)cdir="nosuchdirectory"; \ $(ECHO_NOTHING)cdir="nosuchdirectory"; \
for file in `$(TAR) Pcf - $(NSI_INSTALL_DIR) | $(TAR) t`; do \ for file in `$(TAR) Pcf - $(REL_INSTALL_DIR) | $(TAR) t`; do \
wfile=`echo $$file | sed "s,$(NSI_INSTALL_DIR),," | tr '/' '\'`; \ wfile=`echo $$file | sed "s,$(REL_INSTALL_DIR),," | tr '/' '\'`; \
wodir=`echo $(NSI_INSTALL_DIR) | tr '/' '\'`; \ wodir=`echo $(REL_INSTALL_DIR) | tr '/' '\'`; \
slashsuffix=`basename $${file}yes`; \ slashsuffix=`basename $${file}yes`; \
if [ "$$slashsuffix" = yes ]; then \ if [ "$$slashsuffix" = yes ]; then \
newdir=`dirname $$file`/`basename $$file`; \ newdir=`dirname $$file`/`basename $$file`; \
else \ else \
newdir=`dirname $$file`; \ newdir=`dirname $$file`; \
fi; \ fi; \
if [ "$$file" = "$(NSI_INSTALL_DIR)/" ]; then \ if [ "$$file" = "$(REL_INSTALL_DIR)/" ]; then \
:; \ :; \
elif [ -d "$$file" ]; then \ elif [ -d "$$file" ]; then \
cdir=$$newdir; \ cdir=$$newdir; \
echo " RMDir \"\$$APPSDIR$$wfile\"" >> $(GNUSTEP_RMDIR_LIST); \ echo " RMDir \"\$$DOMDIR\\$$wfile\"" >> $(GNUSTEP_RMDIR_LIST); \
echo " SetOutPath \"\$$APPSDIR$$wfile\"" >> $(GNUSTEP_FILE_LIST); \ echo " SetOutPath \"\$$DOMDIR\\$$wfile\"" >> $(GNUSTEP_FILE_LIST); \
elif [ $$cdir != $$newdir ]; then \ elif [ $$cdir != $$newdir ]; then \
cdir=$$newdir; \ cdir=$$newdir; \
wdir=`dirname $$file`; \ wdir=`dirname $$file`; \
wdir=`echo $$wdir | sed "s,$(NSI_INSTALL_DIR),," | tr '/' '\'`; \ wdir=`echo $$wdir | sed "s,$(REL_INSTALL_DIR),," | tr '/' '\'`; \
echo " SetOutPath \"\$$APPSDIR$$wdir\"" >> $(GNUSTEP_FILE_LIST); \ echo " SetOutPath \"\$$DOMDIR\\$$wdir\"" >> $(GNUSTEP_FILE_LIST); \
echo " File \"$$wodir$$wfile\"" >> $(GNUSTEP_FILE_LIST); \ echo " File \"$$wodir$$wfile\"" >> $(GNUSTEP_FILE_LIST); \
echo " Delete \"\$$APPSDIR$$wfile\"" >> $(GNUSTEP_DELETE_LIST); \ echo " Delete \"\$$DOMDIR\\$$wfile\"" >> $(GNUSTEP_DELETE_LIST); \
else \ else \
echo " Delete \"\$$APPSDIR$$wfile\"" >> $(GNUSTEP_DELETE_LIST); \ echo " Delete \"\$$DOMDIR\\$$wfile\"" >> $(GNUSTEP_DELETE_LIST); \
echo " File \"$$wodir$$wfile\"" >> $(GNUSTEP_FILE_LIST); \ echo " File \"$$wodir$$wfile\"" >> $(GNUSTEP_FILE_LIST); \
fi; \ fi; \
done$(END_ECHO) done$(END_ECHO)
endif # nsilist == yes
# NB: The nsilist is automatically deleted when GNUSTEP_OBJ_DIR is
# deleted (that is, by make clean)
.PHONY: nsifile nsis nsis_package_install
nsis_package_install:
$(ECHO_NOTHING)if [ -d $(GNUSTEP_OBJ_DIR)/package ]; then \
rm -rf $(GNUSTEP_OBJ_DIR)/package; fi$(END_ECHO)
$(ECHO_NOTHING)$(MKDIRS) $(GNUSTEP_OBJ_DIR)/package$(END_ECHO)
$(ECHO_NOTHING)$(MAKE) DESTDIR=$(GNUSTEP_OBJ_DIR)/package nsilist=yes install$(END_ECHO)
# #
# The user will type `make nsifile' to generate the nsifile # The user will type `make nsifile' to generate the nsifile
# #
@ -152,7 +131,7 @@ nsifile: $(NSI_FILE)
# #
# This is the real target # This is the real target
# #
$(NSI_FILE): $(GNUSTEP_OBJ_DIR) nsis_package_install $(NSI_FILE): nsis_package_install nsis_build_filelist
$(ECHO_NOTHING)echo "Generating the nsi script..."$(END_ECHO) $(ECHO_NOTHING)echo "Generating the nsi script..."$(END_ECHO)
$(ECHO_NOTHING)rm -f $@$(END_ECHO) $(ECHO_NOTHING)rm -f $@$(END_ECHO)
$(ECHO_NOTHING)rm -f ${GNUSTEP_RMDIR_LIST}.reverse$(END_ECHO) $(ECHO_NOTHING)rm -f ${GNUSTEP_RMDIR_LIST}.reverse$(END_ECHO)
@ -175,5 +154,5 @@ $(NSI_FILE): $(GNUSTEP_OBJ_DIR) nsis_package_install
$(END_ECHO) $(END_ECHO)
nsis: nsifile nsis: nsifile
;$(ECHO_NOTHING)echo "Generating the nsis installer..."$(END_ECHO) # $(ECHO_NOTHING)echo "Generating the nsis installer..."$(END_ECHO)
;${MAKENSIS} $(NSI_FILE_NAME) # ${MAKENSIS} $(NSI_FILE_NAME)

View file

@ -435,10 +435,3 @@ include $(GNUSTEP_MAKEFILES)/Master/rpm.make
# #
#include $(GNUSTEP_MAKEFILES)/Master/deb.make <TODO> #include $(GNUSTEP_MAKEFILES)/Master/deb.make <TODO>
#
# Rules for building NSIS installers
#
# TODO: Is it worth including this only on MS Windows ?
#
include $(GNUSTEP_MAKEFILES)/Master/nsis.make

View file

@ -32,6 +32,8 @@ var ICONS_GROUP
; Instfiles page ; Instfiles page
!insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_INSTFILES
; Finish page ; Finish page
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN "$INSTDIR\GNUstep\@gs_domain@\Applications\${PRODUCT_NAME}.app\${PRODUCT_NAME}.exe"
!insertmacro MUI_PAGE_FINISH !insertmacro MUI_PAGE_FINISH
; Uninstaller pages ; Uninstaller pages
@ -51,21 +53,23 @@ InstallDir "C:\GNUstep"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show ShowInstDetails show
ShowUnInstDetails show ShowUnInstDetails show
Var APPSDIR Var DOMDIR
Section "Main" SEC01 Section "Main" SEC01
SetOverwrite try SetOverwrite try
StrCpy $APPSDIR "$INSTDIR@gs_domain@\Applications" StrCpy $DOMDIR "$INSTDIR\GNUstep\@gs_domain@"
;@file_list@ ;@file_list@
SectionEnd SectionEnd
Section Uninstall Section Uninstall
StrCpy $APPSDIR "$INSTDIR@gs_domain@\Applications" StrCpy $DOMDIR "$INSTDIR\GNUstep\@gs_domain@"
;@delete_list@ ;@delete_list@
;@rmdir_list@ ;@rmdir_list@
Delete "$INSTDIR\Uninstall${PRODUCT_NAME}.exe" Delete "$INSTDIR\Uninstall${PRODUCT_NAME}.exe"
!insertmacro MUI_STARTMENU_GETFOLDER Application $ICONS_GROUP
Delete "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME}.lnk" Delete "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME}.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall\Uninstall${PRODUCT_NAME}.lnk"
RMDir "$SMPROGRAMS\$ICONS_GROUP\Uninstall" RMDir "$SMPROGRAMS\$ICONS_GROUP\Uninstall"
RMDir "$SMPROGRAMS\$ICONS_GROUP" RMDir "$SMPROGRAMS\$ICONS_GROUP"
@ -77,7 +81,7 @@ Section -AdditionalIcons
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP" CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Uninstall" CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Uninstall"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME}.lnk" "$APPSDIR\${PRODUCT_NAME}.app\${PRODUCT_NAME}.exe" CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME}.lnk" "$DOMDIR\Applications\${PRODUCT_NAME}.app\${PRODUCT_NAME}.exe"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall\Uninstall${PRODUCT_NAME}.lnk" "$INSTDIR\Uninstall${PRODUCT_NAME}.exe" CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall\Uninstall${PRODUCT_NAME}.lnk" "$INSTDIR\Uninstall${PRODUCT_NAME}.exe"
!insertmacro MUI_STARTMENU_WRITE_END !insertmacro MUI_STARTMENU_WRITE_END
SectionEnd SectionEnd