Mercurial > mxe-octave
comparison installer-files/octave-firsttime.vbs @ 4276:b73fe78f73c3
If home not set, set it to userprofile
* installer-files/octave-firsttime.vbs,
installer-files/octave.bat,
installer-files/octave.vbs: if HOME env not set, set it to user profile
author | John D |
---|---|
date | Thu, 15 Dec 2016 12:57:41 -0500 |
parents | a45374f7d9a3 |
children | 0fdeee4cfe11 |
comparison
equal
deleted
inserted
replaced
4275:d88666c329ba | 4276:b73fe78f73c3 |
---|---|
7 OctavePath = fso.GetParentFolderName(WScript.ScriptFullName) | 7 OctavePath = fso.GetParentFolderName(WScript.ScriptFullName) |
8 ' get path as a 8.3 path | 8 ' get path as a 8.3 path |
9 Set fo = fso.GetFolder(OctavePath) | 9 Set fo = fso.GetFolder(OctavePath) |
10 OctavePath = fo.ShortPath | 10 OctavePath = fo.ShortPath |
11 Set fo = Nothing | 11 Set fo = Nothing |
12 Set fso = Nothing | |
13 | 12 |
14 ' set up path to ensure octave bin comes first | 13 ' set up path to ensure octave bin comes first |
15 Set wshSystemEnv = wshShell.Environment( "PROCESS" ) | 14 Set wshSystemEnv = wshShell.Environment( "PROCESS" ) |
16 wshSystemEnv("PATH") = OctavePath & "\bin;" & wshSystemEnv("PATH") | 15 wshSystemEnv("PATH") = OctavePath & "\bin;" & wshSystemEnv("PATH") |
17 | 16 |
18 ' set terminal type | 17 ' set terminal type |
19 wshSystemEnv("TERM") = "cygwin" | 18 wshSystemEnv("TERM") = "cygwin" |
20 wshSystemEnv("GNUTERM") = "windows" | 19 wshSystemEnv("GNUTERM") = "windows" |
21 | 20 |
22 wshSystemEnv("GS") = "gs.exe" | 21 wshSystemEnv("GS") = "gs.exe" |
22 | |
23 If wshShell.ExpandEnvironmentStrings("%HOME%") = "%HOME%" Then | |
24 Home = wshSystemEnv("USERPROFILE") | |
25 Set fo = fso.GetFolder(Home) | |
26 wshSystemEnv("HOME") = fo.ShortPath | |
27 Set fo = Nothing | |
28 End If | |
23 | 29 |
24 ' set Qt plugin directory and path | 30 ' set Qt plugin directory and path |
25 Set objFSO = CreateObject("Scripting.FileSystemObject") | 31 Set objFSO = CreateObject("Scripting.FileSystemObject") |
26 If objFSO.FolderExists(OctavePath & "\qt5\bin") Then | 32 If objFSO.FolderExists(OctavePath & "\qt5\bin") Then |
27 wshSystemEnv("PATH") = OctavePath & "\qt5\bin;" & wshSystemEnv("PATH") | 33 wshSystemEnv("PATH") = OctavePath & "\qt5\bin;" & wshSystemEnv("PATH") |
35 wshShell.CurrentDirectory = startpath | 41 wshShell.CurrentDirectory = startpath |
36 | 42 |
37 wshShell.Run chr(34) & OctavePath & "\bin\octave-gui.exe" & Chr(34), 0 | 43 wshShell.Run chr(34) & OctavePath & "\bin\octave-gui.exe" & Chr(34), 0 |
38 | 44 |
39 ' free our objects | 45 ' free our objects |
46 Set fso = Nothing | |
40 Set wshShell = Nothing | 47 Set wshShell = Nothing |
41 Set wshSystemEnv = Nothing | 48 Set wshSystemEnv = Nothing |
42 Set wshArgs = Nothing | 49 Set wshArgs = Nothing |
43 | 50 |