@echo off
cls
setLocal EnableDelayedExpansion

rem Set where this file will install the rest of the files
IF NOT "%1"=="" (
    SET "location=%1"
    SET install_location=!location:"=!
) else (
    SET "install_location=%APPDATA%\CIRCLE"
)
rem Set whether we want output info on screen or not
IF NOT "%2"=="" (
    SET "output_on_screen=%2"
) else (
    SET "output_on_screen=True"
)
rem Starting the uninstall script
IF NOT "!output_on_screen!"=="False" (
    @echo Starting CIRCLE Client uninstall script>CON
    @echo.>CON
)
@echo Starting CIRCLE Client uninstall script
@echo.
rem Get the running directory for later ease of use
SET running_directory=%~dp0
rem Check the install location whether it exists
if not exist "%install_location%\" (
    IF NOT "!output_on_screen!"=="False" (
        @echo Installation direcory not found^^! Please delete ^'CIRCLE^' direcory manually>CON
        pause
    )
    @echo Installation direcory not found^^! Please delete ^'CIRCLE^' direcory manually 1>&2
    goto end
)
IF NOT "!output_on_screen!"=="False" (
    @echo Installation direcory found at ^'%install_location%^'>CON
)
@echo Installation direcory found at ^'%install_location%^'
rem Delete files and directory
IF NOT "!output_on_screen!"=="False" (
    @echo Removing desktop icon>CON
)
@echo Removing desktop icon
call python "%install_location%\win_install.py" ^-r ^-l "%install_location%\\"
IF NOT "!output_on_screen!"=="False" (
    @echo 	Done>CON
)
@echo 	Done
:end