Skip to content

Commit

Permalink
adding malmo lib to pythonpath
Browse files Browse the repository at this point in the history
katja-hofmann committed Feb 20, 2017
1 parent 37b20bc commit 308f7ae
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion scripts/malmo_install.ps1
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 308f7ae

Please sign in to comment.