<?php define("ROOT", dirname(__DIR__) . DIRECTORY_SEPARATOR); define("BIN", ROOT . "Binaries" . DIRECTORY_SEPARATOR); define("PHAB", "http://phabricator.burningreality.de/"); define("OS_ARCH", isset($_SERVER["ProgramFiles(x86)"]) ? 64 : 32); require_once __DIR__ . '/inc.php'; require_once __DIR__ . '/Cli.php'; Cli::output("This will install the Apex Studios Tool Package"); Cli::output(""); Cli::output(""); Cli::output("The tool package will be installed into the following directory:"); Cli::output("\t" . ROOT); Cli::output(""); Cli::output("Yes, this it's being installed right into this directory."); Cli::output(""); printHr(); Cli::output("Do NOT move the folder around nor delete it after installing!"); printHr(); Cli::output("Got that?"); Cli::output(""); Cli::output("Accepting is your only option. So please press a key"); dontMove(); Cli::output(""); Cli::output(""); selectScreen();
function selectScreen() { println(); Cli::output("1. Set up environment variables"); Cli::output("2. Install certificate for Arcanist (requires 1.)"); Cli::output("3. Install TortoiseSVN"); Cli::output("4. Install TortoiseGit and Git for Windows"); Cli::output("5. Install Notepad++ 6.3"); Cli::output("6. Configure Arcanist to use Notepad++"); Cli::output("0. Exit"); println(); Cli::notice("You can press Ctrl+C anytime to exit"); println(); Cli::output("How do you feel today?"); $selection = readInput(); switch ($selection) { case 0: exit(0); break; case 1: Cli::notice("If plenty of error messages pop up, don't worry. That's just me testing whether it works or not. The error messages penetrate my error blocking barreers..."); Cli::output("Press a button to continue"); println(); Cli::notice("Admin rights may be necessary - Idk"); dontMove(); ob_start(); $checkEnv = checkEnvVars(); ob_end_clean(); if ($checkEnv) { println(); Cli::success("Environment already set up - can't be bothered to change"); } else { addToPathEnv("PHP"); addToPathEnv("arc\\arcanist\\bin"); Cli::notice("Please restart the install script (that is, close this window completely) and re-run this step to see if it worked."); Cli::output("You know that it failed when the same errors happen."); } break; case 2: installCertificate(); break; case 3: Cli::notice("Please remember to install with the command line tools feature"); println(); Cli::notice("Installing TortoiseSVN"); exec("start " . ROOT . "Installers\\TortoiseSVN\\TortoiseSVN-1.7.11.23600-" . (OS_ARCH == 32 ? "win32" : "x64") . "-svn-1.7.8.msi"); break; case 4: Cli::notice("Installing TortoiseGit"); exec("start " . ROOT . "Installers\\TortoiseGit\\TortoiseGit-1.8.1.0-" . OS_ARCH . "bit.msi"); Cli::notice("Please wait until TortoiseGit has finished installing."); dontMove(); Cli::notice("Installing Git for Windows"); exec("start " . ROOT . "Installers\\GitForWindows\\Git-1.8.1.2-preview20130201.exe"); break; case 5: Cli::notice("I recommend installing into the default directory."); println(); Cli::notice("Installing Notepad++ 6.3"); exec("start " . ROOT . "Installers\\Notepad++\npp.6.3.Installer.exe"); break; case 6: installArcEditor(); break; default: Cli::output("Invalid input!"); break; } selectScreen(); }