mirror of
https://github.com/MeexReay/bRAC.git
synced 2025-05-05 21:18:02 +03:00
install and uninstall bat
This commit is contained in:
parent
e55d5a7a55
commit
2a3473853b
2
Makefile
2
Makefile
@ -18,6 +18,8 @@ build/windows-x86_64:
|
||||
mv $@/bin/* $@/
|
||||
cp target/x86_64-pc-windows-gnu/release/bRAC.exe $@
|
||||
rm -r $@/bin
|
||||
cp install.bat $@
|
||||
cp uninstall.bat $@
|
||||
|
||||
build/linux-x86_64:
|
||||
mkdir -p build
|
||||
|
30
install.bat
Normal file
30
install.bat
Normal file
@ -0,0 +1,30 @@
|
||||
@echo off
|
||||
net session >nul 2>&1 || (
|
||||
echo This script requires administrator privileges.
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
|
||||
set "DEST=C:\Program Files\bRAC"
|
||||
mkdir "%DEST%" 2>nul
|
||||
xcopy "." "%DEST%\" /E /I /H /Y >nul
|
||||
|
||||
for /d %%u in ("C:\Users\*") do (
|
||||
if exist "%%u\AppData\Roaming\Microsoft\Windows\Desktop" (
|
||||
call :s "%%u\AppData\Roaming\Microsoft\Windows\Desktop\bRAC.lnk" "%DEST%\bRAC.exe"
|
||||
) else if exist "%%u\Desktop" (
|
||||
call :s "%%u\Desktop\bRAC.lnk" "%DEST%\bRAC.exe"
|
||||
)
|
||||
)
|
||||
exit /b
|
||||
|
||||
:s
|
||||
set "v=%TEMP%\_s.vbs"
|
||||
> "%v%" echo Set o=CreateObject("WScript.Shell")
|
||||
>>"%v%" echo Set l=o.CreateShortcut("%~1")
|
||||
>>"%v%" echo l.TargetPath="%~2"
|
||||
>>"%v%" echo l.WorkingDirectory="%~dp2"
|
||||
>>"%v%" echo l.Save
|
||||
wscript "%v%" >nul
|
||||
del "%v%" >nul
|
||||
exit /b
|
35
uninstall.bat
Normal file
35
uninstall.bat
Normal file
@ -0,0 +1,35 @@
|
||||
@echo off
|
||||
net session >nul 2>&1 || (
|
||||
echo This script requires administrator privileges.
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
|
||||
set "TARGET=C:\Program Files\bRAC\bRAC.exe"
|
||||
|
||||
for /d %%u in ("C:\Users\*") do (
|
||||
call :d "%%u\AppData\Roaming\Microsoft\Windows\Desktop"
|
||||
call :d "%%u\Desktop"
|
||||
)
|
||||
|
||||
cd /d "%TEMP%"
|
||||
rmdir /s /q "C:\Program Files\bRAC"
|
||||
exit /b
|
||||
|
||||
:d
|
||||
if not exist "%~1" exit /b
|
||||
for %%f in ("%~1\*.lnk") do (
|
||||
call :c "%%~f"
|
||||
)
|
||||
exit /b
|
||||
|
||||
:c
|
||||
set "v=%TEMP%\_c.vbs"
|
||||
> "%v%" echo Set o=CreateObject("WScript.Shell")
|
||||
>>"%v%" echo Set l=o.CreateShortcut("%~1")
|
||||
>>"%v%" echo WScript.Echo l.TargetPath
|
||||
for /f "usebackq delims=" %%t in (`wscript //nologo "%v%"`) do (
|
||||
if /I "%%t"=="%TARGET%" del /f /q "%~1"
|
||||
)
|
||||
del "%v%" >nul
|
||||
exit /b
|
Loading…
Reference in New Issue
Block a user