IFWINDOWEXIST "iGO 8"
	Sleep "1000"
	NFRUNAGAIN
ENDIF

#DEBUG

setvar "content" "$2$\content\"
setvar "savedir" "$2$\save\"

IF "@STRLEN("$3$") = 0"
	setvar "systxt" "$2$\sys.txt"
ELSE
	setvar "systxt" "$3$\sys.txt"
ENDIF

setvar "poiswitch" "@READINI($systxt$,switchmap,poiswitch,0)"
setvar "poiprovider" "poi@STRCOPY("$1$",4,3)"

msg "p1:$1$, p2:$2$, p3:$3$, systxt:$systxt$, poiswitch:$poiswitch$, poiprovider:$poiprovider$, content:$content$"

IFFILEEXIST "$content$map_ta"
ELSE
	MOVE "$content$map" "$content$map_ta"
	IFFILEEXIST "$savedir$ROADBLOCKS.sav"
		MOVE "$savedir$ROADBLOCKS.sav" "$savedir$ROADBLOCKS.map_ta"
	ENDIF
	IF "$poiswitch$=1"
		IFFILEEXIST "$content$poi"
			Sleep "500"
			MOVE "$content$poi" "$content$poi_ta"
			msg "ta, $content$poi, $content$poi_ta"
		ENDIF
	ENDIF
ENDIF

IFFILEEXIST "$content$map_nt"
ELSE
	MOVE "$content$map" "$content$map_nt"
	IFFILEEXIST "$savedir$ROADBLOCKS.sav"
		MOVE "$savedir$ROADBLOCKS.sav" "$savedir$ROADBLOCKS.map_nt"
	ENDIF
	IF "$poiswitch$=1"
		IFFILEEXIST "$content$poi"
			Sleep "500"
			MOVE "$content$poi" "$content$poi_nt"
			msg "nt, $content$poi, $content$poi_nt"
		ENDIF
	ENDIF
ENDIF

IFFILEEXIST "$content$map_ot"
ELSE
	MOVE "$content$map" "$content$map_ot"
	IFFILEEXIST "$savedir$ROADBLOCKS.sav"
		MOVE "$savedir$ROADBLOCKS.sav" "$savedir$ROADBLOCKS.map_ot"
	ENDIF
	IF "$poiswitch$=1"
		IFFILEEXIST "$content$poi"
			Sleep "500"
			MOVE "$content$poi" "$content$poi_ot"
			msg "ot, $content$poi, $content$poi_ot"
		ENDIF
	ENDIF
ENDIF

IFFILEEXIST "$content$map_us"
ELSE
	MOVE "$content$map" "$content$map_us"
	IFFILEEXIST "$savedir$ROADBLOCKS.sav"
		MOVE "$savedir$ROADBLOCKS.sav" "$savedir$ROADBLOCKS.map_us"
	ENDIF
	IF "$poiswitch$=1"
		IFFILEEXIST "$content$poi"
			Sleep "500"
			MOVE "$content$poi" "$content$poi_us"
			msg "us, $content$poi, $content$poi_us"
		ENDIF
	ENDIF
ENDIF

IFFILEEXIST "$content$$1$"
	MOVE "$content$$1$" "$content$map"
	IFFILEEXIST "$savedir$ROADBLOCKS.$1$"
		MOVE "$savedir$ROADBLOCKS.$1$" "$savedir$ROADBLOCKS.sav"
	ENDIF
	IF "$poiswitch$=1"
		IFFILEEXIST "$content$$poiprovider$"
			Sleep "500"
			MOVE "$content$$poiprovider$" "$content$poi"
		ENDIF
	ENDIF
ENDIF

Sleep "1000"

IF "@STRLEN("$3$") = 0"
	RUN "$2$\iGO8.exe"
ELSE
	RUN "$3$\iGO8.exe"
ENDIF
QUIT

