2008-06-29 22:33:12 +02:00
# Configuration file for building Dynare Windows Installer
# Uses "NullSoft Scriptable Installer System", aka NSIS (see http://nsis.sourceforge.net)
2008-07-08 19:01:23 +02:00
# NSIS can be run from both Windows and Linux (see "nsis" package in Debian)
2008-07-09 23:07:02 +02:00
2008-06-29 22:33:12 +02:00
# How to build the installer:
2009-11-25 15:14:21 +01:00
# - build: the preprocessor, the MEX binaries (for MATLAB and for Octave), and the documentation (PDF files + HTML manual)
2008-06-29 22:33:12 +02:00
# - run "makensis dynare.nsi" to create the installer
2009-09-04 20:47:48 +02:00
# - if there is no failure, this will create a file "dynare-VERSION-win.exe" in the current directory
2008-06-29 22:33:12 +02:00
2009-06-08 18:43:24 +02:00
!include dynare-version.nsi
2008-06-29 22:33:12 +02:00
2012-03-16 16:55:12 +01:00
SetCompressor /SOLID lzma
2008-06-29 22:33:12 +02:00
Name "Dynare ${VERSION}"
2009-09-04 20:47:48 +02:00
OutFile "dynare-${VERSION}-win.exe"
2008-06-29 22:33:12 +02:00
InstallDir "c:\dynare\${VERSION}"
# Use the Modern User Interface (version 2)
!include MUI2.nsh
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Dynare ${VERSION}.$\n$\nDynare is distributed under the GNU General Public License (GPL) version 3.$\n$\nIf you accept the license, click Next button to continue the installation."
!insertmacro MUI_PAGE_WELCOME
2009-11-25 15:14:21 +01:00
!insertmacro MUI_PAGE_COMPONENTS
2008-06-29 22:33:12 +02:00
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_LINK_LOCATION http://www.dynare.org
!define MUI_FINISHPAGE_LINK "Go to Dynare homepage"
2008-07-08 19:01:23 +02:00
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\README.txt
2008-06-29 22:33:12 +02:00
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
!define REGLOC "Software\Microsoft\Windows\CurrentVersion\Uninstall\Dynare ${VERSION}"
!define SMLOC "$SMPROGRAMS\Dynare ${VERSION}"
!macro DETERMINE_CONTEXT
# Determine if we are admin or not
# This will change the start menu directory and the registry root key (HKLM or HKLU)
UserInfo::getAccountType
Pop $0
StrCmp $0 "Admin" +3
SetShellVarContext current
Goto +2
SetShellVarContext all
!macroend
2009-11-25 15:14:21 +01:00
Section "Dynare core (preprocessor and M-files)"
SectionIn RO
2008-06-29 22:33:12 +02:00
!insertmacro DETERMINE_CONTEXT
SetOutPath $INSTDIR
2012-06-11 13:55:56 +02:00
File README.txt ..\NEWS mexopts-win32.bat mexopts-win64.bat ..\license.txt
2008-06-29 22:33:12 +02:00
SetOutPath $INSTDIR\matlab
2008-07-08 19:01:23 +02:00
File /r ..\matlab\*.m
File ..\matlab\dynare_m.exe
2008-06-29 22:33:12 +02:00
2012-04-25 11:41:37 +02:00
SetOutPath $INSTDIR\contrib
File /r ..\contrib\*.m
2012-06-11 13:55:56 +02:00
SetOutPath $INSTDIR\scripts
File /r ..\scripts\*
2009-11-25 15:14:21 +01:00
WriteUninstaller $INSTDIR\uninstall.exe
2008-07-08 19:01:23 +02:00
2009-11-25 15:14:21 +01:00
# Create start menu entries
CreateDirectory "${SMLOC}"
CreateShortcut "${SMLOC}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
2009-09-04 20:47:48 +02:00
2009-11-25 15:14:21 +01:00
# Create entry in "Add/Remove programs"
WriteRegStr SHELL_CONTEXT "${REGLOC}" "DisplayName" "Dynare ${VERSION}"
WriteRegStr SHELL_CONTEXT "${REGLOC}" "DisplayVersion" "${VERSION}"
WriteRegStr SHELL_CONTEXT "${REGLOC}" "InstallLocation" $INSTDIR
WriteRegStr SHELL_CONTEXT "${REGLOC}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteRegDWORD SHELL_CONTEXT "${REGLOC}" "NoModify" 1
WriteRegDWORD SHELL_CONTEXT "${REGLOC}" "NoRepair" 1
SectionEnd
SectionGroup "MEX files for MATLAB"
2012-09-11 12:32:11 +02:00
Section "MEX files for MATLAB 32-bit, version 7.3 to 7.4 (R2006b to R2007a)"
SetOutPath $INSTDIR\mex\matlab\win32-7.3-7.4
File ..\mex\matlab\win32-7.3-7.4\*.mexw32
2009-11-25 15:14:21 +01:00
SectionEnd
2013-09-25 15:59:50 +02:00
Section "MEX files for MATLAB 32-bit, version 7.5 to 8.2 (R2007b to R2013b)"
SetOutPath $INSTDIR\mex\matlab\win32-7.5-8.2
File ..\mex\matlab\win32-7.5-8.2\*.mexw32
2009-11-25 15:14:21 +01:00
SectionEnd
Section "MEX files for MATLAB 64-bit, version 7.3 to 7.4 (R2006b to R2007a)"
SetOutPath $INSTDIR\mex\matlab\win64-7.3-7.4
File ..\mex\matlab\win64-7.3-7.4\*.mexw64
SectionEnd
2008-06-29 22:33:12 +02:00
2009-11-25 15:14:21 +01:00
Section "MEX files for MATLAB 64-bit, version 7.5 to 7.7 (R2007b to R2008b)"
SetOutPath $INSTDIR\mex\matlab\win64-7.5-7.7
File ..\mex\matlab\win64-7.5-7.7\*.mexw64
SectionEnd
2013-09-25 15:59:50 +02:00
Section "MEX files for MATLAB 64-bit, version 7.8 to 8.2 (R2009a to R2013b)"
SetOutPath $INSTDIR\mex\matlab\win64-7.8-8.2
File ..\mex\matlab\win64-7.8-8.2\*.mexw64
2009-11-25 15:14:21 +01:00
SectionEnd
SectionGroupEnd
2012-10-03 17:22:28 +02:00
Section "MEX files for Octave 3.6 (MinGW)"
2008-06-29 22:33:12 +02:00
SetOutPath $INSTDIR\mex\octave
2010-10-21 12:33:18 +02:00
File ..\mex\octave\*.mex ..\mex\octave\*.oct
2009-11-25 15:14:21 +01:00
SectionEnd
Section "Dynare++ (standalone executable)"
SetOutPath $INSTDIR\dynare++
2011-01-20 22:04:15 +01:00
File ..\dynare++\src\dynare++.exe ..\dynare++\extern\matlab\dynare_simul.m
2009-11-25 15:14:21 +01:00
SectionEnd
2008-06-29 22:33:12 +02:00
2010-04-30 12:36:24 +02:00
Section "Documentation and examples (Dynare and Dynare++)"
2008-06-29 22:33:12 +02:00
SetOutPath $INSTDIR\doc
2011-03-17 17:54:00 +01:00
File ..\doc\dynare.pdf ..\doc\guide.pdf ..\doc\userguide\UserGuide.pdf ..\doc\bvar-a-la-sims.pdf ..\doc\dr.pdf ..\doc\macroprocessor\macroprocessor.pdf ..\doc\preprocessor\preprocessor.pdf ..\doc\parallel\parallel.pdf ..\doc\gsa\gsa.pdf
2008-06-29 22:33:12 +02:00
2011-03-17 17:54:00 +01:00
SetOutPath $INSTDIR\doc\dynare.html
File ..\doc\dynare.html\*.html ..\doc\dynare.html\*.png
2008-06-29 22:33:12 +02:00
2009-11-25 15:14:21 +01:00
SetOutPath $INSTDIR\doc\dynare++
2009-12-23 12:31:41 +01:00
File ..\dynare++\doc\dynare++-tutorial.pdf ..\dynare++\doc\dynare++-ramsey.pdf ..\dynare++\sylv\sylvester.pdf ..\dynare++\tl\cc\tl.pdf ..\dynare++\integ\cc\integ.pdf ..\dynare++\kord\kord.pdf
2008-06-29 22:33:12 +02:00
CreateShortcut "${SMLOC}\Documentation.lnk" "$INSTDIR\doc"
2010-04-30 12:36:24 +02:00
SetOutPath $INSTDIR\examples
File ..\examples\*
CreateShortcut "${SMLOC}\Examples.lnk" "$INSTDIR\examples"
2008-06-29 22:33:12 +02:00
SectionEnd
Section "Uninstall"
!insertmacro DETERMINE_CONTEXT
# First delete the uninstaller
Delete $INSTDIR\uninstall.exe
2008-07-08 19:01:23 +02:00
Delete $INSTDIR\README.txt
2011-11-30 17:09:41 +01:00
Delete $INSTDIR\NEWS
2009-11-25 15:14:21 +01:00
Delete $INSTDIR\license.txt
2010-09-28 16:46:53 +02:00
Delete $INSTDIR\mexopts-win32.bat
Delete $INSTDIR\mexopts-win64.bat
2008-06-29 22:33:12 +02:00
Rmdir /r $INSTDIR\matlab
2012-04-25 11:41:37 +02:00
Rmdir /r $INSTDIR\contrib
2008-06-29 22:33:12 +02:00
Rmdir /r $INSTDIR\mex
2009-11-25 15:14:21 +01:00
Rmdir /r $INSTDIR\dynare++
2008-06-29 22:33:12 +02:00
Rmdir /r $INSTDIR\doc
2010-04-30 12:36:24 +02:00
Rmdir /r $INSTDIR\examples
2012-06-11 13:55:56 +02:00
Rmdir /r $INSTDIR\scripts
2008-06-29 22:33:12 +02:00
# We don't force deletion of installation directory (with /r), to avoid deleting important files
Rmdir $INSTDIR
# Delete start menu entries
Rmdir /r "${SMLOC}"
# Delete entry in "Add/Remove programs"
DeleteRegKey SHELL_CONTEXT "${REGLOC}"
SectionEnd