Mercurial > mxe-octave
annotate installer-files/octave.bat @ 4258:a45374f7d9a3
Use 8.3 format for octave path
* installer-files/octave-firsttime.vbs: convert OctavePath to shortpath
* installer-files/octave.vbs: convert OctavePath to shortpath
* installer-files/octave.bat: convert OCT_HOME to 8.3 path
* tools/makeinst-script.sh.in: call pkg rbuild and fc_cache with 8.3 pathname
author | John D |
---|---|
date | Tue, 06 Dec 2016 02:27:58 -0500 |
parents | 44b1a9b2193e |
children | b73fe78f73c3 |
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 |
4258 | 8 Rem Coonvert to 8.3 format so dont have to worry about spaces |
9 for %%I in ("%OCT_HOME%") do set OCT_HOME=%%~sI | |
3717
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
10 |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
11 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
|
12 Rem comes first. |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
13 |
4222
44b1a9b2193e
qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents:
4183
diff
changeset
|
14 set PATH=%OCT_HOME%qt5\bin;%OCT_HOME%bin;%PATH% |
3717
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 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
|
17 |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
18 set TERM=cygwin |
4153
908a2a0cf6d6
octave.vbs: set GNUTERM env variable (Bug #47994)
John Donoghue
parents:
3816
diff
changeset
|
19 set GNUTERM=windows |
4183 | 20 set GS=gs.exe |
3717
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
21 |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
22 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
|
23 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
|
24 Rem Otherwise assume starting as command line |
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 :checkargs |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
27 if -%1-==-- goto noargs |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
28 if NOT %1==--force-gui goto notguiarg |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
29 set GUI_MODE=1 |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
30 :notguiarg |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
31 if NOT %1==--no-gui goto notnoguiarg |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
32 set GUI_MODE=0 |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
33 :notnoguiarg |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
34 shift |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
35 goto checkargs |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
36 :noargs |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
37 |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
38 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
|
39 if %GUI_MODE%==1 ( |
3816
fbc5d86517c9
Reverse 01182b377bb1 which stops Ctrl+C recognition.
Rik <rik@octave.org>
parents:
3811
diff
changeset
|
40 start octave-gui.exe %* |
3717
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
41 ) else ( |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
42 start octave-cli.exe %* |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
43 ) |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
44 |
70480095b6ed
Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff
changeset
|
45 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
|
46 exit |