2006-07-26 Steve Hall <digitect@mindspring.org>
* windows/nsis/gramps-build.bat: Add windows building scripts. * windows/nsis/gramps.nsi: Add windows building scripts. * windows/nsis/gcheck.py: Add windows building scripts. * windows/nsis/ped24.ico: Add windows icon. svn: r7082
This commit is contained in:
		@@ -1,3 +1,9 @@
 | 
				
			|||||||
 | 
					2006-07-26  Steve Hall  <digitect@mindspring.org>
 | 
				
			||||||
 | 
						* windows/nsis/gramps-build.bat: Add windows building scripts.
 | 
				
			||||||
 | 
						* windows/nsis/gramps.nsi: Add windows building scripts.
 | 
				
			||||||
 | 
						* windows/nsis/gcheck.py: Add windows building scripts.
 | 
				
			||||||
 | 
						* windows/nsis/ped24.ico: Add windows icon.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
2006-07-26  Alex Roitman  <shura@gramps-project.org>
 | 
					2006-07-26  Alex Roitman  <shura@gramps-project.org>
 | 
				
			||||||
	* configure.in: Remove debian/Makefile from the list.
 | 
						* configure.in: Remove debian/Makefile from the list.
 | 
				
			||||||
	* Makefile.am (SUBDIRS): Remove debian from the list.
 | 
						* Makefile.am (SUBDIRS): Remove debian from the list.
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										33
									
								
								gramps2/windows/nsis/gcheck.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								gramps2/windows/nsis/gcheck.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
				
			|||||||
 | 
					import sys
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fn = sys.argv[1]
 | 
				
			||||||
 | 
					f = open(fn,"w")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					f.write('[tests]\n')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					try:
 | 
				
			||||||
 | 
					    import gtk
 | 
				
			||||||
 | 
					    f.write('gtk=yes\n')
 | 
				
			||||||
 | 
					    f.write('gtkver=%d.%d.%d\n' % gtk.gtk_version)
 | 
				
			||||||
 | 
					    f.write('pygtk=yes\n')
 | 
				
			||||||
 | 
					    f.write('pygtkver=%d.%d.%d\n' % gtk.pygtk_version)
 | 
				
			||||||
 | 
					except ImportError:
 | 
				
			||||||
 | 
					    f.write('gtk=no\n')
 | 
				
			||||||
 | 
					    f.write('gtkver=no\n')
 | 
				
			||||||
 | 
					    f.write('pygtk=no\n')
 | 
				
			||||||
 | 
					    f.write('pygtkver=no\n')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					try:
 | 
				
			||||||
 | 
					    import gtk.glade
 | 
				
			||||||
 | 
					    f.write('glade=yes\n')
 | 
				
			||||||
 | 
					except ImportError:
 | 
				
			||||||
 | 
					    f.write('glade=no\n')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					try:
 | 
				
			||||||
 | 
					    import cairo
 | 
				
			||||||
 | 
					    f.write('pycairo=yes\n')
 | 
				
			||||||
 | 
					    f.write('pycairover=%s\n' % cairo.version_info)
 | 
				
			||||||
 | 
					except ImportError:
 | 
				
			||||||
 | 
					    f.write('pycairo=no\n')
 | 
				
			||||||
 | 
					    f.write('pycairover=no\n')
 | 
				
			||||||
 | 
					f.close()
 | 
				
			||||||
							
								
								
									
										352
									
								
								gramps2/windows/nsis/gramps-build.bat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										352
									
								
								gramps2/windows/nsis/gramps-build.bat
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,352 @@
 | 
				
			|||||||
 | 
					@echo off
 | 
				
			||||||
 | 
					rem
 | 
				
			||||||
 | 
					rem Filename: gramps-build.bat
 | 
				
			||||||
 | 
					rem Author:   Steve Hall  [ digitect dancingpaper com ]
 | 
				
			||||||
 | 
					rem Date:     (See timestamp in :CHOOSE)
 | 
				
			||||||
 | 
					rem
 | 
				
			||||||
 | 
					rem Documentation
 | 
				
			||||||
 | 
					rem License {{{1
 | 
				
			||||||
 | 
					rem --------
 | 
				
			||||||
 | 
					rem This program is free software;  you  can  redistribute  it  and/or
 | 
				
			||||||
 | 
					rem modify it under the terms of the GNU  General  Public  License  as
 | 
				
			||||||
 | 
					rem published by the Free Software Foundation; either version 2 of the
 | 
				
			||||||
 | 
					rem License, or (at your option) any later version.
 | 
				
			||||||
 | 
					rem [ http://www.gnu.org/licenses/gpl.html ]
 | 
				
			||||||
 | 
					rem
 | 
				
			||||||
 | 
					rem This program is distributed in the hope that it  will  be  useful,
 | 
				
			||||||
 | 
					rem but WITHOUT ANY WARRANTY; without even  the  implied  warranty  of
 | 
				
			||||||
 | 
					rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See  the  GNU
 | 
				
			||||||
 | 
					rem General Public License for more details.
 | 
				
			||||||
 | 
					rem
 | 
				
			||||||
 | 
					rem You should have received a copy of the GNU General Public  License
 | 
				
			||||||
 | 
					rem along with this program;  if  not,  write  to  the  Free  Software
 | 
				
			||||||
 | 
					rem Foundation,  Inc.,  59  Temple  Place  -  Suite  330,  Boston,  MA
 | 
				
			||||||
 | 
					rem 02111-1307, USA.
 | 
				
			||||||
 | 
					rem
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem Usage {{{1
 | 
				
			||||||
 | 
					rem ------
 | 
				
			||||||
 | 
					rem This script automates the build process and creation of an
 | 
				
			||||||
 | 
					rem installer as much as possible, downloading sources and making
 | 
				
			||||||
 | 
					rem assumptions where necessary. To use it, the following are
 | 
				
			||||||
 | 
					rem required:
 | 
				
			||||||
 | 
					rem
 | 
				
			||||||
 | 
					rem o Windows NT/2K/XP (we no longer support 95/98/ME)
 | 
				
			||||||
 | 
					rem
 | 
				
			||||||
 | 
					rem o These GNU tools on path:
 | 
				
			||||||
 | 
					rem     - gzip/gunzip
 | 
				
			||||||
 | 
					rem     - tar (GNU version >= 1.13.10)
 | 
				
			||||||
 | 
					rem     - sed
 | 
				
			||||||
 | 
					rem     - wget
 | 
				
			||||||
 | 
					rem
 | 
				
			||||||
 | 
					rem o The Nullsoft Installer.
 | 
				
			||||||
 | 
					rem
 | 
				
			||||||
 | 
					rem o Adjust the variables in :ENVIRONMENT (below) to fit your
 | 
				
			||||||
 | 
					rem   preferences and installation conditions.
 | 
				
			||||||
 | 
					rem
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem 1}}}
 | 
				
			||||||
 | 
					rem Initialization
 | 
				
			||||||
 | 
					rem Version and Personal Environment (*** FIX ME!! ***) {{{1
 | 
				
			||||||
 | 
					echo -----------------------------------------------------------------
 | 
				
			||||||
 | 
					echo Version and Personal environment...
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem *****************************************************
 | 
				
			||||||
 | 
					rem *  MAKE ALL ADJUSTMENTS IN THIS SECTION!            *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem version (also used for location
 | 
				
			||||||
 | 
						set VERSION=2
 | 
				
			||||||
 | 
						set VERSIONSUB=1
 | 
				
			||||||
 | 
						set VERSIONPT=90
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem path to Nullsoft Installer (NSIS)
 | 
				
			||||||
 | 
						set NSIS=C:\PROGRA~1\NSIS
 | 
				
			||||||
 | 
					rem path to Nullsoft customized files
 | 
				
			||||||
 | 
						set NSISFIXES=C:\DOCUME~1\HALLS~1.PER\_seh\devel\gramps
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem *  END OF ADJUSTMENTS SECTION                        *
 | 
				
			||||||
 | 
					rem ******************************************************
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem Initial Environment {{{1
 | 
				
			||||||
 | 
					echo -----------------------------------------------------------------
 | 
				
			||||||
 | 
					echo Initial environment...
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem force Win NT/2K/XP
 | 
				
			||||||
 | 
						if not "%OS%"=="Windows_NT" echo  Windows NT/2K/XP required, unable to continue.
 | 
				
			||||||
 | 
						if not "%OS%"=="Windows_NT" goto QUIT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem program name
 | 
				
			||||||
 | 
						set PROG=gramps
 | 
				
			||||||
 | 
					rem save system PATH
 | 
				
			||||||
 | 
						set PATHORIG=%PATH%
 | 
				
			||||||
 | 
					rem set build path (location of this file and tarball)
 | 
				
			||||||
 | 
						set BUILDPATH=%CD%
 | 
				
			||||||
 | 
					rem cat for general filename
 | 
				
			||||||
 | 
						set VERSIONNAME=%PROG%-%VERSION%.%VERSIONSUB%.%VERSIONPT%
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem Verify {{{1
 | 
				
			||||||
 | 
					echo -----------------------------------------------------------------
 | 
				
			||||||
 | 
					echo Verifying environment and utilities available...
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo   %%BUILDPATH%%         : %BUILDPATH%
 | 
				
			||||||
 | 
					echo   %%VERSIONNAME%%       : %VERSIONNAME%
 | 
				
			||||||
 | 
					echo   %%NSIS%%              : %NSIS%
 | 
				
			||||||
 | 
					echo   %%NSISFIXES%%         : %NSISFIXES%
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem date
 | 
				
			||||||
 | 
						for /F "TOKENS=1* DELIMS= " %%A in ('date/t') do set MYDAYNAME=%%A
 | 
				
			||||||
 | 
						for /F "TOKENS=2* DELIMS= " %%A in ('date/t') do set MYMDY=%%A
 | 
				
			||||||
 | 
						for /f "TOKENS=3* DELIMS=/" %%A in ('echo %MYMDY%') do set MYYEAR=%%A
 | 
				
			||||||
 | 
						for /f "TOKENS=1* DELIMS=/" %%A in ('echo %MYMDY%') do set MYMONTH=%%A
 | 
				
			||||||
 | 
						for /f "TOKENS=2* DELIMS=/" %%A in ('echo %MYMDY%') do set MYDAY=%%A
 | 
				
			||||||
 | 
					rem time
 | 
				
			||||||
 | 
						for /F "TOKENS=1* DELIMS=:" %%A in ('time/t') do set MYHOUR=%%A
 | 
				
			||||||
 | 
						for /F "TOKENS=2* DELIMS=: " %%A in ('time/t') do set MYMINUTE=%%A
 | 
				
			||||||
 | 
					echo   Date                : %MYYEAR%-%MYMONTH%-%MYDAY%
 | 
				
			||||||
 | 
					echo   Time                : %MYHOUR%:%MYMINUTE%
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						set TRY=gzip.exe
 | 
				
			||||||
 | 
						for %%A in (%TRY%) do set YES=%%~$PATH:A
 | 
				
			||||||
 | 
						if "%YES%"=="" goto UTILHALT
 | 
				
			||||||
 | 
					echo   Found %TRY%...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						set TRY=gunzip.exe
 | 
				
			||||||
 | 
						for %%A in (%TRY%) do set YES=%%~$PATH:A
 | 
				
			||||||
 | 
						if "%YES%"=="" goto UTILHALT
 | 
				
			||||||
 | 
					echo   Found %TRY%...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						set TRY=sed.exe
 | 
				
			||||||
 | 
						for %%A in (%TRY%) do set YES=%%~$PATH:A
 | 
				
			||||||
 | 
						if "%YES%"=="" goto UTILHALT
 | 
				
			||||||
 | 
					echo   Found %TRY%...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						set TRY=tar.exe
 | 
				
			||||||
 | 
						for %%A in (%TRY%) do set YES=%%~$PATH:A
 | 
				
			||||||
 | 
						if "%YES%"=="" goto UTILHALT
 | 
				
			||||||
 | 
					echo   Found %TRY%...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						set TRY=wget.exe
 | 
				
			||||||
 | 
						for %%A in (%TRY%) do set YES=%%~$PATH:A
 | 
				
			||||||
 | 
						if "%YES%"=="" goto UTILHALT
 | 
				
			||||||
 | 
					echo   Found %TRY%...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
						set /P CH=Continue? [Y/N]  
 | 
				
			||||||
 | 
						if /I "%CH%"=="Y" goto CHOOSE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						:UTILHALT
 | 
				
			||||||
 | 
						if "%YES%"=="" echo   Utility %TRY% not found on PATH, unable to continue.
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					echo Quitting...
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
						goto QUIT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem }}}1
 | 
				
			||||||
 | 
					rem Procedures
 | 
				
			||||||
 | 
					rem CHOOSE {{{1
 | 
				
			||||||
 | 
					:CHOOSE
 | 
				
			||||||
 | 
						cls
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					echo  ______________________________________________________________________________
 | 
				
			||||||
 | 
					echo  Updated: 2006-07-10
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					echo   Please select a choice:
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					echo   [1] Clean build location
 | 
				
			||||||
 | 
					echo   [2] Extract source tarballs
 | 
				
			||||||
 | 
					echo   [3] Build source
 | 
				
			||||||
 | 
					echo   [N] Nullsoft Installer
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					echo   [R]emove existing installation
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					echo   [A]uto
 | 
				
			||||||
 | 
					echo   [Q]uit
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					echo  ______________________________________________________________________________
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						:WinNT
 | 
				
			||||||
 | 
						set /P CH=Please enter choice above...
 | 
				
			||||||
 | 
						if /I "%CH%"=="Q" goto QUIT
 | 
				
			||||||
 | 
						if /I "%CH%"=="A" goto AUTO
 | 
				
			||||||
 | 
						if /I "%CH%"=="R" goto REMOVE
 | 
				
			||||||
 | 
						if /I "%CH%"=="N" goto NSIS
 | 
				
			||||||
 | 
						if /I "%CH%"=="3" goto BUILD
 | 
				
			||||||
 | 
						if /I "%CH%"=="2" goto SOURCE
 | 
				
			||||||
 | 
						if /I "%CH%"=="1" goto CLEAN
 | 
				
			||||||
 | 
						goto WinNT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem AUTO {{{1
 | 
				
			||||||
 | 
					:AUTO
 | 
				
			||||||
 | 
					echo -----------------------------------------------------------------
 | 
				
			||||||
 | 
					echo Setting Auto-Run...
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						set RETURN=no
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem CLEAN {{{1
 | 
				
			||||||
 | 
					:CLEAN
 | 
				
			||||||
 | 
					echo -----------------------------------------------------------------
 | 
				
			||||||
 | 
					echo Cleaning up build location (removing all directories and files)
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if not exist %BUILDPATH%\%VERSIONNAME% echo   (Nothing to clean.)
 | 
				
			||||||
 | 
						if exist %BUILDPATH%\%VERSIONNAME% rmdir /s /q %BUILDPATH%\%VERSIONNAME%
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" echo.
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" echo Build location cleaned. (Ctrl+C to quit)
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" pause
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" goto CHOOSE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem SOURCE {{{1
 | 
				
			||||||
 | 
					:SOURCE
 | 
				
			||||||
 | 
					echo -----------------------------------------------------------------
 | 
				
			||||||
 | 
					echo Downloading and extracting source tarballs...
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem NOTE: tar -xzf does not always work
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						:SOURCES
 | 
				
			||||||
 | 
					echo   %VERSIONNAME%.tar.gz...
 | 
				
			||||||
 | 
						if exist "%VERSIONNAME%.tar" goto TARBALL
 | 
				
			||||||
 | 
						if not exist "%VERSIONNAME%.tar.gz" echo.
 | 
				
			||||||
 | 
						if not exist "%VERSIONNAME%.tar.gz" echo Tarball not found, downloading...
 | 
				
			||||||
 | 
						if not exist "%VERSIONNAME%.tar.gz" echo.
 | 
				
			||||||
 | 
						if not exist "%VERSIONNAME%.tar.gz" wget -c http://superb-east.dl.sourceforge.net/sourceforge/gramps/%VERSIONNAME%.tar.gz
 | 
				
			||||||
 | 
						if not exist "%VERSIONNAME%.tar.gz" echo.
 | 
				
			||||||
 | 
						if not exist "%VERSIONNAME%.tar.gz" echo Download failed, unable to continue.
 | 
				
			||||||
 | 
						if not exist "%VERSIONNAME%.tar.gz" echo.
 | 
				
			||||||
 | 
						if not exist "%VERSIONNAME%.tar.gz" goto CHOOSE
 | 
				
			||||||
 | 
						if exist "%VERSIONNAME%.tar.gz" gunzip "%VERSIONNAME%.tar.gz"
 | 
				
			||||||
 | 
					echo   tarball unzipped.
 | 
				
			||||||
 | 
						:TARBALL
 | 
				
			||||||
 | 
						if not exist "%VERSIONNAME%.tar" echo.
 | 
				
			||||||
 | 
						if not exist "%VERSIONNAME%.tar" echo Unable to continue, no tarball found.
 | 
				
			||||||
 | 
						if not exist "%VERSIONNAME%.tar" echo.
 | 
				
			||||||
 | 
						if not exist "%VERSIONNAME%.tar" goto CHOOSE
 | 
				
			||||||
 | 
					echo   extracting...
 | 
				
			||||||
 | 
						tar -xvf %VERSIONNAME%.tar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" echo.
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" echo Source tarballs unpacked. (Ctrl+C to quit)
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" pause
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" goto CHOOSE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem BUILD {{{1
 | 
				
			||||||
 | 
					:BUILD
 | 
				
			||||||
 | 
					echo -----------------------------------------------------------------
 | 
				
			||||||
 | 
					echo Building...
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem TODO: This should happen on the user's machine, since the process
 | 
				
			||||||
 | 
					rem apparently embeds a number of paths into the result.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						rem cd "%BUILDPATH%\%VERSIONNAME%"
 | 
				
			||||||
 | 
						rem 
 | 
				
			||||||
 | 
						rem python grampsSetup.py -c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" echo.
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" echo Nothing to do. (Build occurs on target on first run.)
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" pause
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" goto CHOOSE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem NSIS {{{1
 | 
				
			||||||
 | 
					:NSIS
 | 
				
			||||||
 | 
					echo -----------------------------------------------------------------
 | 
				
			||||||
 | 
					echo Nullsoft Installer creation
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if exist %NSIS%\CON goto NSISFOUND
 | 
				
			||||||
 | 
						echo.
 | 
				
			||||||
 | 
						echo   NSIS path not found. Unable to continue...
 | 
				
			||||||
 | 
						pause
 | 
				
			||||||
 | 
						goto CHOOSE
 | 
				
			||||||
 | 
						:NSISFOUND
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo   copying customized NSIS files...
 | 
				
			||||||
 | 
						rem if not exist "%BUILDPATH%\%VERSIONNAME%\nsis" mkdir "%BUILDPATH%\%VERSIONNAME%\nsis"
 | 
				
			||||||
 | 
						rem copy /Y "%NSIS%\Contrib\Graphics\Icons\classic-install.ico" "%BUILDPATH%\%VERSIONNAME%\nsis\classic-install.ico"
 | 
				
			||||||
 | 
						rem copy /Y "%NSIS%\Contrib\Graphics\Icons\classic-uninstall.ico" "%BUILDPATH%\%VERSIONNAME%\nsis\classic-uninstall.ico"
 | 
				
			||||||
 | 
						rem copy /Y "%NSIS%\Contrib\Graphics\Header\win.bmp" "%BUILDPATH%\%VERSIONNAME%\nsis\win.bmp"
 | 
				
			||||||
 | 
						rem if exist "%NSISFIXES%\nsis-splash.bmp" copy /Y "%NSISFIXES%\nsis-splash.bmp" "%BUILDPATH%\%VERSIONNAME%\nsis\nsis-splash.bmp"
 | 
				
			||||||
 | 
						rem if exist "%NSISFIXES%\nsis-checkboxes.bmp" copy /Y "%NSISFIXES%\nsis-checkboxes.bmp" "%BUILDPATH%\%VERSIONNAME%\nsis\nsis-checkboxes.bmp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem TODO:
 | 
				
			||||||
 | 
					echo   copying temporary, should end up in 2.1.8(?)
 | 
				
			||||||
 | 
						if not exist "%BUILDPATH%\%VERSIONNAME%\nsis\CON" mkdir "%BUILDPATH%\%VERSIONNAME%\nsis"
 | 
				
			||||||
 | 
						if exist "%NSISFIXES%\gramps.nsi" copy /Y "%NSISFIXES%\gramps.nsi" /Y "%BUILDPATH%\%VERSIONNAME%\nsis\gramps.nsi"
 | 
				
			||||||
 | 
						if exist "%NSISFIXES%\ped24.ico" copy /Y "%NSISFIXES%\ped24.ico" /Y "%BUILDPATH%\%VERSIONNAME%\src\images\ped24.ico"
 | 
				
			||||||
 | 
						if exist "%NSISFIXES%\gcheck.py" copy /Y "%NSISFIXES%\gcheck.py" /Y "%BUILDPATH%\%VERSIONNAME%\nsis\gcheck.py"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo   building installer...
 | 
				
			||||||
 | 
						cd "%BUILDPATH%\%VERSIONNAME%\nsis"
 | 
				
			||||||
 | 
						%NSIS%\makensis gramps.nsi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" echo.
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" echo   Pausing... did we enjoy building the Nullsoft installer? (Ctrl+C to quit)
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" pause
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" goto CHOOSE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem REMOVE {{{1
 | 
				
			||||||
 | 
					:REMOVE
 | 
				
			||||||
 | 
					rem this is NOT automatic
 | 
				
			||||||
 | 
					if "%RETURN%"=="no" goto CHOOSE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo -----------------------------------------------------------------
 | 
				
			||||||
 | 
					echo Removing existing installation
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if exist "%ProgramFiles%\gramps" rmdir /s /q "%ProgramFiles%\gramps"
 | 
				
			||||||
 | 
						if exist "%USERPROFILE%\Start Menu\Programs\GRAMPS" rmdir /s /q "%USERPROFILE%\Start Menu\Programs\GRAMPS"
 | 
				
			||||||
 | 
						if exist "%TEMP%\gramps-install.ini" del "%TEMP%\gramps-install.ini"
 | 
				
			||||||
 | 
						if exist "%TEMP%\gcheck.py" del "%TEMP%\gcheck.py"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" echo.
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" echo   Pausing... did we enjoy removing existing installation? (Ctrl+C to quit)
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" pause
 | 
				
			||||||
 | 
					if not "%RETURN%"=="no" goto CHOOSE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem QUIT {{{1
 | 
				
			||||||
 | 
					:QUIT
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					echo Finished.
 | 
				
			||||||
 | 
					echo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						cd "%BUILDPATH%"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem clear variables
 | 
				
			||||||
 | 
						set ARCHIVEDRIVE=
 | 
				
			||||||
 | 
						set BUILDDRIVE=
 | 
				
			||||||
 | 
						set BUILDPATH=
 | 
				
			||||||
 | 
						set BUILDTYPE=
 | 
				
			||||||
 | 
						set VERSION=
 | 
				
			||||||
 | 
						set VERSIONNAME=
 | 
				
			||||||
 | 
						set VERSIONSUB=
 | 
				
			||||||
 | 
						set CH=
 | 
				
			||||||
 | 
						set FNAME=
 | 
				
			||||||
 | 
						set GCC=
 | 
				
			||||||
 | 
						set LICENSEFILE=
 | 
				
			||||||
 | 
						set MYDAY=
 | 
				
			||||||
 | 
						set MYMONTH=
 | 
				
			||||||
 | 
						set MYYEAR=
 | 
				
			||||||
 | 
						set MYDAYNAME=
 | 
				
			||||||
 | 
						set MDY=
 | 
				
			||||||
 | 
						set NSIS=
 | 
				
			||||||
 | 
						set NSISFIXES=
 | 
				
			||||||
 | 
					rem set PATHORIG=
 | 
				
			||||||
 | 
						set RETURN=
 | 
				
			||||||
 | 
						set TRY=
 | 
				
			||||||
 | 
						set YES=
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem reset path if backup exists
 | 
				
			||||||
 | 
					rem if "%PATHORIG%"=="" goto END
 | 
				
			||||||
 | 
						set PATH=%PATHORIG%
 | 
				
			||||||
 | 
						set PATHORIG=
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem 1}}}
 | 
				
			||||||
 | 
					:END
 | 
				
			||||||
 | 
					rem vim:foldmethod=marker
 | 
				
			||||||
							
								
								
									
										431
									
								
								gramps2/windows/nsis/gramps.nsi
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										431
									
								
								gramps2/windows/nsis/gramps.nsi
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,431 @@
 | 
				
			|||||||
 | 
					#
 | 
				
			||||||
 | 
					# Filename: gramps.nsi
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Description: Nullsoft Installer (NSIS) file to build Windows installer:
 | 
				
			||||||
 | 
					# Updated:     2006-07-26 13:12:28-0400
 | 
				
			||||||
 | 
					# Author:      Steve Hall [ digitect dancingpaper com ]
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Requires:    NSIS version 2.0 or later.
 | 
				
			||||||
 | 
					# Notes:
 | 
				
			||||||
 | 
					# o WARNING: if you make changes to this script, look out for $INSTDIR
 | 
				
			||||||
 | 
					#   to be valid, because this line is very dangerous:  RMDir /r $INSTDIR
 | 
				
			||||||
 | 
					# o WARNING: Except the uninstaller. That re-paths for some reason.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#               Installer Attributes
 | 
				
			||||||
 | 
					# 0. Base Settings {{{1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# version numbers
 | 
				
			||||||
 | 
					!define GRAMPS_VER_MAJOR $%VERSION%
 | 
				
			||||||
 | 
					!define GRAMPS_VER_MINOR $%VERSIONSUB%
 | 
				
			||||||
 | 
					!define GRAMPS_VER_POINT $%VERSIONPT%
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# adds Native Language Support
 | 
				
			||||||
 | 
					!define HAVE_NLS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# output file
 | 
				
			||||||
 | 
					Name "GRAMPS"
 | 
				
			||||||
 | 
					OutFile gramps-${GRAMPS_VER_MAJOR}.${GRAMPS_VER_MINOR}.${GRAMPS_VER_POINT}.exe
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# self ensure we don't have a corrupted file
 | 
				
			||||||
 | 
					CRCCheck on
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# compression
 | 
				
			||||||
 | 
					SetCompress auto
 | 
				
			||||||
 | 
					# zlib good, bzip2 better, lzma best (and slowest, whew.) 
 | 
				
			||||||
 | 
					SetCompressor lzma
 | 
				
			||||||
 | 
					# reference existing store if possible
 | 
				
			||||||
 | 
					SetDatablockOptimize on
 | 
				
			||||||
 | 
					# UPX
 | 
				
			||||||
 | 
					# comment next line if you don't have UPX (http://upx.sourceforge.net)
 | 
				
			||||||
 | 
					!packhdr temp.dat "upx --best --compress-icons=0 temp.dat"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# don't allow installation into C:\
 | 
				
			||||||
 | 
					AllowRootDirInstall false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# install details color scheme
 | 
				
			||||||
 | 
					InstallColors /windows
 | 
				
			||||||
 | 
					# background
 | 
				
			||||||
 | 
					BGGradient off
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# adds an XP manifest
 | 
				
			||||||
 | 
					XPStyle on
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# default install path
 | 
				
			||||||
 | 
					InstallDir $PROGRAMFILES\gramps
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Remember install folder
 | 
				
			||||||
 | 
					InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Remember the installer language
 | 
				
			||||||
 | 
					!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
 | 
				
			||||||
 | 
					!define MUI_LANGDLL_REGISTRY_KEY "Software\${MUI_PRODUCT}"
 | 
				
			||||||
 | 
					!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# types of installs we can perform
 | 
				
			||||||
 | 
					InstType Typical
 | 
				
			||||||
 | 
					InstType Minimal
 | 
				
			||||||
 | 
					InstType Full
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SilentInstall normal
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 1. Header file (Begin Modern User Interface)  {{{1
 | 
				
			||||||
 | 
					!include "MUI.nsh"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 2. Interface Configuration {{{1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# installer/uninstaller icons (these must match in size!)
 | 
				
			||||||
 | 
					#!define MUI_ICON "classic-install.ico"
 | 
				
			||||||
 | 
					#!define MUI_UNICON "classic-uninstall.ico"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# splash, header graphics (same for both!)
 | 
				
			||||||
 | 
					!define MUI_HEADERIMAGE
 | 
				
			||||||
 | 
					#!define MUI_HEADERIMAGE_BITMAP "win.bmp"
 | 
				
			||||||
 | 
					#!define MUI_WELCOMEFINISHPAGE_BITMAP "nsis-splash.bmp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					!define MUI_LICENSEPAGE_BUTTON $(^AgreeBtn)
 | 
				
			||||||
 | 
					!define MUI_LICENSEPAGE_RADIOBUTTONS
 | 
				
			||||||
 | 
					!define MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT $(^AcceptBtn)
 | 
				
			||||||
 | 
					!define MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE $(^DontAcceptBtn)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#!define MUI_COMPONENTSPAGE_CHECKBITMAP "nsis-checkboxes.bmp"
 | 
				
			||||||
 | 
					# use small description box below components (not adjacent)
 | 
				
			||||||
 | 
					!define MUI_COMPONENTSPAGE_SMALLDESC
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					!define MUI_DIRECTORYPAGE_TEXT_TOP $(^DirText)
 | 
				
			||||||
 | 
					!define MUI_DIRECTORYPAGE_TEXT_DESTINATION $(^DirBrowseText)
 | 
				
			||||||
 | 
					!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					!define MUI_FINISHPAGE_RUN "python"
 | 
				
			||||||
 | 
					!define MUI_FINISHPAGE_RUN_PARAMETERS "$\"$INSTDIR\gramps.py$\""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					!define MUI_ABORTWARNING
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 3. Pages {{{1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					!insertmacro MUI_PAGE_WELCOME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					!insertmacro MUI_PAGE_LICENSE "..\COPYING"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					!insertmacro MUI_PAGE_COMPONENTS
 | 
				
			||||||
 | 
					!insertmacro MUI_PAGE_DIRECTORY
 | 
				
			||||||
 | 
					!insertmacro MUI_PAGE_INSTFILES
 | 
				
			||||||
 | 
					!insertmacro MUI_PAGE_FINISH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Uninstaller
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					!insertmacro MUI_UNPAGE_CONFIRM
 | 
				
			||||||
 | 
					!insertmacro MUI_UNPAGE_INSTFILES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 4. Custom functions {{{1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 5. Language files {{{1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Languages
 | 
				
			||||||
 | 
					# TODO: These are pretty badly broken at the moment. 
 | 
				
			||||||
 | 
					# Note: This appears to be due to building on Win95 which does not
 | 
				
			||||||
 | 
					#       support Unicode:
 | 
				
			||||||
 | 
					#       (http://nsis.sf.net/archive/nsisweb.php?page=247&instances=0,235)
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#   So what happens if we use only ASCII?
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Arabic"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Bulgarian"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Catalan"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Croatian"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Czech"
 | 
				
			||||||
 | 
					!insertmacro MUI_LANGUAGE "Danish"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Default"
 | 
				
			||||||
 | 
					!insertmacro MUI_LANGUAGE "Dutch"
 | 
				
			||||||
 | 
					!insertmacro MUI_LANGUAGE "English"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Estonian"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Farsi"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Finnish"
 | 
				
			||||||
 | 
					!insertmacro MUI_LANGUAGE "French"
 | 
				
			||||||
 | 
					!insertmacro MUI_LANGUAGE "German"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Greek"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Hebrew"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Hungarian"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Indonesian"
 | 
				
			||||||
 | 
					!insertmacro MUI_LANGUAGE "Italian"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Japanese"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Korean"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Latvian"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Lithuanian"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Macedonian"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Norwegian"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Polish"
 | 
				
			||||||
 | 
					!insertmacro MUI_LANGUAGE "Portuguese"
 | 
				
			||||||
 | 
					!insertmacro MUI_LANGUAGE "PortugueseBR"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Romanian"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Russian"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Serbian"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "SerbianLatin"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "SimpChinese"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Slovak"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Slovenian"
 | 
				
			||||||
 | 
					!insertmacro MUI_LANGUAGE "Spanish"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Swedish"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Thai"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "TradChinese"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Turkish"
 | 
				
			||||||
 | 
					#!insertmacro MUI_LANGUAGE "Ukrainian"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 6. Reserve Files  {{{1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 1}}}
 | 
				
			||||||
 | 
					#               7a. Sections
 | 
				
			||||||
 | 
					#    Program Files {{{1
 | 
				
			||||||
 | 
					######################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Section "Program files (required)" Main
 | 
				
			||||||
 | 
					SectionIn 1 2 3 RO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						Call WarnDirExists
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						SetOutPath $INSTDIR
 | 
				
			||||||
 | 
						File /r ..\src\*.*
 | 
				
			||||||
 | 
						#File /r ..\nsis\gramps.ico
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SectionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#    Icons, menus and shortcuts {{{1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SubSection "Icons, menus and shortcuts" MenusAndIcons
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Section "Add GRAMPS to the Start Menu" MenuStart
 | 
				
			||||||
 | 
					SectionIn 1 3
 | 
				
			||||||
 | 
						# determines "Start In" location for shortcuts
 | 
				
			||||||
 | 
						SetOutPath $INSTDIR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						CreateDirectory "$SMPROGRAMS\GRAMPS\"
 | 
				
			||||||
 | 
						CreateShortCut "$SMPROGRAMS\GRAMPS\GRAMPS.lnk" "$3" "$\"$INSTDIR\gramps.py$\"" "$INSTDIR\images\ped24.ico" "0" "" "" "GRAMPS"
 | 
				
			||||||
 | 
						WriteINIStr "$SMPROGRAMS\GRAMPS\GRAMPS Website.url" "InternetShortcut" "URL" "http://www.gramps-project.org/"
 | 
				
			||||||
 | 
						CreateShortCut "$SMPROGRAMS\GRAMPS\Uninstall GRAMPS.lnk" "$\"$INSTDIR\uninstall.exe$\"" "" "" "0" "" "" "Uninstall GRAMPS"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SectionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Section "Add Desktop icon" Desktop
 | 
				
			||||||
 | 
					#SectionIn 1 3
 | 
				
			||||||
 | 
					# determines "Start In" location for shortcuts
 | 
				
			||||||
 | 
					SetOutPath $INSTDIR
 | 
				
			||||||
 | 
					CreateShortCut "$DESKTOP\GRAMPS.lnk" "$3" "$\"$INSTDIR\gramps.py$\"" "$INSTDIR\images\ped24.ico" "0" "" "" "GRAMPS"
 | 
				
			||||||
 | 
					SectionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SubSectionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#    Uninstall {{{1
 | 
				
			||||||
 | 
					######################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Section Uninstall
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# ask first
 | 
				
			||||||
 | 
						MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 \
 | 
				
			||||||
 | 
							"Completely remove installation? $\n\
 | 
				
			||||||
 | 
							(Delete folder $INSTDIR ) " \
 | 
				
			||||||
 | 
							IDNO unQuit IDYES unContinue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						unQuit:
 | 
				
			||||||
 | 
						Abort
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						unContinue:
 | 
				
			||||||
 | 
						ClearErrors
 | 
				
			||||||
 | 
						RMDir /r $INSTDIR
 | 
				
			||||||
 | 
						Call un.StartMenu
 | 
				
			||||||
 | 
						Call un.Desktop
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						unEnd:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SectionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 1}}}
 | 
				
			||||||
 | 
					#               7b. Functions
 | 
				
			||||||
 | 
					#    Installer {{{1
 | 
				
			||||||
 | 
					#####################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Function .onInit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						; test for dependencies
 | 
				
			||||||
 | 
						MessageBox MB_OK "Testing dependencies..."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						; look for python.exe
 | 
				
			||||||
 | 
						; NOTE: This is set to $3 if it exists.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						; on path
 | 
				
			||||||
 | 
						SearchPath $3 python.exe
 | 
				
			||||||
 | 
					#MessageBox MB_OK "DEBUG: Testing python.exe on path...$\n$\nFound:  $\"$3$\""
 | 
				
			||||||
 | 
						IfFileExists $3 HavePython 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ; registry keys (these are confirmed possibilities)
 | 
				
			||||||
 | 
						; reg key
 | 
				
			||||||
 | 
						ReadRegStr $3 HKCR 'Applications\python.exe\shell\open\command' ""
 | 
				
			||||||
 | 
						StrCpy $3 "$3python.exe"  ; append "python.exe"
 | 
				
			||||||
 | 
						IfFileExists $3 HavePython 0
 | 
				
			||||||
 | 
						; reg key
 | 
				
			||||||
 | 
						ReadRegStr $3 HKLM 'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\python.exe' ""
 | 
				
			||||||
 | 
						StrCpy $3 "$3python.exe"  ; append "python.exe"
 | 
				
			||||||
 | 
						IfFileExists $3 HavePython 0
 | 
				
			||||||
 | 
						; reg key
 | 
				
			||||||
 | 
						ReadRegStr $3 HKLM 'SOFTWARE\Python\PythonCore\2.4' ""
 | 
				
			||||||
 | 
						StrCpy $3 "$3python.exe"  ; append "python.exe"
 | 
				
			||||||
 | 
						IfFileExists $3 HavePython 0
 | 
				
			||||||
 | 
						; reg key
 | 
				
			||||||
 | 
						ReadRegStr $3 HKLM 'SOFTWARE\Python\PythonCore\2.4\InstallPath' ""
 | 
				
			||||||
 | 
						StrCpy $3 "$3python.exe"  ; append "python.exe"
 | 
				
			||||||
 | 
						IfFileExists $3 HavePython 0
 | 
				
			||||||
 | 
						; reg key
 | 
				
			||||||
 | 
					    ReadRegStr $3 HKCR 'Python.File\shell\open\command' ""
 | 
				
			||||||
 | 
						StrCpy $3 "$3python.exe"  ; append "python.exe"
 | 
				
			||||||
 | 
						IfFileExists $3 HavePython 0
 | 
				
			||||||
 | 
						; reg key
 | 
				
			||||||
 | 
					    ReadRegStr $3 HKCU 'Software\Classes\Python.File\shell\open\command' ""
 | 
				
			||||||
 | 
						StrCpy $3 "$3python.exe"  ; append "python.exe"
 | 
				
			||||||
 | 
						IfFileExists $3 HavePython 0
 | 
				
			||||||
 | 
						; reg key
 | 
				
			||||||
 | 
					    ReadRegStr $3 HKCU 'Software\Microsoft\Windows\Current version\App Paths\Python.exe' ""
 | 
				
			||||||
 | 
						StrCpy $3 "$3python.exe"  ; append "python.exe"
 | 
				
			||||||
 | 
						IfFileExists $3 HavePython 0
 | 
				
			||||||
 | 
						; reg key
 | 
				
			||||||
 | 
					    ReadRegStr $3 HKCU 'Software\Microsoft\Windows\ShellNoRoam\MUICache (data:python)' ""
 | 
				
			||||||
 | 
						StrCpy $3 "$3python.exe"  ; append "python.exe"
 | 
				
			||||||
 | 
						IfFileExists $3 HavePython 0
 | 
				
			||||||
 | 
						; reg key
 | 
				
			||||||
 | 
					    ReadRegStr $3 HKCU 'Software\Python\PythonCore\2.4\InstallPath' ""
 | 
				
			||||||
 | 
						StrCpy $3 "$3python.exe"  ; append "python.exe"
 | 
				
			||||||
 | 
						IfFileExists $3 HavePython 0
 | 
				
			||||||
 | 
						; reg key
 | 
				
			||||||
 | 
					    ReadRegStr $3 HKCU 'Software\Python\PythonCore\2.4\PythonPath' ""
 | 
				
			||||||
 | 
						StrCpy $3 "$3python.exe"  ; append "python.exe"
 | 
				
			||||||
 | 
						IfFileExists $3 HavePython 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						; TODO: request path from user/browse (can NSIS do this?)
 | 
				
			||||||
 | 
							MessageBox MB_OK "Python not found, unable to continue."
 | 
				
			||||||
 | 
							Abort
 | 
				
			||||||
 | 
							HavePython:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						; extract gcheck
 | 
				
			||||||
 | 
						SetOutPath $TEMP
 | 
				
			||||||
 | 
					#MessageBox MB_OK "DEBUG: $$TEMP location found:$\n$\n  $TEMP"
 | 
				
			||||||
 | 
						File gcheck.py
 | 
				
			||||||
 | 
						; set INI output location ($1)
 | 
				
			||||||
 | 
						StrCpy $1 "$TEMP\gramps-install.ini"
 | 
				
			||||||
 | 
					#MessageBox MB_OK "DEBUG: Attempting to run:$\n$\n  $\"$3$\" $TEMP\gcheck.py $1"
 | 
				
			||||||
 | 
						; run gcheck
 | 
				
			||||||
 | 
						Exec '"$3" $TEMP\gcheck.py $1'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ; Note The Exec above is a fork, meaning the following file test
 | 
				
			||||||
 | 
					    ;      will fail because it happens faster than the Exec can run
 | 
				
			||||||
 | 
					    ;      to create it!
 | 
				
			||||||
 | 
						DetailPrint "pausing..."
 | 
				
			||||||
 | 
						Sleep 1000
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						; verify INI created
 | 
				
			||||||
 | 
						IfFileExists $1 YesINI 0
 | 
				
			||||||
 | 
							MessageBox MB_OK "Dependency test INI creation failed, unable to continue."
 | 
				
			||||||
 | 
							Abort
 | 
				
			||||||
 | 
							YesINI:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						; verify environment test results
 | 
				
			||||||
 | 
						; GTK+
 | 
				
			||||||
 | 
						ReadINIStr $0 $1 tests gtk
 | 
				
			||||||
 | 
						StrCmp $0 "yes" HaveGTK 0
 | 
				
			||||||
 | 
							MessageBox MB_OK "GTK+ not installed, unable to continue."
 | 
				
			||||||
 | 
							Abort
 | 
				
			||||||
 | 
							HaveGTK:
 | 
				
			||||||
 | 
						; pygtk
 | 
				
			||||||
 | 
						ReadINIStr $0 $1 tests pygtk
 | 
				
			||||||
 | 
						StrCmp $0 "yes" Havepygtk 0
 | 
				
			||||||
 | 
							MessageBox MB_OK "pygtk not installed, unable to continue."
 | 
				
			||||||
 | 
							Abort
 | 
				
			||||||
 | 
							Havepygtk:
 | 
				
			||||||
 | 
						; glade
 | 
				
			||||||
 | 
						ReadINIStr $0 $1 tests glade
 | 
				
			||||||
 | 
						StrCmp $0 "yes" Haveglade 0
 | 
				
			||||||
 | 
							MessageBox MB_OK "glade not installed, unable to continue."
 | 
				
			||||||
 | 
							Abort
 | 
				
			||||||
 | 
							Haveglade:
 | 
				
			||||||
 | 
						; pycairo
 | 
				
			||||||
 | 
						ReadINIStr $0 $1 tests pycairo
 | 
				
			||||||
 | 
						StrCmp $0 "yes" Havepycairo 0
 | 
				
			||||||
 | 
							MessageBox MB_OK "pycairo not installed, unable to continue."
 | 
				
			||||||
 | 
							Abort
 | 
				
			||||||
 | 
							Havepycairo:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						#!insertmacro MUI_LANGDLL_DISPLAY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# default install directory ($INSTDIR)
 | 
				
			||||||
 | 
						StrCpy $INSTDIR $PROGRAMFILES\gramps
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					FunctionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Function .onInstSuccess
 | 
				
			||||||
 | 
						# write uninstaller
 | 
				
			||||||
 | 
						WriteUninstaller $INSTDIR\uninstall.exe
 | 
				
			||||||
 | 
					FunctionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Function .onInstFailed
 | 
				
			||||||
 | 
						MessageBox MB_OK|MB_ICONEXCLAMATION "Installation failed."
 | 
				
			||||||
 | 
					FunctionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Function WarnDirExists
 | 
				
			||||||
 | 
						# warn if dir already exists
 | 
				
			||||||
 | 
						IfFileExists $INSTDIR\*.* DirExists DirExistsOK
 | 
				
			||||||
 | 
						DirExists:
 | 
				
			||||||
 | 
						MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 \
 | 
				
			||||||
 | 
							"Install over existing?" \
 | 
				
			||||||
 | 
							IDYES DirExistsOK
 | 
				
			||||||
 | 
						Quit
 | 
				
			||||||
 | 
						DirExistsOK:
 | 
				
			||||||
 | 
					FunctionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#    Uninstaller {{{1
 | 
				
			||||||
 | 
					#####################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Function un.onUnInstSuccess
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					FunctionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Function un.StartMenu
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						IfFileExists "$SMPROGRAMS\GRAMPS" 0 unStartMenuFine
 | 
				
			||||||
 | 
						RMDir /r "$SMPROGRAMS\GRAMPS\"
 | 
				
			||||||
 | 
						unStartMenuFine:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					FunctionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Function un.Desktop
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						IfFileExists "$DESKTOP\GRAMPS.lnk" 0 unNoDesktop
 | 
				
			||||||
 | 
						Delete "$DESKTOP\GRAMPS.lnk"
 | 
				
			||||||
 | 
						unNoDesktop:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					FunctionEnd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 1}}}
 | 
				
			||||||
 | 
					# 8. Section Descriptions {{{1
 | 
				
			||||||
 | 
					######################################################################
 | 
				
			||||||
 | 
					# (must be last)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						LangString DESC_Main ${LANG_ENGLISH} "Main program files (required)."
 | 
				
			||||||
 | 
						LangString DESC_MenusAndIcons ${LANG_ENGLISH} "General Desktop and Start Menu shortcut options."
 | 
				
			||||||
 | 
						LangString DESC_Desktop ${LANG_ENGLISH} "Add icon to the Desktop."
 | 
				
			||||||
 | 
						LangString DESC_MenuStart ${LANG_ENGLISH} "Add icons to the Start Menu."
 | 
				
			||||||
 | 
						LangString DESC_Prog ${LANG_ENGLISH} "GRAMPS..."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						!insertmacro MUI_DESCRIPTION_TEXT ${Main} $(DESC_Main)
 | 
				
			||||||
 | 
						!insertmacro MUI_DESCRIPTION_TEXT ${MenusAndIcons} $(DESC_MenusAndIcons)
 | 
				
			||||||
 | 
						!insertmacro MUI_DESCRIPTION_TEXT ${Desktop} $(DESC_Desktop)
 | 
				
			||||||
 | 
						!insertmacro MUI_DESCRIPTION_TEXT ${MenuStart} $(DESC_MenuStart)
 | 
				
			||||||
 | 
						!insertmacro MUI_DESCRIPTION_TEXT ${Prog} $(DESC_Prog)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					!insertmacro MUI_FUNCTION_DESCRIPTION_END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 1}}}
 | 
				
			||||||
 | 
					# vim:foldmethod=marker:noexpandtab
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								gramps2/windows/nsis/ped24.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								gramps2/windows/nsis/ped24.ico
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 2.4 KiB  | 
		Reference in New Issue
	
	Block a user