dynare.nsi 5.59 KB
Newer Older
1
2
# Configuration file for building Dynare Windows Installer
# Uses "NullSoft Scriptable Installer System", aka NSIS (see http://nsis.sourceforge.net)
sebastien's avatar
v4:    
sebastien committed
3
# NSIS can be run from both Windows and Linux (see "nsis" package in Debian)
4

5
# How to build the installer:
6
# - build: the preprocessor, the MEX binaries (for MATLAB and for Octave), and the documentation (PDF files + HTML manual)
7
# - run "makensis dynare.nsi" to create the installer
8
# - if there is no failure, this will create a file "dynare-VERSION-win.exe" in the current directory
9

sebastien's avatar
sebastien committed
10
!include dynare-version.nsi
11

12
13
SetCompressor /SOLID lzma

14
15
Name "Dynare ${VERSION}"

16
OutFile "dynare-${VERSION}-win.exe"
17
18
19
20
21
22
23
24

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
25
!insertmacro MUI_PAGE_COMPONENTS
26
27
28
29
!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"
sebastien's avatar
v4:    
sebastien committed
30
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\README.txt
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
!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

53
54
Section "Dynare core (preprocessor and M-files)"
 SectionIn RO
55
56
!insertmacro DETERMINE_CONTEXT
 SetOutPath $INSTDIR
Sébastien Villemot's avatar
Sébastien Villemot committed
57
 File README.txt ..\NEWS mexopts-win32.bat mexopts-win64.bat ..\license.txt ..\dynare.el
58
59

 SetOutPath $INSTDIR\matlab
sebastien's avatar
v4:    
sebastien committed
60
61
 File /r ..\matlab\*.m
 File ..\matlab\dynare_m.exe
62

63
 WriteUninstaller $INSTDIR\uninstall.exe
sebastien's avatar
v4:    
sebastien committed
64

65
66
67
 # Create start menu entries
 CreateDirectory "${SMLOC}"
 CreateShortcut "${SMLOC}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
68

69
70
71
72
73
74
75
76
77
78
79
 # 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"

80
81
82
Section "MEX files for MATLAB 32-bit, version 7.0 to 7.4 (R14 to R2007a)"
 SetOutPath $INSTDIR\mex\matlab\win32-7.0-7.4
 File ..\mex\matlab\win32-7.0-7.4\*.dll
83
84
SectionEnd

85
86
Section "MEX files for MATLAB 32-bit, version 7.5 to 7.14 (R2007b to R2012a)"
 SetOutPath $INSTDIR\mex\matlab\win32-7.5-7.14
87
 File ..\mex\matlab\win32-7.5-7.14\*.mexw32
88
89
SectionEnd

90
91
92
93
94
# Currently we don't have that version of MATLAB
#Section "MEX files for MATLAB 64-bit, version 7.2 (R2006a)"
# SetOutPath $INSTDIR\mex\matlab\win64-7.2
# File ..\mex\matlab\win64-7.2\*.mexw64
#SectionEnd
95
96
97
98
99

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
100

101
102
103
104
105
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

106
107
Section "MEX files for MATLAB 64-bit, version 7.8 to 7.14 (R2009a to R2012a)"
 SetOutPath $INSTDIR\mex\matlab\win64-7.8-7.14
108
 File ..\mex\matlab\win64-7.8-7.14\*.mexw64
109
110
111
112
SectionEnd

SectionGroupEnd

113
Section "MEX files for Octave 3.6.1 (MinGW)"
114
 SetOutPath $INSTDIR\mex\octave
115
 File ..\mex\octave\*.mex ..\mex\octave\*.oct
116
117
118
119
SectionEnd

Section "Dynare++ (standalone executable)"
 SetOutPath $INSTDIR\dynare++
120
 File ..\dynare++\src\dynare++.exe ..\dynare++\extern\matlab\dynare_simul.m
121
SectionEnd
122

123
Section "Documentation and examples (Dynare and Dynare++)"
124
 SetOutPath $INSTDIR\doc
125
 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
126

127
128
 SetOutPath $INSTDIR\doc\dynare.html
 File ..\doc\dynare.html\*.html ..\doc\dynare.html\*.png
129

130
 SetOutPath $INSTDIR\doc\dynare++
131
 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
132
133

 CreateShortcut "${SMLOC}\Documentation.lnk" "$INSTDIR\doc"
134
135
136
137
138
139

 SetOutPath $INSTDIR\examples
 File ..\examples\*

 CreateShortcut "${SMLOC}\Examples.lnk" "$INSTDIR\examples"

140
141
142
143
144
145
146
SectionEnd

Section "Uninstall"
!insertmacro DETERMINE_CONTEXT

 # First delete the uninstaller
 Delete $INSTDIR\uninstall.exe
sebastien's avatar
v4:    
sebastien committed
147
 Delete $INSTDIR\README.txt
148
 Delete $INSTDIR\NEWS
149
 Delete $INSTDIR\license.txt
Sébastien Villemot's avatar
Sébastien Villemot committed
150
151
 Delete $INSTDIR\mexopts-win32.bat
 Delete $INSTDIR\mexopts-win64.bat
152
 Delete $INSTDIR\dynare.el
153
154
 Rmdir /r $INSTDIR\matlab
 Rmdir /r $INSTDIR\mex
155
 Rmdir /r $INSTDIR\dynare++
156
 Rmdir /r $INSTDIR\doc
157
 Rmdir /r $INSTDIR\examples
158
159
160
161
162
163
164
165
166
 # 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