代码拉取完成,页面将自动刷新
@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"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。