annotate makeinst-script.sh @ 3178:cc2018045ab9

Removed checking of JRE locally
author Anirudha Bose <ani07nov@gmail.com>
date Thu, 25 Jul 2013 04:23:34 +0530
parents d202f8eb8c2f
children e16507e0fad6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
1 #! /bin/bash
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
2 set -e
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
3
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
4 if [ $# != 1 ]; then
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
5 echo "Expected octave folder"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
6 exit
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
7 fi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
8
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
9 ARG1=$1
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
10
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
11 TOPDIR=`dirname $ARG1`
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
12 OCTAVE_SOURCE=`basename $ARG1`
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
13
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
14 echo "Generating installer script ... "
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
15
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
16 cd $TOPDIR
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
17
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
18 # find icon
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
19 ICON=`find $OCTAVE_SOURCE -name octave-logo.ico -printf "%P" | sed 's,/,\\\\,g'`
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
20
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
21 # create installer script
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
22 echo "; octave setup script $OCTAVE_SOURCE" > octave.nsi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
23
3174
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
24 # installer settings
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
25 cat >> octave.nsi << EOF
3174
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
26 !define APP_NAME "GNU Octave"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
27 !define COMP_NAME "GNU Project"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
28 !define WEB_SITE "http://www.octave.org"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
29 !define VERSION "3.7.5.0"
3177
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
30 !define OCTAVE_VERSION "3.7.5"
3174
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
31 !define COPYRIGHT "Copyright © 2013 John W. Eaton and others."
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
32 !define DESCRIPTION "GNU Octave is a high-level programming language, primarily intended for numerical computations."
3175
1c6824ccdc24 makeinst-script.sh: add license page with GPLv3
Anirudha Bose <ani07nov@gmail.com>
parents: 3174
diff changeset
33 !define LICENSE_TXT "../gpl-3.0.txt"
3174
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
34 !define INSTALLER_NAME "octave-installer.exe"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
35 !define MAIN_APP_EXE "octave.exe"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
36 !define INSTALL_TYPE "SetShellVarContext current"
3177
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
37 !define PRODUCT_ROOT_KEY "HKLM"
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
38 !define PRODUCT_KEY "Software\Octave"
3174
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
39
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
40 ######################################################################
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
41
3174
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
42 VIProductVersion "\${VERSION}"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
43 VIAddVersionKey "ProductName" "\${APP_NAME}"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
44 VIAddVersionKey "CompanyName" "\${COMP_NAME}"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
45 VIAddVersionKey "LegalCopyright" "\${COPYRIGHT}"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
46 VIAddVersionKey "FileDescription" "\${DESCRIPTION}"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
47 VIAddVersionKey "FileVersion" "\${VERSION}"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
48
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
49 ######################################################################
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
50
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
51 SetCompressor /SOLID Lzma
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
52 Name "\${APP_NAME}"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
53 Caption "\${APP_NAME}"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
54 OutFile "\${INSTALLER_NAME}"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
55 BrandingText "\${APP_NAME}"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
56 XPStyle on
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
57 InstallDir "\$PROGRAMFILES\Octave"
3010
8ac67219c241 Updates for nsis build and installer creation
John Donoghue <john.donoghue@ieee.org>
parents: 2992
diff changeset
58 Icon "$OCTAVE_SOURCE\\$ICON"
3174
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
59
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
60 ######################################################################
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
61
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
62 !include "MUI.nsh"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
63
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
64 !define MUI_ABORTWARNING
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
65 !define MUI_UNABORTWARNING
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
66
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
67 !insertmacro MUI_PAGE_WELCOME
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
68
3175
1c6824ccdc24 makeinst-script.sh: add license page with GPLv3
Anirudha Bose <ani07nov@gmail.com>
parents: 3174
diff changeset
69 !ifdef LICENSE_TXT
1c6824ccdc24 makeinst-script.sh: add license page with GPLv3
Anirudha Bose <ani07nov@gmail.com>
parents: 3174
diff changeset
70 !insertmacro MUI_PAGE_LICENSE "\${LICENSE_TXT}"
1c6824ccdc24 makeinst-script.sh: add license page with GPLv3
Anirudha Bose <ani07nov@gmail.com>
parents: 3174
diff changeset
71 !endif
1c6824ccdc24 makeinst-script.sh: add license page with GPLv3
Anirudha Bose <ani07nov@gmail.com>
parents: 3174
diff changeset
72
3174
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
73 !insertmacro MUI_PAGE_DIRECTORY
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
74
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
75 !insertmacro MUI_PAGE_INSTFILES
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
76
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
77 !define MUI_FINISHPAGE_RUN "\$INSTDIR\bin\\\${MAIN_APP_EXE}"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
78 !insertmacro MUI_PAGE_FINISH
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
79
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
80 !insertmacro MUI_UNPAGE_CONFIRM
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
81
3174
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
82 !insertmacro MUI_UNPAGE_INSTFILES
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
83
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
84 !insertmacro MUI_UNPAGE_FINISH
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
85
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
86 !insertmacro MUI_LANGUAGE "English"
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
87
2a264535ff3a makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3010
diff changeset
88 ######################################################################
3176
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
89
3177
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
90 Function .onInit
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
91 Call CheckPrevVersion
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
92 Call CheckJRE
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
93 InitPluginsDir
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
94 FunctionEnd
3176
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
95
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
96 ; file section
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
97 Section "MainFiles"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
98
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
99 EOF
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
100
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
101 # insert the files
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
102 IFS=$'\n'
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
103 for f in $(find $OCTAVE_SOURCE -type d -printf "%P\n"); do
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
104 winf=`echo $f | sed 's,/,\\\\,g'`
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
105 echo " CreateDirectory \"\$INSTDIR\\$winf\"" >> octave.nsi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
106 echo " SetOutPath \"\$INSTDIR\\$winf\"" >> octave.nsi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
107 find "$OCTAVE_SOURCE/$f" -maxdepth 1 -type f -printf " File \"%p\"\n" >> octave.nsi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
108 done
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
109
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
110 cat >> octave.nsi << EOF
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
111
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
112 SectionEnd
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
113
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
114 Section make_uninstaller
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
115 ; Write the uninstall keys for Windows
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
116 SetOutPath "\$INSTDIR"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
117 WriteRegStr HKLM "Software\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "DisplayName" "Octave"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
118 WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "UninstallString" "\$INSTDIR\uninstall.exe"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
119 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "NoModify" 1
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
120 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "NoRepair" 1
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
121 WriteUninstaller "uninstall.exe"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
122 SectionEnd
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
123
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
124 ; start menu (currently hardcoded)
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
125 Section "Shortcuts"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
126
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
127 CreateDirectory "\$SMPROGRAMS\\Octave"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
128 CreateShortCut "\$SMPROGRAMS\\Octave\\Uninstall.lnk" "\$INSTDIR\\uninstall.exe" "" "\$INSTDIR\\uninstall.exe" 0
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
129 CreateShortCut "\$SMPROGRAMS\Octave\\Octave.lnk" "\$INSTDIR\\bin\\octave.exe" "" "\$INSTDIR\\$ICON" 0
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
130 CreateShortCut "\$SMPROGRAMS\Octave\\Octave (No GUI).lnk" "\$INSTDIR\\bin\\octave-cli.exe" "" "\$INSTDIR\\$ICON" 0
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
131
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
132 SectionEnd
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
133
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
134 Section "Uninstall"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
135
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
136 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Octave"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
137 DeleteRegKey HKLM "Software\Octave"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
138
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
139 ; Remove shortcuts
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
140 Delete "\$SMPROGRAMS\Octave\*.*"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
141 RMDir "\$SMPROGRAMS\Octave"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
142
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
143 EOF
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
144
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
145 # insert dir list (backwards order) for uninstall files
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
146 for f in $(find $OCTAVE_SOURCE -depth -type d -printf "%P\n"); do
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
147 winf=`echo $f | sed 's,/,\\\\,g'`
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
148 echo " Delete \"\$INSTDIR\\$winf\\*.*\"" >> octave.nsi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
149 echo " RmDir \"\$INSTDIR\\$winf\"" >> octave.nsi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
150 done
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
151
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
152 # last bit of the uninstaller
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
153 cat >> octave.nsi << EOF
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
154 Delete "\$INSTDIR\*.*"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
155 RmDir "\$INSTDIR"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
156 SectionEnd
3176
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
157
3177
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
158 ; Function to check any previously installed version of Octave in the system
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
159 Function CheckPrevVersion
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
160 Push \$0
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
161 Push \$1
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
162 Push \$2
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
163 IfFileExists "\$INSTDIR\bin\octave-\${OCTAVE_VERSION}.exe" 0 otherver
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
164 MessageBox MB_OK|MB_ICONSTOP "Another Octave installation (with the same version) has been detected. Please uninstall it first."
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
165 Abort
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
166 otherver:
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
167 StrCpy \$0 0
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
168 StrCpy \$2 ""
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
169 loop:
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
170 EnumRegKey \$1 \${PRODUCT_ROOT_KEY} "\${PRODUCT_KEY}" \$0
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
171 StrCmp \$1 "" loopend
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
172 IntOp \$0 \$0 + 1
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
173 StrCmp \$2 "" 0 +2
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
174 StrCpy \$2 "\$1"
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
175 StrCpy \$2 "\$2, \$1"
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
176 Goto loop
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
177 loopend:
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
178 ReadRegStr \$1 \${PRODUCT_ROOT_KEY} "\${PRODUCT_KEY}" "Version"
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
179 IfErrors finalcheck
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
180 StrCmp \$2 "" 0 +2
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
181 StrCpy \$2 "\$1"
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
182 StrCpy \$2 "\$2, \$1"
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
183 finalcheck:
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
184 StrCmp \$2 "" done
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
185 MessageBox MB_YESNO|MB_ICONEXCLAMATION "Another Octave installation (version \$2) has been detected. It is recommended to uninstall it if you intend to use the same installation directory. Do you want to proceed with the installation anyway?" IDYES done IDNO 0
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
186 Abort
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
187 done:
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
188 ClearErrors
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
189 Pop \$2
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
190 Pop \$1
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
191 Pop \$0
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
192 FunctionEnd
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
193
3176
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
194 ; Function to check Java Runtime Environment
3177
d202f8eb8c2f makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3176
diff changeset
195 Function CheckJRE
3176
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
196 ; looks in:
3178
cc2018045ab9 Removed checking of JRE locally
Anirudha Bose <ani07nov@gmail.com>
parents: 3177
diff changeset
197 ; 1 - JAVA_HOME environment variable
cc2018045ab9 Removed checking of JRE locally
Anirudha Bose <ani07nov@gmail.com>
parents: 3177
diff changeset
198 ; 2 - the registry
3176
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
199
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
200 Push \$R0
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
201 Push \$R1
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
202
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
203 ; use javaw.exe to avoid dosbox.
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
204 ; use java.exe to keep stdout/stderr
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
205 !define JAVAEXE "javaw.exe"
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
206
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
207 ClearErrors
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
208 ReadEnvStr \$R0 "JAVA_HOME"
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
209 StrCpy \$R0 "\$R0\bin\\\${JAVAEXE}"
3178
cc2018045ab9 Removed checking of JRE locally
Anirudha Bose <ani07nov@gmail.com>
parents: 3177
diff changeset
210 IfErrors 0 continue ;; 1) found it in JAVA_HOME
3176
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
211
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
212 ClearErrors
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
213 ReadRegStr \$R1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
214 ReadRegStr \$R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\\\$R1" "JavaHome"
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
215 StrCpy \$R0 "\$R0\bin\\\${JAVAEXE}"
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
216
3178
cc2018045ab9 Removed checking of JRE locally
Anirudha Bose <ani07nov@gmail.com>
parents: 3177
diff changeset
217 IfErrors 0 continue ;; 2) found it in the registry
3176
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
218 IfErrors JRE_Error
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
219
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
220 JRE_Error:
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
221 MessageBox MB_ICONEXCLAMATION|MB_YESNO "Octave includes a Java integration component, but it seems Java is not available on this system. This component requires the Java Runtime Environment from Oracle (http://www.java.com) installed on your system. Octave can work without Java available, but the Java integration component will not be functional. Installing those components without Java available might prevent Octave from working correctly. Proceed with installation anyway?" IDYES continue
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
222 Abort
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
223 continue:
a6291cc38ec6 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3175
diff changeset
224 FunctionEnd
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
225 EOF
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
226
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
227 echo "Generation Completed"