annotate installer-files/octave.bat @ 4643:b0cb0218813c

start Octave with the '--gui' command-line option when starting the GUI (bug #53369) * installer-files/octave-firsttime.vbs: Run octave-gui.exe with '--gui'. * installer-files/octave.bat: Likewise. * installer-files/octave.vbs: Likewise.
author Mike Miller <mtmiller@octave.org>
date Mon, 26 Mar 2018 18:14:40 -0700
parents 0fdeee4cfe11
children 56a712112482
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
4258
a45374f7d9a3 Use 8.3 format for octave path
John D
parents: 4222
diff changeset
8 Rem Coonvert to 8.3 format so dont have to worry about spaces
a45374f7d9a3 Use 8.3 format for octave path
John D
parents: 4222
diff changeset
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
4472
0fdeee4cfe11 gnuplot: enable Qt terminal and set default to wxt
Mike Miller <mtmiller@octave.org>
parents: 4276
diff changeset
19 set GNUTERM=wxt
4183
cc549d1865cb pstoedit: use GS environment var if set in windows
John D
parents: 4153
diff changeset
20 set GS=gs.exe
3717
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
21
4276
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
22 Rem set home if not already set
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
23 if "%HOME%"=="" set HOME=%USERPROFILE%
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
24 if "%HOME%"=="" set HOME=%HOMEDRIVE%%HOMEPATH%
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
25 Rem set HOME to 8.3 format
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
26 for %%I in ("%HOME%") do set HOME=%%~sI
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
27
3717
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
28 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
29 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
30 Rem Otherwise assume starting as command line
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
31 set GUI_MODE=1
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
32 :checkargs
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
33 if -%1-==-- goto noargs
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
34 if NOT %1==--force-gui goto notguiarg
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
35 set GUI_MODE=1
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
36 :notguiarg
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
37 if NOT %1==--no-gui goto notnoguiarg
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
38 set GUI_MODE=0
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
39 :notnoguiarg
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
40 shift
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
41 goto checkargs
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
42 :noargs
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 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
45 if %GUI_MODE%==1 (
4643
b0cb0218813c start Octave with the '--gui' command-line option when starting the GUI (bug #53369)
Mike Miller <mtmiller@octave.org>
parents: 4472
diff changeset
46 start octave-gui.exe --gui %*
3717
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
47 ) else (
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
48 start octave-cli.exe %*
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
49 )
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
50
70480095b6ed Use a bat file to run octave in windows (Bug #43164)
John Donoghue
parents:
diff changeset
51 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
52 exit