1 Star 0 Fork 0

布布子/MicaPackge

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.cmd 2.67 KB
一键复制 编辑 原始数据 按行查看 历史
布布子 提交于 2024-03-20 09:34 . init commit
@echo off
chcp 65001
set "micaPath=%CD%\Mica"
for /f "tokens=2 delims=: " %%a in ('findstr /r "executableName" "electron-builder.yml"') do (
set "executableName=%%a"
)
for /f "tokens=2 delims=: " %%a in ('findstr /r "productName" "electron-builder.yml"') do (
set "productName=%%a"
)
set "inputFile=%micaPath%\MicaSetup\Program_Example.cs"
set "outputFile=%micaPath%\MicaSetup\Program.cs"
(for /f "tokens=*" %%a in ('type "%inputFile%" ^| find /v ""') do (
set "line=%%a"
setlocal enabledelayedexpansion
set "modifiedLine=!line:MicaApp=%executableName%!"
echo !modifiedLine!
endlocal
)) > "%outputFile%"
set "inputFile=%micaPath%\MicaSetup\Program.un_Example.cs"
set "outputFile=%micaPath%\MicaSetup\Program.un.cs"
(for /f "tokens=*" %%a in ('type "%inputFile%" ^| find /v ""') do (
set "line=%%a"
setlocal enabledelayedexpansion
set "modifiedLine=!line:MicaApp=%executableName%!"
echo !modifiedLine!
endlocal
)) > "%outputFile%"
set "ResourcesPath=%micaPath%\MicaSetup\Resources\Images"
copy "%CD%\build\icon.ico" "%ResourcesPath%\Favicon.ico"
copy "%CD%\build\icon.png" "%ResourcesPath%\Favicon.png"
copy "%CD%\build\icon.png" "%ResourcesPath%\FaviconRaw.png"
copy "%CD%\build\logo-ins.ico" "%ResourcesPath%\FaviconSetup.ico"
copy "%CD%\build\logo-ins.png" "%ResourcesPath%\FaviconSetup.png"
copy "%CD%\build\logo-uins.ico" "%ResourcesPath%\FaviconUninst.ico"
copy "%CD%\build\logo-uins.png" "%ResourcesPath%\FaviconUninst.png"
@REM cmd /c "npm run build:win"
"%micaPath%/MicaSetup.Tools\7-Zip\7z" a "%micaPath%\MicaSetup\Resources\Setups\publish.7z" "%CD%\dist\win-unpacked\*" -t7z -mx=5 -mf=BCJ2 -r -y
set "RootPath=%CD%"
cd /d "%micaPath%"
echo [trim font using fonttools]
cd /d .\MicaSetup.Tools\MicaFontTrim
cd subset
del subset.txt
dotnet run
cd ..
del HarmonyOS_Sans_SC_Regular.ttf
fonttools subset "fonts/HarmonyOS_Sans_SC_Regular.ttf" --text-file="subset/subset.txt" --output-file="HarmonyOS_Sans_SC_Regular.ttf"
copy /y HarmonyOS_Sans_SC_Regular.ttf ..\..\MicaSetup\Resources\Fonts\HarmonyOS_Sans_SC_Regular.ttf
cd /d "%micaPath%"
@echo [build uninst using vs2022]
msbuild MicaSetup\MicaSetup.Uninst.csproj /t:Rebuild /p:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=FolderProfile /restore
@echo [build setup using vs2022]
copy /y .\MicaSetup\bin\Release\net472\MicaSetup.exe .\MicaSetup\Resources\Setups\Uninst.exe
msbuild MicaSetup\MicaSetup.csproj /t:Build /p:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=FolderProfile /restore
@echo [finish]
copy /y .\MicaSetup\bin\Release\net472\MicaSetup.exe "%RootPath%\dist\%productName% Setup.exe"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bubuzi/mica-packge.git
git@gitee.com:bubuzi/mica-packge.git
bubuzi
mica-packge
MicaPackge
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385