annotate installer-files/octave.bat @ 4153:908a2a0cf6d6

octave.vbs: set GNUTERM env variable (Bug #47994) * installer-files/octave.bat: set GNUTERM=windows * installer-files/octave.vbs: set GNUTERM=windows
author John Donoghue
date Wed, 01 Jun 2016 07:58:16 -0400
parents fbc5d86517c9
children cc549d1865cb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3717
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
1 @echo off
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
2 Rem Find Octave's install directory through cmd.exe variables.
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
3 Rem This batch file should reside in Octaves installation subdir!
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
4 Rem
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
5 Rem This trick finds the location where the batch file resides.
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
6 Rem Note: the result ends with a backslash
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
7 set OCT_HOME=%~dp0
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
8
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
9 Rem Set up PATH. Make sure the octave bin dir
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
10 Rem comes first.
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
11
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
12 set PATH=%OCT_HOME%bin;%PATH%
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
13
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
14 Rem Set up any environment vars we may need
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
15
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
16 set TERM=cygwin
4153
908a2a0cf6d6 octave.vbs: set GNUTERM env variable (Bug #47994)
John Donoghue
parents: 3816
diff changeset
17 set GNUTERM=windows
3717
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
18
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
19 Rem Check for args to see if we are told to start GUI
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
20 Rem with the --force-gui option or not (--no-gui)
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
21 Rem Otherwise assume starting as command line
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
22 set GUI_MODE=1
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
23 :checkargs
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
24 if -%1-==-- goto noargs
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
25 if NOT %1==--force-gui goto notguiarg
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
26 set GUI_MODE=1
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
27 :notguiarg
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
28 if NOT %1==--no-gui goto notnoguiarg
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
29 set GUI_MODE=0
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
30 :notnoguiarg
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
31 shift
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
32 goto checkargs
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
33 :noargs
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
34
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
35 Rem Start Octave (this detaches and immediately returns):
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
36 if %GUI_MODE%==1 (
3816
fbc5d86517c9 Reverse 01182b377bb1 which stops Ctrl+C recognition.
Rik <rik@octave.org>
parents: 3811
diff changeset
37 start octave-gui.exe %*
3717
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
38 ) else (
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
39 start octave-cli.exe %*
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
40 )
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
41
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
42 Rem Close the batch file's cmd.exe window
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
43 exit