fix(null): null

This commit is contained in:
chenyf 2025-02-10 11:12:08 +08:00
commit be31b59f06
4 changed files with 153 additions and 0 deletions

12
install.bat Normal file
View File

@ -0,0 +1,12 @@
:: 检查下是否有git命令
where git >nul 2>nul
if %errorlevel% neq 0 (
msg * "没有找到git命令请安装git后再运行此脚本,请手动执行install_env.bat."
pause
exit
)
:: 调用 install_maco.bat
call install_maco.bat
:: 调用 install_maco_cshart.bat
call install_maco_cshart.bat

2
install_env.bat Normal file
View File

@ -0,0 +1,2 @@
msg * "请在网页中下载git软件并安装安装选项均设置为默认即可"
start http://chenyf123.top:1000/#s/_RHUzZ-Q

70
install_maco_cshart.bat Normal file
View File

@ -0,0 +1,70 @@
@echo off
setlocal enabledelayedexpansion
:: 设置Git仓库URL
set repo_url=http://chenyf123.top:1030/chenyf/fcma_csharp_maco.git
set release_url=%repo_url%/releases/download
set download_file=app_data.zip
set local_tag_path=maco_csharp_tag
:: app目录
set target_dir=app
:: 检查下是否有git命令
where git >nul 2>nul
if %errorlevel% neq 0 (
msg * "没有找到git命令请安装git后再运行此脚本,请手动执行install_env.bat."
pause
exit
)
if not exist %target_dir% mkdir %target_dir%
if not exist %local_tag_path% mkdir %local_tag_path%
:: 获取 Git 仓库的tag 列表
git ls-remote --tags %repo_url% > %local_tag_path%\orign_tags.txt
:: 读取最新tag名称
for /f "tokens=3 delims=/" %%i in (%local_tag_path%\orign_tags.txt) do set latest_tag_name=%%i
echo latest_tag_name=%latest_tag_name%
set local_tags=
:: 检查是否有本地版本文件 local_tags.txt
if exist %local_tag_path%\local_tags.txt (
:: 读取本地版本文件中的tag信息
set /p local_tags=<%local_tag_path%\local_tags.txt
)
echo local_tags=%local_tags%
::检查是否有新版本
if "%local_tags%"=="" (
:: 没有本地版本文件直接拉取最新的release文件
echo 没有本地版本文件直接拉取最新的release文件
goto :func_download_app
) else (
:: 有本地版本文件,检查是否有新版本
if "%local_tags%"=="%latest_tag_name%" (
echo 本地版本已是最新版本
goto :func_end
) else (
echo 有新版本,准备下载
goto :func_clean_local_app
)
)
:func_clean_local_app
del /s /q %target_dir%
:func_download_app
echo download_url=%release_url%/%latest_tag_name%/%download_file%
curl -o %target_dir%\%download_file% -L %release_url%/%latest_tag_name%/%download_file%
:: 解压文件到app目录
powershell -Command "Expand-Archive -Path %target_dir%/%download_file% -DestinationPath %target_dir%"
::删除下载的zip文件
del %target_dir%\%download_file%
:: 更新本地版本文件
echo %latest_tag_name%>%local_tag_path%\local_tags.txt
goto :func_end
:func_end
pause

69
install_maco_qt.bat Normal file
View File

@ -0,0 +1,69 @@
@echo off
setlocal enabledelayedexpansion
:: 设置Git仓库URL
set repo_url=http://chenyf123.top:1030/chenyf/fcma_qt_maco.git
set release_url=%repo_url%/releases/download
set download_file=app_data.zip
set local_tag_path=maco_qt_tag
:: app目录
set target_dir=app
:: 检查下是否有git命令
where git >nul 2>nul
if %errorlevel% neq 0 (
msg * "没有找到git命令请安装git后再运行此脚本,请手动执行install_env.bat."
pause
exit
)
if not exist %target_dir% mkdir %target_dir%
if not exist %local_tag_path% mkdir %local_tag_path%
set latest_tag_name=
:: 获取 Git 仓库的tag 列表
git ls-remote --tags %repo_url% > %local_tag_path%\orign_tags.txt
:: 读取最新tag名称
for /f "tokens=3 delims=/" %%i in (%local_tag_path%\orign_tags.txt) do set latest_tag_name=%%i
echo latest_tag_name=%latest_tag_name%
set local_tags=
:: 检查是否有本地版本文件 local_tags.txt
if exist %local_tag_path%\local_tags.txt (
:: 读取本地版本文件中的tag信息
set /p local_tags=<%local_tag_path%\local_tags.txt
)
echo local_tags=%local_tags%
::检查是否有新版本
if "%local_tags%"=="" (
:: 没有本地版本文件直接拉取最新的release文件
echo 没有本地版本文件直接拉取最新的release文件
goto :func_download_app
) else (
:: 有本地版本文件,检查是否有新版本
if "%local_tags%"=="%latest_tag_name%" (
echo 本地版本已是最新版本
goto :func_end
) else (
echo 有新版本,准备下载
goto :func_clean_local_app
)
)
:func_clean_local_app
del /s /q %target_dir%
:func_download_app
echo download_url=%release_url%/%latest_tag_name%/%download_file%
curl -o %target_dir%\%download_file% -L %release_url%/%latest_tag_name%/%download_file%
:: 解压文件到app目录
powershell -Command "Expand-Archive -Path %target_dir%/%download_file% -DestinationPath %target_dir%"
::删除下载的zip文件
del %target_dir%\%download_file%
:: 更新本地版本文件
echo %latest_tag_name%>%local_tag_path%\local_tags.txt
goto :func_end
:func_end
pause