adding malmo lib to pythonpath
@@ -21,7 +21,7 @@ try {
Install-XSD;
Install-VCRedist;
Install-Mesa;"
- if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
+ if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Write-Host "Elevating to admin ..."
$InstallScript = [ScriptBlock]::Create("cd $env:HOMEDRIVE$env:HOMEPATH; Import-Module $MALMO_HOME\scripts\pslib\malmo_lib.psm1;" + $InstallList + "Check-Error")
@@ -42,6 +42,21 @@ try {
[Environment]::SetEnvironmentVariable("JAVA_HOME", "C:\Program Files\Java\jdk1.8.0_111", "Process")
}
+ # update pythonpath
+ $newPyPath = $MALMO_HOME + "\Python_Examples"
+ if (!$env:PYTHONPATH) {
+ [Environment]::SetEnvironmentVariable("PYTHONPATH", $newPyPath, "User")
+ [Environment]::SetEnvironmentVariable("PYTHONPATH", $newPyPath, "Process")
+ } else {
+ $parts = $env:PYTHONPATH.split(";")
+ if (-Not ($parts -Contains $newPyPath))
+ {
+ $newPyPath = env:PYTHONPATH + ";" + $newPyPath
+ [Environment]::SetEnvironmentVariable("PYTHONPATH", $newPyPath, "User")
+ [Environment]::SetEnvironmentVariable("PYTHONPATH", $newPyPath, "Process")
+ }
+ }
+
# Now "install" Malmo
Display-Heading ("Installing Malmo in " + $MALMO_HOME)
cd $MALMO_HOME
