comparison installer-files/octave.vbs @ 3817:6daa158a7018

nsis installer: use octave.vbs as laucher (Bug #41074) * installer-files/octave.vbs: new file * dist-files.mk: add octave.vbs * makeinst-script.sh: use octave.vbs as laucher
author John Donoghue <john.donoghue@ieee.org>
date Mon, 02 Mar 2015 19:14:41 -0500
parents
children 1191cff7f132
comparison
equal deleted inserted replaced
3816:fbc5d86517c9 3817:6daa158a7018
1 ' script to run octave in gui/command mode
2
3 Set wshShell = CreateObject( "WScript.Shell" )
4
5 ' get the directory that script resides in
6 Set fso = CreateObject("Scripting.FileSystemObject")
7 OctavePath = fso.GetParentFolderName(WScript.ScriptFullName)
8 Set fso = Nothing
9
10 ' set up path to ensure octave bin comes first
11 Set wshSystemEnv = wshShell.Environment( "PROCESS" )
12 wshSystemEnv("PATH") = OctavePath & ";" & wshSystemEnv("PATH")
13
14 ' set terminal type
15 wshSystemEnv("TERM") = "cygwin"
16
17 ' check args to see if told to run gui or command line
18 ' and build other args to use
19 GUI_MODE=1
20 AllArgs = ""
21 Set wshArgs = WScript.Arguments
22 For I = 0 to wshArgs.Count - 1
23 if wshArgs(I) = "--force-gui" then GUI_MODE=1
24 if wshArgs(I) = "--no-gui" then GUI_MODE=0
25 AllArgs = AllArgs & " " & chr(34) & wshArgs(I) & chr(34)
26 Next
27
28 ' start whatever octave we no want to run
29 If GUI_MODE = 1 then
30 wshShell.Run chr(34) & OctavePath & "\bin\octave-gui.exe" & Chr(34) & AllArgs, 0
31 Else
32 wshShell.Run chr(34) & OctavePath & "\bin\octave-cli.exe" & Chr(34) & AllArgs, 1
33 End If
34
35 ' free our objects
36 Set wshShell = Nothing
37 Set wshSystemEnv = Nothing
38 Set wshArgs = Nothing
39