annotate 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
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" )
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
12 wshSystemEnv("PATH") = OctavePath & ";" & wshSystemEnv("PATH")
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
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
17 ' 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
18 ' 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
19 GUI_MODE=1
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
20 AllArgs = ""
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
21 Set wshArgs = WScript.Arguments
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
22 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
23 if wshArgs(I) = "--force-gui" then GUI_MODE=1
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
24 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
25 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
26 Next
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
27
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
28 ' start whatever octave we no want to run
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
29 If GUI_MODE = 1 then
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
30 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
31 Else
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-cli.exe" & Chr(34) & AllArgs, 1
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
33 End If
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
34
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
35 ' free our objects
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
36 Set wshShell = Nothing
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
37 Set wshSystemEnv = Nothing
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
38 Set wshArgs = Nothing
6daa158a7018 nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
39