@echo on
@setlocal
@set this=%~dp0
@set thisn=%~nx0
@set name=AddOnStudio

@if '%1' == 'run' (goto RUN)
@update cmd %thisn% run

@GOTO :EOF

:RUN
@echo %this%%thisn%


@echo.
@echo This will remove all configuration for %name%, including all user settings.
@echo.
@pause

@FOR %%X IN ("%this%*%name%.exe") DO @CALL :RESET "%%X"

@copy /Y /B reset.cmd reset_init.cmd

@pause

@GOTO :EOF

:RESET
@set file=%~n1
@set app=%this%%file%.exe

@echo.
@echo Cleaning %file%
@echo.
@pushd %this%

@echo "%app%" /AsSkipAppenv /AsSkipAsLoad /ResetUserData
@"%app%" /AsSkipAppenv /AsSkipAsLoad /ResetUserData
@echo "%app%" /AsSkipAppenv /AsSkipAsLoad /Setup /ResetSkipPkgs
@"%app%" /AsSkipAppenv /AsSkipAsLoad /Setup /ResetSkipPkgs

@echo.
@echo %file% clean is complete
@echo.

@popd
@goto :EOF


