annotate installer-files/octave.vbs @ 3909:586b26b09042

set QT_PLUGIN_PATH in octave.vbs
author John W. Eaton <jwe@octave.org>
date Fri, 17 Apr 2015 14:53:00 -0400
parents 74f53761f74d
children 908a2a0cf6d6
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)
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
8 Set fso = Nothing
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
9
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
10 ' 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
11 Set wshSystemEnv = wshShell.Environment( "PROCESS" )
3831
1191cff7f132 nsis installer: change file registrations to use octave.vbs
John D
parents: 3817
diff changeset
12 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
13
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
14 ' set terminal type
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
15 wshSystemEnv("TERM") = "cygwin"
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
16
3909
586b26b09042 set QT_PLUGIN_PATH in octave.vbs
John W. Eaton <jwe@octave.org>
parents: 3859
diff changeset
17 ' set Qt plugin directory
586b26b09042 set QT_PLUGIN_PATH in octave.vbs
John W. Eaton <jwe@octave.org>
parents: 3859
diff changeset
18 wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\plugins"
586b26b09042 set QT_PLUGIN_PATH in octave.vbs
John W. Eaton <jwe@octave.org>
parents: 3859
diff changeset
19
3817
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
20 ' 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
21 ' 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
22 GUI_MODE=1
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
23 AllArgs = ""
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
24 Set wshArgs = WScript.Arguments
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
25 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
26 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
27 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
28 Next
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
29
3859
74f53761f74d GUI: run octave-gui for both gui and non gui options
John Donoghue <john.donoghue@ieee.org>
parents: 3831
diff changeset
30 ' 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
31 If GUI_MODE = 1 then
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
32 wshShell.Run chr(34) & OctavePath & "\bin\octave-gui.exe" & Chr(34) & AllArgs, 0
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
33 Else
3859
74f53761f74d GUI: run octave-gui for both gui and non gui options
John Donoghue <john.donoghue@ieee.org>
parents: 3831
diff changeset
34 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
35 End If
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
36
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
37 ' free our objects
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
38 Set wshShell = Nothing
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
39 Set wshSystemEnv = Nothing
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
40 Set wshArgs = Nothing
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
41