annotate makeinst-script.sh @ 3360:cbaab92e1174

makeinst-script.sh: Removed 'I Agree' in GPL license page
author Anirudha Bose <ani07nov@gmail.com>
date Thu, 25 Jul 2013 20:19:28 +0530
parents 40ae138b38a6
children 9781db518638
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
3331
71171ba8bebd Update installer script for admin level and single icon file
John Donoghue <john.donoghue@ieee.org>
parents: 3010
diff changeset
19 ICON=`find $OCTAVE_SOURCE -name octave-logo.ico -printf "%P" | head -1 | sed 's,/,\\\\,g'`
2992
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
3355
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
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
3355
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
26 !define APP_NAME "GNU Octave"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
27 !define COMP_NAME "GNU Project"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
28 !define WEB_SITE "http://www.octave.org"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
29 !define VERSION "3.7.5.0"
3358
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
30 !define OCTAVE_VERSION "3.7.5"
3355
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
31 !define COPYRIGHT "Copyright © 2013 John W. Eaton and others."
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
32 !define DESCRIPTION "GNU Octave is a high-level programming language, primarily intended for numerical computations."
3356
2e44e8f86cd6 makeinst-script.sh: add license page with GPLv3
Anirudha Bose <ani07nov@gmail.com>
parents: 3355
diff changeset
33 !define LICENSE_TXT "../gpl-3.0.txt"
3355
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
34 !define INSTALLER_NAME "octave-installer.exe"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
35 !define MAIN_APP_EXE "octave.exe"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
36 !define INSTALL_TYPE "SetShellVarContext current"
3358
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
37 !define PRODUCT_ROOT_KEY "HKLM"
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
38 !define PRODUCT_KEY "Software\Octave"
3355
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
39
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
40 ######################################################################
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
41
3355
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
42 VIProductVersion "\${VERSION}"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
43 VIAddVersionKey "ProductName" "\${APP_NAME}"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
44 VIAddVersionKey "CompanyName" "\${COMP_NAME}"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
45 VIAddVersionKey "LegalCopyright" "\${COPYRIGHT}"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
46 VIAddVersionKey "FileDescription" "\${DESCRIPTION}"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
47 VIAddVersionKey "FileVersion" "\${VERSION}"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
48
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
49 ######################################################################
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
50
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
51 SetCompressor /SOLID Lzma
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
52 Name "\${APP_NAME}"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
53 Caption "\${APP_NAME}"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
54 OutFile "\${INSTALLER_NAME}"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
55 BrandingText "\${APP_NAME}"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
56 XPStyle on
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
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"
3355
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
59
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
60 ######################################################################
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
61 !include "MUI.nsh"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
62
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
63 !define MUI_ABORTWARNING
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
64 !define MUI_UNABORTWARNING
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
65
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
66 !insertmacro MUI_PAGE_WELCOME
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
67
3356
2e44e8f86cd6 makeinst-script.sh: add license page with GPLv3
Anirudha Bose <ani07nov@gmail.com>
parents: 3355
diff changeset
68 !ifdef LICENSE_TXT
3360
cbaab92e1174 makeinst-script.sh: Removed 'I Agree' in GPL license page
Anirudha Bose <ani07nov@gmail.com>
parents: 3359
diff changeset
69 !define MUI_LICENSEPAGE_TEXT_BOTTOM "The source code for Octave is freely redistributable under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation."
cbaab92e1174 makeinst-script.sh: Removed 'I Agree' in GPL license page
Anirudha Bose <ani07nov@gmail.com>
parents: 3359
diff changeset
70 !define MUI_LICENSEPAGE_BUTTON "Next >"
3356
2e44e8f86cd6 makeinst-script.sh: add license page with GPLv3
Anirudha Bose <ani07nov@gmail.com>
parents: 3355
diff changeset
71 !insertmacro MUI_PAGE_LICENSE "\${LICENSE_TXT}"
2e44e8f86cd6 makeinst-script.sh: add license page with GPLv3
Anirudha Bose <ani07nov@gmail.com>
parents: 3355
diff changeset
72 !endif
2e44e8f86cd6 makeinst-script.sh: add license page with GPLv3
Anirudha Bose <ani07nov@gmail.com>
parents: 3355
diff changeset
73
3355
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
74 !insertmacro MUI_PAGE_DIRECTORY
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
75
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
76 !insertmacro MUI_PAGE_INSTFILES
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
77
3355
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
78 !define MUI_FINISHPAGE_RUN "\$INSTDIR\bin\\\${MAIN_APP_EXE}"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
79 !insertmacro MUI_PAGE_FINISH
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
80
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
81 !insertmacro MUI_UNPAGE_CONFIRM
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
82
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
83 !insertmacro MUI_UNPAGE_INSTFILES
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
84
3355
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
85 !insertmacro MUI_UNPAGE_FINISH
3331
71171ba8bebd Update installer script for admin level and single icon file
John Donoghue <john.donoghue@ieee.org>
parents: 3010
diff changeset
86
3355
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
87 !insertmacro MUI_LANGUAGE "English"
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
88
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
89 ######################################################################
bc7e18e12dcc makeinst-script.sh: use MUI interface
Anirudha Bose <ani07nov@gmail.com>
parents: 3350
diff changeset
90
3331
71171ba8bebd Update installer script for admin level and single icon file
John Donoghue <john.donoghue@ieee.org>
parents: 3010
diff changeset
91 RequestExecutionLevel admin
3357
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
92
3358
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
93 Function .onInit
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
94 Call CheckPrevVersion
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
95 Call CheckJRE
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
96 InitPluginsDir
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
97 FunctionEnd
3357
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
98
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
99 ; file section
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
100 Section "MainFiles"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
101
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
102 EOF
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
103
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
104 # insert the files
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
105 IFS=$'\n'
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
106 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
107 winf=`echo $f | sed 's,/,\\\\,g'`
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
108 echo " CreateDirectory \"\$INSTDIR\\$winf\"" >> octave.nsi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
109 echo " SetOutPath \"\$INSTDIR\\$winf\"" >> octave.nsi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
110 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
111 done
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
112
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
113 cat >> octave.nsi << EOF
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
114
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
115 SectionEnd
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
116
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
117 Section make_uninstaller
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
118 ; Write the uninstall keys for Windows
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
119 SetOutPath "\$INSTDIR"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
120 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
121 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
122 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
123 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
124 WriteUninstaller "uninstall.exe"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
125 SectionEnd
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 ; start menu (currently hardcoded)
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
128 Section "Shortcuts"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
129
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
130 CreateDirectory "\$SMPROGRAMS\\Octave"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
131 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
132 CreateShortCut "\$SMPROGRAMS\Octave\\Octave.lnk" "\$INSTDIR\\bin\\octave.exe" "" "\$INSTDIR\\$ICON" 0
3350
078ba7a8c95b installer: add experimental GUI shortcut
John Donoghue <john.donoghue@ieee.org>
parents: 3331
diff changeset
133 CreateShortCut "\$SMPROGRAMS\Octave\\Octave (Experimental GUI).lnk" "\$INSTDIR\\bin\\octave-gui.exe" "" "\$INSTDIR\\$ICON" 0
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
134
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
135 SectionEnd
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
136
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
137 Section "Uninstall"
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 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
140 DeleteRegKey HKLM "Software\Octave"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
141
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
142 ; Remove shortcuts
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
143 Delete "\$SMPROGRAMS\Octave\*.*"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
144 RMDir "\$SMPROGRAMS\Octave"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
145
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
146 EOF
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
147
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
148 # 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
149 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
150 winf=`echo $f | sed 's,/,\\\\,g'`
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
151 echo " Delete \"\$INSTDIR\\$winf\\*.*\"" >> octave.nsi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
152 echo " RmDir \"\$INSTDIR\\$winf\"" >> octave.nsi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
153 done
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
154
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
155 # last bit of the uninstaller
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
156 cat >> octave.nsi << EOF
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
157 Delete "\$INSTDIR\*.*"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
158 RmDir "\$INSTDIR"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
159 SectionEnd
3357
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
160
3358
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
161 ; Function to check any previously installed version of Octave in the system
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
162 Function CheckPrevVersion
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
163 Push \$0
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
164 Push \$1
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
165 Push \$2
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
166 IfFileExists "\$INSTDIR\bin\octave-\${OCTAVE_VERSION}.exe" 0 otherver
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
167 MessageBox MB_OK|MB_ICONSTOP "Another Octave installation (with the same version) has been detected. Please uninstall it first."
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
168 Abort
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
169 otherver:
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
170 StrCpy \$0 0
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
171 StrCpy \$2 ""
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
172 loop:
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
173 EnumRegKey \$1 \${PRODUCT_ROOT_KEY} "\${PRODUCT_KEY}" \$0
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
174 StrCmp \$1 "" loopend
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
175 IntOp \$0 \$0 + 1
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
176 StrCmp \$2 "" 0 +2
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
177 StrCpy \$2 "\$1"
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
178 StrCpy \$2 "\$2, \$1"
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
179 Goto loop
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
180 loopend:
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
181 ReadRegStr \$1 \${PRODUCT_ROOT_KEY} "\${PRODUCT_KEY}" "Version"
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
182 IfErrors finalcheck
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
183 StrCmp \$2 "" 0 +2
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
184 StrCpy \$2 "\$1"
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
185 StrCpy \$2 "\$2, \$1"
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
186 finalcheck:
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
187 StrCmp \$2 "" done
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
188 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
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
189 Abort
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
190 done:
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
191 ClearErrors
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
192 Pop \$2
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
193 Pop \$1
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
194 Pop \$0
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
195 FunctionEnd
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
196
3357
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
197 ; Function to check Java Runtime Environment
3358
8708b7d07795 makeinst-script.sh: Added checking for previous installation of Octave
Anirudha Bose <ani07nov@gmail.com>
parents: 3357
diff changeset
198 Function CheckJRE
3357
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
199 ; looks in:
3359
40ae138b38a6 Removed checking of JRE locally
Anirudha Bose <ani07nov@gmail.com>
parents: 3358
diff changeset
200 ; 1 - JAVA_HOME environment variable
40ae138b38a6 Removed checking of JRE locally
Anirudha Bose <ani07nov@gmail.com>
parents: 3358
diff changeset
201 ; 2 - the registry
3357
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
202
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
203 Push \$R0
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
204 Push \$R1
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
205
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
206 ; use javaw.exe to avoid dosbox.
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
207 ; use java.exe to keep stdout/stderr
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
208 !define JAVAEXE "javaw.exe"
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
209
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
210 ClearErrors
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
211 ReadEnvStr \$R0 "JAVA_HOME"
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
212 StrCpy \$R0 "\$R0\bin\\\${JAVAEXE}"
3359
40ae138b38a6 Removed checking of JRE locally
Anirudha Bose <ani07nov@gmail.com>
parents: 3358
diff changeset
213 IfErrors 0 continue ;; 1) found it in JAVA_HOME
3357
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
214
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
215 ClearErrors
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
216 ReadRegStr \$R1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
217 ReadRegStr \$R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\\\$R1" "JavaHome"
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
218 StrCpy \$R0 "\$R0\bin\\\${JAVAEXE}"
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
219
3359
40ae138b38a6 Removed checking of JRE locally
Anirudha Bose <ani07nov@gmail.com>
parents: 3358
diff changeset
220 IfErrors 0 continue ;; 2) found it in the registry
3357
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
221 IfErrors JRE_Error
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
222
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
223 JRE_Error:
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
224 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
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
225 Abort
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
226 continue:
456b6e533054 makeinst-script.sh: Added checking for Java Runtime Environment
Anirudha Bose <ani07nov@gmail.com>
parents: 3356
diff changeset
227 FunctionEnd
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
228 EOF
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
229
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
230 echo "Generation Completed"