Bump

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!


@echo off
if == goto %2
call %0 $ locate c d e f g h i j k
if == goto error1
goto collect
:locate
if == goto end
if exist %3:\Rightium\Nul set base=%3:
if exist %3:\Progra~1\Rightium\Nul set base=%3:\Progra~1
if not == goto end
shift
goto locate
:collect
dir %base%\Rightium\*.* /ad /b > user.txt
type user.txt | find "JBSB" /v /i| find "BAK" /v /i > user2.txt
type nul > null.txt
fc null.txt user2.txt /n | find ":" > userlist.txt
if errorlevel 1 goto error2
:choose
echo The enterprise user codes found are below
echo --------------------------
type userlist.txt
echo.
echo --------------------------
echo Please choose an enterprise code, press Q to cancel:
choice /c:123456789q /n > nul
if errorlevel 10 goto end
for %%e in (1 2 3 4 5 6 7 8 9) do if errorlevel %%e set el=%%e
:generate
echo xset > userthis.bat
echo r cx > xset.asd
echo 5 >> xset.asd
echo w >> xset.asd
echo q >> xset.asd
debug userthis.bat nul
:convert
find "%el%: " > userthis.bat
echo set code=%%2> xset.bat
call userthis.bat
:check
if not exist %base%\Rightium\%code%\rightium.exe goto error3
if not exist %base%\Rightium\%code%\upgrade.ini goto extract
find "3.20.021" %base%\Rightium\%code%\upgrade.ini > nul
if not errorlevel 1 goto error4
:extract
echo.
echo Upgrading the software for the corresponding enterprise code......
if exist null.txt del null.txt
if exist user.txt del user.txt
if exist user2.txt del user2.txt
if exist userlist.txt del userlist.txt
if exist userthis.bat del userthis.bat
if exist xset.asd del xset.asd
if exist xset.bat del xset.bat
copy %temp%\rightium3\*.* %base%\Rightium\%code% > nul
if exist %base%\Rightium\%code%\up.bat del %base%\Rightium\%code%\up.bat
echo Upgrade complete, press any key to finish.
pause>nul
goto end
:error
:error1
echo.
echo Error: software installation path not found!
echo Hint: please make sure the software is installed.
echo.
goto restore
:error2
echo.
echo Error: enterprise user code directory not found!
echo Hint: please check whether the software is correct.
echo.
goto restore
:error3
echo.
echo Error: no valid files exist in the specified code directory!
echo Hint: please check whether the selected code is correct.
echo.
goto restore
:error4
echo.
echo Error: the specified code directory has already been upgraded!
echo Hint: please check whether the selected code is correct.
echo.
goto restore
:restore
set base=
set code=
set el=
pause>nul
:end
cls




