Created
March 23, 2020 02:47
-
-
Save uhziel/1a1e8708b9aabed29887d33474705fdf to your computer and use it in GitHub Desktop.
上传符号到自定义windows符号服务器,把文件夹拖动到此批处理文件上即可
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem 脚本传入参数(按顺序): <BIN_DIR> | |
setlocal EnableDelayedExpansion | |
rem echo BIN_DIR:%1 | |
rem =========== 配置 =========== | |
rem SYMSTOREPATH 符号服务器地址 | |
rem PRODUCT 你的产品名 | |
rem VERSION 你产品的版本 | |
rem COMMENT 你想加的注释 | |
rem TIMEOUT_DAYS 清理多少天前的符号 | |
set SYMSTOREPATH=\\zhulei\SymStore | |
set PRODUCT="foobar" | |
set VERSION="0.0.1" | |
set COMMENT="first commit" | |
set TIMEOUT_DAYS=60 | |
rem =========== 变量 =========== | |
set BIN_DIR=%~f1 | |
set SYMSTORE_EXE=symstore | |
set AGESTORE_EXE=agestore -y | |
rem =========== 代码 =========== | |
%SYMSTORE_EXE% > nul 2> nul | |
if [%ERRORLEVEL%] EQU [9009] ( | |
echo "symstore.exe 没找到,请包含它所在文件夹到PATH" | |
exit /b 0 | |
) | |
echo ============== 清除旧符号 ============== | |
echo 清除%TIMEOUT_DAYS%天前的符号 | |
%AGESTORE_EXE% -days=%TIMEOUT_DAYS% %SYMSTOREPATH% | |
echo. | |
echo =============== 上传符号 =============== | |
echo ++ 本地上传目录: %BIN_DIR% | |
echo ++ 符号服务器: %SYMSTOREPATH% | |
echo. | |
echo ++++++++ | |
echo ++ 上传exe到符号服务器 | |
%SYMSTORE_EXE% add /r /f %BIN_DIR%\*.exe /s %SYMSTOREPATH% /t %PRODUCT% /v %VERSION% /c %COMMENT% | |
echo. | |
echo ++++++++ | |
echo ++ 上传dll到符号服务器 | |
%SYMSTORE_EXE% add /r /f %BIN_DIR%\*.dll /s %SYMSTOREPATH% /t %PRODUCT% /v %VERSION% /c %COMMENT% | |
echo. | |
echo ++++++++ | |
echo ++ 上传pdb到符号服务器 | |
%SYMSTORE_EXE% add /r /f %BIN_DIR%\*.pdb /s %SYMSTOREPATH% /t %PRODUCT% /v %VERSION% /c %COMMENT% | |
echo. | |
echo ++ 上传成功!!!! | |
echo. | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment