diff --git a/python27.json b/python27.json index 3969666576..f18ccde366 100644 --- a/python27.json +++ b/python27.json @@ -20,11 +20,21 @@ "env_add_path": [ "scripts" ], "post_install": " python2 -m ensurepip - - $reg_path = \"Registry::HKEY_CURRENT_USER\\Software\\Python\\PythonCore\\2.7\\InstallPath\" - new-item -path $reg_path -force | out-null - new-itemproperty -path $reg_path ` - -name \"(Default)\" -value \"$dir\" -force | out-null + + $create_reg = { + param($path, $value) + + $reg_base = \"Registry::HKEY_CURRENT_USER\\Software\" + + new-item -path \"$reg_base\\$path\" -force | out-null + new-itemproperty -path \"$reg_base\\$path\" ` + -name \"(Default)\" -value \"$value\" -force | out-null + } + + $create_reg.Invoke(\"Python\\PythonCore\\2.7\\InstallPath\", ` + \"$dir\") + $create_reg.Invoke(\"Python\\PythonCore\\2.7\\PythonPath\", ` + \"$dir;$dir\\Lib\\;$dir\\DLLs\\\") ", "checkver": "

Latest: .* - Python ([0-9\\.]+)

" }