comparison makeinst-script.sh @ 3367:cfcbe03c9160

installer: Enable documentation build and add to installer. * makefile: add ENABLE_DOCS variable. * configure.ac: add --enable-docs arg (default yes) * makeinst-script.sh: - fix some \ vs \\ issues in script. - add shortcuts for documentation (if docs were created) * octave.mk: use --enable-docs if ENABLE_DOCS variable is yes, and install html and PDF docs.
author John Donoghue <john.donoghue@ieee.org>
date Mon, 09 Dec 2013 20:23:14 -0500
parents ab6116aa1039
children 0de28586712a
comparison
equal deleted inserted replaced
3366:ab6116aa1039 3367:cfcbe03c9160
13 13
14 echo "Generating installer script ... " 14 echo "Generating installer script ... "
15 15
16 cd $TOPDIR 16 cd $TOPDIR
17 17
18 # find icon 18 # find octave shortcut icon
19 ICON=`find $OCTAVE_SOURCE -name octave-logo.ico -printf "%P" | head -1 | sed 's,/,\\\\,g'` 19 ICON=`find $OCTAVE_SOURCE -name octave-logo.ico -printf "%P" | head -1 | sed 's,/,\\\\,g'`
20 20
21 # extract version number 21 # extract version number
22 VERSION=`sed -n 's,.*id=\"octave-version\">\([0-9\.]*\).*,\1,p' < ../index.html` 22 VERSION=`sed -n 's,.*id=\"octave-version\">\([0-9\.]*\).*,\1,p' < ../index.html`
23 OCTAVE_VERSION=`sed -n 's,.*id=\"octave-version\">\([^<]*\).*,\1,p' < ../index.html` 23 OCTAVE_VERSION=`sed -n 's,.*id=\"octave-version\">\([^<]*\).*,\1,p' < ../index.html`
37 !define INSTALLER_FILES "../installer_files" 37 !define INSTALLER_FILES "../installer_files"
38 !define INSTALLER_NAME "octave-installer.exe" 38 !define INSTALLER_NAME "octave-installer.exe"
39 !define MAIN_APP_EXE "octave.exe" 39 !define MAIN_APP_EXE "octave.exe"
40 !define INSTALL_TYPE "SetShellVarContext current" 40 !define INSTALL_TYPE "SetShellVarContext current"
41 !define PRODUCT_ROOT_KEY "HKLM" 41 !define PRODUCT_ROOT_KEY "HKLM"
42 !define PRODUCT_KEY "Software\Octave" 42 !define PRODUCT_KEY "Software\\Octave"
43 43
44 ###################################################################### 44 ######################################################################
45 45
46 VIProductVersion "\${VERSION}" 46 VIProductVersion "\${VERSION}"
47 VIAddVersionKey "ProductName" "\${APP_NAME}" 47 VIAddVersionKey "ProductName" "\${APP_NAME}"
57 Caption "\${APP_NAME}" 57 Caption "\${APP_NAME}"
58 OutFile "\${INSTALLER_NAME}" 58 OutFile "\${INSTALLER_NAME}"
59 BrandingText "\${APP_NAME}" 59 BrandingText "\${APP_NAME}"
60 XPStyle on 60 XPStyle on
61 InstallDir "C:\\Octave\\Octave-\${OCTAVE_VERSION}" 61 InstallDir "C:\\Octave\\Octave-\${OCTAVE_VERSION}"
62 Icon "$OCTAVE_SOURCE\\$ICON" 62 Icon "\${INSTALLER_FILES}/octave-logo.ico"
63 63
64 ###################################################################### 64 ######################################################################
65 ; MUI settings 65 ; MUI settings
66 !include "MUI.nsh" 66 !include "MUI.nsh"
67 67
83 83
84 !insertmacro MUI_PAGE_DIRECTORY 84 !insertmacro MUI_PAGE_DIRECTORY
85 85
86 !insertmacro MUI_PAGE_INSTFILES 86 !insertmacro MUI_PAGE_INSTFILES
87 87
88 !define MUI_FINISHPAGE_RUN "\$INSTDIR\bin\\\${MAIN_APP_EXE}" 88 !define MUI_FINISHPAGE_RUN "\$INSTDIR\\bin\\\${MAIN_APP_EXE}"
89 !insertmacro MUI_PAGE_FINISH 89 !insertmacro MUI_PAGE_FINISH
90 90
91 !insertmacro MUI_UNPAGE_CONFIRM 91 !insertmacro MUI_UNPAGE_CONFIRM
92 92
93 !insertmacro MUI_UNPAGE_INSTFILES 93 !insertmacro MUI_UNPAGE_INSTFILES
127 127
128 Section make_uninstaller 128 Section make_uninstaller
129 ; Write the uninstall keys for Windows 129 ; Write the uninstall keys for Windows
130 SetOutPath "\$INSTDIR" 130 SetOutPath "\$INSTDIR"
131 WriteRegStr HKLM "Software\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "DisplayName" "Octave" 131 WriteRegStr HKLM "Software\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "DisplayName" "Octave"
132 WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "UninstallString" "\$INSTDIR\uninstall.exe" 132 WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "UninstallString" "\$INSTDIR\\uninstall.exe"
133 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "NoModify" 1 133 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "NoModify" 1
134 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "NoRepair" 1 134 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "NoRepair" 1
135 WriteUninstaller "uninstall.exe" 135 WriteUninstaller "uninstall.exe"
136 SectionEnd 136 SectionEnd
137 137
138 ; start menu (currently hardcoded) 138 ; start menu (currently hardcoded)
139 Section "Shortcuts" 139 Section "Shortcuts"
140 140
141 CreateDirectory "\$SMPROGRAMS\\Octave" 141 CreateDirectory "\$SMPROGRAMS\\Octave"
142 CreateShortCut "\$SMPROGRAMS\\Octave\\Uninstall.lnk" "\$INSTDIR\\uninstall.exe" "" "\$INSTDIR\\uninstall.exe" 0 142 CreateShortCut "\$SMPROGRAMS\\Octave\\Uninstall.lnk" "\$INSTDIR\\uninstall.exe" "" "\$INSTDIR\\uninstall.exe" 0
143 CreateShortCut "\$SMPROGRAMS\Octave\\Octave.lnk" "\$INSTDIR\\bin\\octave.exe" "" "\$INSTDIR\\$ICON" 0 143 CreateShortCut "\$SMPROGRAMS\\Octave\\Octave.lnk" "\$INSTDIR\\bin\\octave.exe" "" "\$INSTDIR\\$ICON" 0
144 CreateShortCut "\$SMPROGRAMS\Octave\\Octave (Experimental GUI).lnk" "\$INSTDIR\\bin\\octave-gui.exe" "" "\$INSTDIR\\$ICON" 0 144 CreateShortCut "\$SMPROGRAMS\\Octave\\Octave (Experimental GUI).lnk" "\$INSTDIR\\bin\\octave-gui.exe" "" "\$INSTDIR\\$ICON" 0
145 145 EOF
146 # if we have documentation files, create shortcuts
147 if [ -d $OCTAVE_SOURCE/share/doc/octave ]; then
148 cat >> octave.nsi << EOF
149 CreateDirectory "\$SMPROGRAMS\\Octave\\Documentation"
150 CreateShortCut "\$SMPROGRAMS\\Octave\\Documentation\\Octave C++ Classes (PDF).lnk" "\$INSTDIR\\share\\doc\\octave\\liboctave.pdf" "" "" 0
151 CreateShortCut "\$SMPROGRAMS\\Octave\\Documentation\\Octave C++ Classes (HTML).lnk" "\$INSTDIR\\share\\doc\\octave\\liboctave.html\\index.html" "" "" 0
152 CreateShortCut "\$SMPROGRAMS\\Octave\\Documentation\\Octave (PDF).lnk" "\$INSTDIR\\share\\doc\\octave\\octave.pdf" "" "" 0
153 CreateShortCut "\$SMPROGRAMS\\Octave\\Documentation\\Octave (HTML).lnk" "\$INSTDIR\\share\\doc\\octave\\octave.html\\index.html" "" "" 0
154 EOF
155 fi
156
157 cat >> octave.nsi << EOF
146 SectionEnd 158 SectionEnd
147 159
148 Section "Uninstall" 160 Section "Uninstall"
149 161
150 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Octave" 162 DeleteRegKey HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave"
151 DeleteRegKey HKLM "Software\Octave" 163 DeleteRegKey HKLM "Software\\Octave"
152 164
153 ; Remove shortcuts 165 ; Remove shortcuts
154 Delete "\$SMPROGRAMS\Octave\*.*" 166 Delete "\$SMPROGRAMS\\Octave\\Documentation\\*.*"
155 RMDir "\$SMPROGRAMS\Octave" 167 RMDir "\$SMPROGRAMS\\Octave\\Documentation"
168
169 Delete "\$SMPROGRAMS\\Octave\\*.*"
170 RMDir "\$SMPROGRAMS\\Octave"
156 171
157 EOF 172 EOF
158 173
159 # insert dir list (backwards order) for uninstall files 174 # insert dir list (backwards order) for uninstall files
160 for f in $(find $OCTAVE_SOURCE -depth -type d -printf "%P\n"); do 175 for f in $(find $OCTAVE_SOURCE -depth -type d -printf "%P\n"); do
195 is_winnt_vista: 210 is_winnt_vista:
196 is_winnt_7: 211 is_winnt_7:
197 Goto done 212 Goto done
198 is_error: 213 is_error:
199 StrCpy \$1 \$0 214 StrCpy \$1 \$0
200 ReadRegStr \$0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" ProductName 215 ReadRegStr \$0 HKLM "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" ProductName
201 IfErrors 0 +4 216 IfErrors 0 +4
202 ReadRegStr \$0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" Version 217 ReadRegStr \$0 HKLM "SOFTWARE\\Microsoft\\Windows\\CurrentVersion" Version
203 IfErrors 0 +2 218 IfErrors 0 +2
204 StrCpy \$0 "Unknown" 219 StrCpy \$0 "Unknown"
205 MessageBox MB_ICONSTOP|MB_OK "This version of Octave cannot be installed on this system. Octave is supported only on Windows NT systems. Current system: \$0 (version: \$1)" 220 MessageBox MB_ICONSTOP|MB_OK "This version of Octave cannot be installed on this system. Octave is supported only on Windows NT systems. Current system: \$0 (version: \$1)"
206 Abort 221 Abort
207 done: 222 done:
212 ; Function to check any previously installed version of Octave in the system 227 ; Function to check any previously installed version of Octave in the system
213 Function CheckPrevVersion 228 Function CheckPrevVersion
214 Push \$0 229 Push \$0
215 Push \$1 230 Push \$1
216 Push \$2 231 Push \$2
217 IfFileExists "\$INSTDIR\bin\octave-\${OCTAVE_VERSION}.exe" 0 otherver 232 IfFileExists "\$INSTDIR\\bin\\octave-\${OCTAVE_VERSION}.exe" 0 otherver
218 MessageBox MB_OK|MB_ICONSTOP "Another Octave installation (with the same version) has been detected. Please uninstall it first." 233 MessageBox MB_OK|MB_ICONSTOP "Another Octave installation (with the same version) has been detected. Please uninstall it first."
219 Abort 234 Abort
220 otherver: 235 otherver:
221 StrCpy \$0 0 236 StrCpy \$0 0
222 StrCpy \$2 "" 237 StrCpy \$2 ""
258 ; use java.exe to keep stdout/stderr 273 ; use java.exe to keep stdout/stderr
259 !define JAVAEXE "javaw.exe" 274 !define JAVAEXE "javaw.exe"
260 275
261 ClearErrors 276 ClearErrors
262 ReadEnvStr \$R0 "JAVA_HOME" 277 ReadEnvStr \$R0 "JAVA_HOME"
263 StrCpy \$R0 "\$R0\bin\\\${JAVAEXE}" 278 StrCpy \$R0 "\$R0\\bin\\\${JAVAEXE}"
264 IfErrors 0 continue ;; 1) found it in JAVA_HOME 279 IfErrors 0 continue ;; 1) found it in JAVA_HOME
265 280
266 ClearErrors 281 ClearErrors
267 ReadRegStr \$R1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion" 282 ReadRegStr \$R1 HKLM "SOFTWARE\\JavaSoft\\Java Runtime Environment" "CurrentVersion"
268 ReadRegStr \$R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\\\$R1" "JavaHome" 283 ReadRegStr \$R0 HKLM "SOFTWARE\\JavaSoft\\Java Runtime Environment\\\$R1" "JavaHome"
269 StrCpy \$R0 "\$R0\bin\\\${JAVAEXE}" 284 StrCpy \$R0 "\$R0\\bin\\\${JAVAEXE}"
270 285
271 IfErrors 0 continue ;; 2) found it in the registry 286 IfErrors 0 continue ;; 2) found it in the registry
272 IfErrors JRE_Error 287 IfErrors JRE_Error
273 288
274 JRE_Error: 289 JRE_Error: