首页 > Windows开发 > 详细

使用批处理打包C#开发程序

时间:2019-08-14 13:27:23      阅读:133      评论:0      收藏:0      [点我收藏+]

最近项目接近尾声,测试比较频繁,每天需要发布多个版本

@echo off
set zip=C:\Program Files\7-Zip\7z.exe
set timestamp=%date:~6,4%-%date:~0,2%-%date:~3,2%
set timestamp=%date:-=%
set tardir=%cd%\Car.App\bin
set src=%cd%\Car.App\bin\Releaseset src1=%src%Facility
set src2=%src%appsettings.json
set src3=%src%unity.config
set src4=%src%Car.*

echo 7z.exe "%zip%" 
echo "%src4%"
echo tardir "%tardir%\%timestamp%.zip"

"%zip%" a "%tardir%\Car.App_Release_%timestamp%_00_update.zip" "%src1%" "%src2%" "%src3%" "%src4%"
::"%zip%" a "%tardir%\Car.App_Release_%timestamp%_00_SDK.zip" "%src%*" -x!"%src1%" -x!"%src2%" -x!"%src3%" -x!"%src4%"

explorer "%tardir%"
::pause

 

测试Debug的打包

@echo off
set zip=C:\Program Files\7-Zip\7z.exe
set timestamp=%date:~6,4%-%date:~0,2%-%date:~3,2%
set timestamp=%date:-=%
set src=%cd%\Debug
echo 7z.exe : "%zip%" 
echo src : "%src%"
echo tardir : "%timestamp%.zip"
echo cd : %cd%

echo.
set fCount=0
for /f "delims=" %%i in (‘dir /b /a-d "%cd%\Debug_%timestamp%_*.zip"‘) do (set /a fCount+=1)
set /a fCount+=1

::"%zip%" a "%cd%\Debug_%timestamp%_%fCount%.zip" "%src%"

pause

 

使用批处理打包C#开发程序

原文:https://www.cnblogs.com/mq0036/p/11351311.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!