MetaBox/Install.mel
2025-01-14 01:16:46 +08:00

17 lines
581 B
Plaintext

global proc install()
{
string $scriptPath = `whatIs install`;
string $dirPath = `substring $scriptPath 25 (size($scriptPath))`;
$dirPath = `dirname $dirPath`;
string $pythonPath = $dirPath + "/Install.py";
$pythonPath = substituteAllString($pythonPath, "\\", "/");
string $pythonCmd = "import os, sys\n";
$pythonCmd += "INSTALL_PATH = r'" + $pythonPath + "'\n";
$pythonCmd += "sys.path.append(os.path.dirname(INSTALL_PATH))\n";
$pythonCmd += "exec(open(INSTALL_PATH, encoding='utf-8').read())\n";
python($pythonCmd);
}
install();