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