@echo off

rem this is the Windows script for installing the simHeaven_X-WORLD-Pro_Library

rem check if the library is correctly installed in Custom Scenery
if NOT EXIST "..\..\X-Plane.exe" goto :error

mklink /J  ".\XP12_libs" "..\..\Resources\default scenery"

if ERRORLEVEL 1 (
	if NOT EXIST ".\XP12_libs" (
		goto :error
	)
)

rem copy modified vegetation files to XP12 library
if EXIST mod (
	copy ".\mod\fal\*.*" "..\..\Resources\default scenery\1200 forests\fal"
	copy ".\mod\spr\*.*" "..\..\Resources\default scenery\1200 forests\spr"
	copy ".\mod\sum\*.*" "..\..\Resources\default scenery\1200 forests\sum"
	copy ".\mod\win\*.*" "..\..\Resources\default scenery\1200 forests\win"
	copy ".\mod\Boats_1.dds" "..\..\Resources\default scenery\sim objects\ships"
	)

echo .
echo the folder "mod" was copied to XP12 and the junctions 
echo to XP12 libraries and all files are successfully set
echo .
echo           press Enter to end this batch
echo .
pause


goto :eof


:error

echo .
echo *********************************************************************
echo ***                ERROR installing the library                   ***
echo ***                                                               ***
echo ***     Move the folder 'simHeaven_X-WORLD-Pro_Library' to        ***
echo ***       'X-Plane 12\Custom Scenery' and try again               ***
echo ***                                                               ***
echo ***               press Enter to end this batch                   ***
echo *********************************************************************
echo .
pause

goto :eof

