annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4028
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
1 ' script to run octave in gui/command mode
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
2
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
3 Set wshShell = CreateObject( "WScript.Shell" )
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
4
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
5 ' get the directory that script resides in
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
6 Set fso = CreateObject("Scripting.FileSystemObject")
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
7 OctavePath = fso.GetParentFolderName(WScript.ScriptFullName)
4258
a45374f7d9a3 Use 8.3 format for octave path
John D
parents: 4222
diff changeset
8 ' get path as a 8.3 path
a45374f7d9a3 Use 8.3 format for octave path
John D
parents: 4222
diff changeset
9 Set fo = fso.GetFolder(OctavePath)
a45374f7d9a3 Use 8.3 format for octave path
John D
parents: 4222
diff changeset
10 OctavePath = fo.ShortPath
a45374f7d9a3 Use 8.3 format for octave path
John D
parents: 4222
diff changeset
11 Set fo = Nothing
4028
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
12
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
13 ' set up path to ensure octave bin comes first
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
14 Set wshSystemEnv = wshShell.Environment( "PROCESS" )
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
15 wshSystemEnv("PATH") = OctavePath & "\bin;" & wshSystemEnv("PATH")
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
16
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
17 ' set terminal type
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
18 wshSystemEnv("TERM") = "cygwin"
4183
cc549d1865cb pstoedit: use GS environment var if set in windows
John D
parents: 4028
diff changeset
19 wshSystemEnv("GNUTERM") = "windows"
cc549d1865cb pstoedit: use GS environment var if set in windows
John D
parents: 4028
diff changeset
20
cc549d1865cb pstoedit: use GS environment var if set in windows
John D
parents: 4028
diff changeset
21 wshSystemEnv("GS") = "gs.exe"
4028
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
22
4276
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
23 If wshShell.ExpandEnvironmentStrings("%HOME%") = "%HOME%" Then
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
24 Home = wshSystemEnv("USERPROFILE")
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
25 Set fo = fso.GetFolder(Home)
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
26 wshSystemEnv("HOME") = fo.ShortPath
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
27 Set fo = Nothing
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
28 End If
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
29
4222
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
30 ' set Qt plugin directory and path
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
31 Set objFSO = CreateObject("Scripting.FileSystemObject")
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
32 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
33 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
34 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
35 Else
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
36 wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\plugins"
44b1a9b2193e qt5: add initial qt5 to mxe-octave, based on mxe.cc
John D
parents: 4183
diff changeset
37 End If
4028
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
38
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
39 ' set directory to users
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
40 startpath = wshShell.ExpandEnvironmentStrings("%UserProfile%")
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
41 wshShell.CurrentDirectory = startpath
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
42
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
43 wshShell.Run chr(34) & OctavePath & "\bin\octave-gui.exe" & Chr(34), 0
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
44
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
45 ' free our objects
4276
b73fe78f73c3 If home not set, set it to userprofile
John D
parents: 4258
diff changeset
46 Set fso = Nothing
4028
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
47 Set wshShell = Nothing
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
48 Set wshSystemEnv = Nothing
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
49 Set wshArgs = Nothing
8803dfa40236 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899)
John Donoghue
parents:
diff changeset
50