annotate installer-files/octave.bat @ 3717:70480095b6ed

Use a bat file to run octave in windows (Bug #43164) * binary-dist-rules.mk: copy octave.bat to dist folder * dist-files.mk: add octave.bat * installer-files/octave.bat: new file * makeinst-script.sh: use octave.bat instead of octave-xxxx.exe in script and registry.
author John Donoghue
date Thu, 25 Sep 2014 14:15:41 -0400
parents
children 01182b377bb1
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
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
17
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
18 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
19 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
20 Rem Otherwise assume starting as command line
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
21 set GUI_MODE=1
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
22 :checkargs
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
23 if -%1-==-- goto noargs
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
24 if NOT %1==--force-gui goto notguiarg
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
25 set GUI_MODE=1
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
26 :notguiarg
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
27 if NOT %1==--no-gui goto notnoguiarg
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
28 set GUI_MODE=0
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
29 :notnoguiarg
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
30 shift
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
31 goto checkargs
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
32 :noargs
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
33
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
34 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
35 if %GUI_MODE%==1 (
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
36 start octave-gui.exe %*
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
37 ) else (
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
38 start octave-cli.exe %*
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
39 )
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 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
42 exit