Mercurial > mxe-octave
annotate installer-files/octave.vbs @ 6174:cf7adc238c0c
* installer-files/cmdshell.bat, installer-files/octave-firsttime.vbs,
installer-files/octave-launch.c, installer-files/octave.bat,
installer-files/octave.vbs: add pkg config path env
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Tue, 19 Apr 2022 09:26:38 -0400 |
parents | dace3d372190 |
children | d02b5d26ac28 |
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) |
4793
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
8 |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
9 ' ctavePath is now the root of the install folder, but for msys2, |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
10 ' OctavePath should be OctavePath/mingw64 or OctavePath/ming32 |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
11 MSysType = "MSYS" |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
12 MSysPath = OctavePath |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
13 Set objFSO = CreateObject("Scripting.FileSystemObject") |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
14 If objFSO.FileExists(OctavePath & "\mingw64\bin\octave-cli.exe") Then |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
15 MSysPath = OctavePath & "\usr" |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
16 MSysType = "MINGW64" |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
17 OctavePath = OctavePath & "\mingw64" |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
18 ElseIf objFSO.FileExists(OctavePath & "\mingw32\bin\octave-cli.exe") Then |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
19 MSysPath = OctavePath & "\usr" |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
20 MSysType = "MINGW32" |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
21 OctavePath = OctavePath & "\mingw32" |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
22 End If |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
23 |
4258 | 24 ' get path as a 8.3 path |
25 Set fo = fso.GetFolder(OctavePath) | |
26 OctavePath = fo.ShortPath | |
27 Set fo = Nothing | |
3817
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
28 |
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
29 ' 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
|
30 Set wshSystemEnv = wshShell.Environment( "PROCESS" ) |
4793
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
31 if OctavePath <> MSysPath Then |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
32 wshSystemEnv("PATH") = MSysPath & "\bin;" & wshSystemEnv("PATH") |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
33 End If |
3831
1191cff7f132
nsis installer: change file registrations to use octave.vbs
John D
parents:
3817
diff
changeset
|
34 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
|
35 |
4793
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
36 wshSystemEnv("MSYSTEM") = MSysType |
202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
John Donoghue
parents:
4644
diff
changeset
|
37 |
3817
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
38 ' set terminal type |
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
39 wshSystemEnv("TERM") = "cygwin" |
4472
0fdeee4cfe11
gnuplot: enable Qt terminal and set default to wxt
Mike Miller <mtmiller@octave.org>
parents:
4276
diff
changeset
|
40 wshSystemEnv("GNUTERM") = "wxt" |
3817
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
41 |
4183 | 42 wshSystemEnv("GS") = "gs.exe" |
43 | |
4276 | 44 If wshShell.ExpandEnvironmentStrings("%HOME%") = "%HOME%" Then |
45 Home = wshSystemEnv("USERPROFILE") | |
46 Set fo = fso.GetFolder(Home) | |
47 wshSystemEnv("HOME") = fo.ShortPath | |
48 Set fo = Nothing | |
49 End If | |
50 | |
4222
44b1a9b2193e
qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents:
4183
diff
changeset
|
51 ' set Qt plugin directory and path |
44b1a9b2193e
qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents:
4183
diff
changeset
|
52 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
|
53 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
|
54 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
|
55 Else |
44b1a9b2193e
qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents:
4183
diff
changeset
|
56 wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\plugins" |
44b1a9b2193e
qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents:
4183
diff
changeset
|
57 End If |
3909
586b26b09042
set QT_PLUGIN_PATH in octave.vbs
John W. Eaton <jwe@octave.org>
parents:
3859
diff
changeset
|
58 |
6174
cf7adc238c0c
* installer-files/cmdshell.bat, installer-files/octave-firsttime.vbs,
John Donoghue <john.donoghue@ieee.org>
parents:
5493
diff
changeset
|
59 ' pkg config pc path |
cf7adc238c0c
* installer-files/cmdshell.bat, installer-files/octave-firsttime.vbs,
John Donoghue <john.donoghue@ieee.org>
parents:
5493
diff
changeset
|
60 wshSystemEnv("PKG_CONFIG_PATH") = OctavePath & "\lib\pkgconfig" |
cf7adc238c0c
* installer-files/cmdshell.bat, installer-files/octave-firsttime.vbs,
John Donoghue <john.donoghue@ieee.org>
parents:
5493
diff
changeset
|
61 |
3817
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
62 ' 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
|
63 ' 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
|
64 GUI_MODE=1 |
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
65 AllArgs = "" |
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
66 Set wshArgs = WScript.Arguments |
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
67 For I = 0 to wshArgs.Count - 1 |
4644
c3950e2b4066
Fix vbs scripts to launch with '--gui' option (bug #53369).
Rik <rik@octave.org>
parents:
4643
diff
changeset
|
68 If wshArgs(I) = "--no-gui" Then GUI_MODE=0 |
3817
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
69 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
|
70 Next |
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
71 |
3859
74f53761f74d
GUI: run octave-gui for both gui and non gui options
John Donoghue <john.donoghue@ieee.org>
parents:
3831
diff
changeset
|
72 ' 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
|
73 If GUI_MODE = 1 then |
4644
c3950e2b4066
Fix vbs scripts to launch with '--gui' option (bug #53369).
Rik <rik@octave.org>
parents:
4643
diff
changeset
|
74 AllArgs = AllArgs & " " & chr(34) & "--gui" & chr(34) |
c3950e2b4066
Fix vbs scripts to launch with '--gui' option (bug #53369).
Rik <rik@octave.org>
parents:
4643
diff
changeset
|
75 wshShell.Run chr(34) & OctavePath & "\bin\octave-gui.exe" & Chr(34) & AllArgs, 0 |
3817
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
76 Else |
3859
74f53761f74d
GUI: run octave-gui for both gui and non gui options
John Donoghue <john.donoghue@ieee.org>
parents:
3831
diff
changeset
|
77 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
|
78 End If |
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
79 |
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
80 ' free our objects |
4276 | 81 Set fso = Nothing |
3817
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
82 Set wshShell = Nothing |
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
83 Set wshSystemEnv = Nothing |
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
84 Set wshArgs = Nothing |
6daa158a7018
nsis installer: use octave.vbs as laucher (Bug #41074)
John Donoghue <john.donoghue@ieee.org>
parents:
diff
changeset
|
85 |