Skip to content

Commit

Permalink
Merge pull request #473 from Microsoft/ps_fixes
Browse files Browse the repository at this point in the history
Ps fixes
  • Loading branch information
katja-hofmann authored Feb 20, 2017
2 parents 30ec5b0 + 308f7ae commit 794897a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion scripts/malmo_install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/pslib/malmo_lib.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function Install-Mesa
{
Display-Heading "Installing Mesa software renderer"
Download-File "http://download.qt.io/development_releases/prebuilt/llvmpipe/windows/opengl32sw-64.7z" ($env:HOMEPATH + "\temp\mesa.7z")
& 'C:\Program Files\7-Zip\7z.exe' x .\temp\mesa.7z -o'.\temp\mesa' | Out-Host
& 'C:\Program Files\7-Zip\7z.exe' x .\temp\mesa.7z '-o.\temp\mesa' | Out-Host
if (-Not $?)
{
Write-Host "FAILED TO INSTALL MESA"
Expand Down

0 comments on commit 794897a

Please sign in to comment.