<?php
$gapsIni = realpath(dirname(__FILE__) . "/../../GAPS.ini");
$config = parse_ini_file($gapsIni);

$pcvisitPath = $config['STARTER'] . "\\pcvisit\\pcvisit.exe";
if (file_exists($pcvisitPath)) {
	echo "Aenderungen bereits vorgenommen!";
} else {
	@mkdir(dirname($pcvisitPath));
	copy(dirname(__FILE__) . "/../Install/pcvisit.exe", $pcvisitPath);

	$starterConf = $config['STARTER'] . "\\config\\gcstarter.xml";

	$confFile = file_get_contents($starterConf);
	$confFile = str_replace('<Pfad>http://pcvisit.global-cube.de</Pfad>', '<Pfad>.\pcvisit\pcvisit.exe</Pfad>', $confFile);
	file_put_contents($starterConf, $confFile);

	echo "PCVisit-Umstellung erfolgreich.";
}