Mercurial > mxe-octave
comparison 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 |
comparison
equal
deleted
inserted
replaced
3716:023f392ce053 | 3717:70480095b6ed |
---|---|
1 @echo off | |
2 Rem Find Octave's install directory through cmd.exe variables. | |
3 Rem This batch file should reside in Octaves installation subdir! | |
4 Rem | |
5 Rem This trick finds the location where the batch file resides. | |
6 Rem Note: the result ends with a backslash | |
7 set OCT_HOME=%~dp0 | |
8 | |
9 Rem Set up PATH. Make sure the octave bin dir | |
10 Rem comes first. | |
11 | |
12 set PATH=%OCT_HOME%bin;%PATH% | |
13 | |
14 Rem Set up any environment vars we may need | |
15 | |
16 set TERM=cygwin | |
17 | |
18 Rem Check for args to see if we are told to start GUI | |
19 Rem with the --force-gui option or not (--no-gui) | |
20 Rem Otherwise assume starting as command line | |
21 set GUI_MODE=1 | |
22 :checkargs | |
23 if -%1-==-- goto noargs | |
24 if NOT %1==--force-gui goto notguiarg | |
25 set GUI_MODE=1 | |
26 :notguiarg | |
27 if NOT %1==--no-gui goto notnoguiarg | |
28 set GUI_MODE=0 | |
29 :notnoguiarg | |
30 shift | |
31 goto checkargs | |
32 :noargs | |
33 | |
34 Rem Start Octave (this detaches and immediately returns): | |
35 if %GUI_MODE%==1 ( | |
36 start octave-gui.exe %* | |
37 ) else ( | |
38 start octave-cli.exe %* | |
39 ) | |
40 | |
41 Rem Close the batch file's cmd.exe window | |
42 exit |