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
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
2019-09-12 15:50:29 +02:00
!define MUI_COMPONENTSPAGE_NODESC
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
2019-08-30 18:07:11 +02:00
!define MUI_FINISHPAGE_LINK_LOCATION https://www.dynare.org
2008-06-29 22:33:12 +02:00
!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
2019-09-12 15:50:29 +02:00
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
2020-02-17 23:12:12 +01:00
File README.txt ..\NEWS.md ..\license.txt ..\VERSION
2008-06-29 22:33:12 +02:00
SetOutPath $INSTDIR\matlab
2008-07-08 19:01:23 +02:00
File /r ..\matlab\*.m
2015-03-27 18:41:31 +01:00
2021-01-06 17:25:33 +01:00
SetOutPath $INSTDIR\preprocessor
File ..\preprocessor\src\dynare-preprocessor.exe
2008-06-29 22:33:12 +02:00
2021-01-08 09:47:42 +01:00
SetOutPath $INSTDIR\matlab\preprocessor64
File ..\matlab\preprocessor64\dynare_m.exe
2019-09-03 16:38:33 +02:00
SetOutPath $INSTDIR\matlab\modules\dseries\externals\x13\windows\64
File deps\lib64\x13as\x13as.exe
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
2019-09-17 11:19:44 +02:00
File ..\scripts\dynare.el
2012-06-11 13:55:56 +02:00
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 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
2022-12-06 18:28:05 +01:00
# Remove "Modify" permission to "Authenticated Users".
# This permission is inherited by default, since we're writing to "c:\dynare\";
# it implies that anybody on the system can modify Dynare installation files,
# which is a security issue.
# Intigriti reference: DYNARE-7TULYVR8
# On icacls, see e.g.: https://4sysops.com/archives/icacls-list-set-grant-remove-and-deny-permissions/#inheriting-permissions
nsExec::Exec 'icacls "$INSTDIR" /inheritance:d'
nsExec::Exec 'icacls "$INSTDIR" /remove:g "NT AUTHORITY\Authenticated Users"'
2009-11-25 15:14:21 +01:00
SectionEnd
2020-04-07 12:24:16 +02:00
Section "MEX files for MATLAB 64-bit, version 8.3 to 9.3 (R2014a to R2017b)"
SetOutPath $INSTDIR\mex\matlab\win64-8.3-9.3
File ..\mex\matlab\win64-8.3-9.3\*.mexw64
2009-11-25 15:14:21 +01:00
SectionEnd
2022-09-15 15:39:40 +02:00
Section "MEX files for MATLAB 64-bit, version 9.4 to 9.13 (R2018a to R2022b)"
SetOutPath $INSTDIR\mex\matlab\win64-9.4-9.13
File ..\mex\matlab\win64-9.4-9.13\*.mexw64
2018-05-14 14:35:12 +02:00
SectionEnd
2019-09-12 15:50:29 +02:00
Section "MinGW compiler for MATLAB 64-bit"
SetOutPath $INSTDIR\mingw64
File /r deps\mingw64\*
2017-04-27 11:35:07 +02:00
SectionEnd
2022-11-07 14:16:29 +01:00
Section "MEX files for Octave 7.3.0 (64-bit)"
2020-07-17 11:44:20 +02:00
SetOutPath $INSTDIR\mex\octave\win64
File ..\mex\octave\win64\*
2018-10-29 14:41:34 +01:00
SectionEnd
2019-09-12 15:50:29 +02:00
Section "Documentation and examples"
2008-06-29 22:33:12 +02:00
SetOutPath $INSTDIR\doc
2019-08-30 18:07:11 +02:00
File ..\doc\manual\build\latex\dynare-manual.pdf ..\doc\guide.pdf ..\doc\bvar-a-la-sims.pdf ..\doc\dr.pdf ..\preprocessor\doc\macroprocessor\macroprocessor.pdf ..\preprocessor\doc\preprocessor\preprocessor.pdf ..\doc\parallel\parallel.pdf ..\doc\gsa\gsa.pdf ..\doc\dseries-and-reporting\dseriesReporting.pdf
2008-06-29 22:33:12 +02:00
2019-02-21 16:58:18 +01:00
SetOutPath $INSTDIR\doc\dynare-manual.html
File /r ..\doc\manual\build\html\*
2008-06-29 22:33:12 +02:00
2010-04-30 12:36:24 +02:00
SetOutPath $INSTDIR\examples
2016-05-26 15:05:59 +02:00
File ..\examples\*.mod ..\examples\*.m
2023-01-03 17:01:29 +01:00
# Create start menu entries
CreateDirectory "${SMLOC}"
CreateShortcut "${SMLOC}\Documentation.lnk" "$INSTDIR\doc"
2010-04-30 12:36:24 +02:00
CreateShortcut "${SMLOC}\Examples.lnk" "$INSTDIR\examples"
2019-09-12 15:50:29 +02:00
SectionEnd
2010-04-30 12:36:24 +02:00
2019-09-12 15:50:29 +02:00
2008-06-29 22:33:12 +02:00
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
2020-02-17 23:12:12 +01:00
Delete $INSTDIR\NEWS.md
2009-11-25 15:14:21 +01:00
Delete $INSTDIR\license.txt
2018-10-29 14:40:01 +01:00
Delete $INSTDIR\VERSION
2008-06-29 22:33:12 +02:00
Rmdir /r $INSTDIR\matlab
2021-01-06 17:25:33 +01:00
Rmdir /r $INSTDIR\preprocessor
2012-04-25 11:41:37 +02:00
Rmdir /r $INSTDIR\contrib
2008-06-29 22:33:12 +02:00
Rmdir /r $INSTDIR\mex
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
2018-10-29 14:41:34 +01:00
Rmdir /r $INSTDIR\mingw64
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