annotate installer-files/octave.vbs @ 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 c3950e2b4066
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3817
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
1 ' script to run octave in gui/command mode
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
2
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
3 Set wshShell = CreateObject( "WScript.Shell" )
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
4
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
5 ' get the directory that script resides in
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
6 Set fso = CreateObject("Scripting.FileSystemObject")
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
7 OctavePath = fso.GetParentFolderName(WScript.ScriptFullName)
4258
a45374f7d9a3 Use 8.3 format for octave path
John D
parents: 4222
diff changeset
8 ' get path as a 8.3 path
a45374f7d9a3 Use 8.3 format for octave path
John D
parents: 4222
diff changeset
9 Set fo = fso.GetFolder(OctavePath)
a45374f7d9a3 Use 8.3 format for octave path
John D
parents: 4222
diff changeset
10 OctavePath = fo.ShortPath
a45374f7d9a3 Use 8.3 format for octave path
John D
parents: 4222
diff changeset
11 Set fo = Nothing
3817
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
12
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
13 ' set up path to ensure octave bin comes first
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
14 Set wshSystemEnv = wshShell.Environment( "PROCESS" )
3831
1191cff7f132 nsis installer: change file registrations to use octave.vbs
John D
parents: 3817
diff changeset
15 wshSystemEnv("PATH") = OctavePath & "\bin;" & wshSystemEnv("PATH")
3817
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
16
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
17 ' set terminal type
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
18 wshSystemEnv("TERM") = "cygwin"
4472
0fdeee4cfe11 gnuplot: enable Qt terminal and set default to wxt
Mike Miller <mtmiller@octave.org>
parents: 4276
diff changeset
19 wshSystemEnv("GNUTERM") = "wxt"
3817
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
20
4183
cc549d1865cb pstoedit: use GS environment var if set in windows
John D
parents: 4153
diff changeset
21 wshSystemEnv("GS") = "gs.exe"
cc549d1865cb pstoedit: use GS environment var if set in windows
John D
parents: 4153
diff changeset
22
4276
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
23 If wshShell.ExpandEnvironmentStrings("%HOME%") = "%HOME%" Then
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
24 Home = wshSystemEnv("USERPROFILE")
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
25 Set fo = fso.GetFolder(Home)
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
26 wshSystemEnv("HOME") = fo.ShortPath
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
27 Set fo = Nothing
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
28 End If
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
29
4222
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
30 ' set Qt plugin directory and path
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
31 Set objFSO = CreateObject("Scripting.FileSystemObject")
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
32 If objFSO.FolderExists(OctavePath & "\qt5\bin") Then
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
33 wshSystemEnv("PATH") = OctavePath & "\qt5\bin;" & wshSystemEnv("PATH")
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
34 wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\qt5\plugins"
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
35 Else
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
36 wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\plugins"
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
37 End If
3909
586b26b09042 set QT_PLUGIN_PATH in octave.vbs
John W. Eaton <jwe@octave.org>
parents: 3859
diff changeset
38
3817
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
39 ' check args to see if told to run gui or command line
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
40 ' and build other args to use
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
41 GUI_MODE=1
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
42 AllArgs = ""
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
43 Set wshArgs = WScript.Arguments
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
44 For I = 0 to wshArgs.Count - 1
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
45 if wshArgs(I) = "--no-gui" then GUI_MODE=0
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
46 AllArgs = AllArgs & " " & chr(34) & wshArgs(I) & chr(34)
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
47 Next
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
48
3859
74f53761f74d GUI: run octave-gui for both gui and non gui options
John Donoghue <john.donoghue@ieee.org>
parents: 3831
diff changeset
49 ' start octave-gui, either with console shown or hidden
3817
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
50 If GUI_MODE = 1 then
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
51 wshShell.Run chr(34) & OctavePath & "\bin\octave-gui.exe --gui" & Chr(34) & AllArgs, 0
3817
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
52 Else
3859
74f53761f74d GUI: run octave-gui for both gui and non gui options
John Donoghue <john.donoghue@ieee.org>
parents: 3831
diff changeset
53 wshShell.Run chr(34) & OctavePath & "\bin\octave-gui.exe" & Chr(34) & AllArgs, 1
3817
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
54 End If
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
55
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
56 ' free our objects
4276
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
57 Set fso = Nothing
3817
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
58 Set wshShell = Nothing
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
59 Set wshSystemEnv = Nothing
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
60 Set wshArgs = Nothing
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
61