feat: 添加运行库安装脚本

This commit is contained in:
uye
2024-12-27 13:28:43 +08:00
parent 514c0b84b6
commit ff1a2ba955
2 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
@echo off
chcp 65001
:: 检查是否以管理员身份运行
openfiles >nul 2>&1
if %errorlevel% neq 0 (
echo 正在获取管理员权限...
powershell -Command "Start-Process cmd.exe -ArgumentList '/c %~0' -Verb RunAs"
exit /b
)
winget install "Microsoft.VCRedist.2015+.x64" --override "/repair /passive /norestart" --uninstall-previous --accept-package-agreements --force
winget install "Microsoft.DotNet.DesktopRuntime.8" --override "/repair /passive /norestart" --uninstall-previous --accept-package-agreements --force
echo 运行库修复完成,请重启电脑后再次尝试运行 MAA。
echo The runtime repair is complete. Please restart your computer and try running MAA again.
pause

View File

@@ -16,9 +16,13 @@
<ItemGroup>
<MaaResourceFiles Include="$(MSBuildProjectDirectory)\..\..\resource\**\*.*" />
<MaaPythonBinding Include="$(MSBuildProjectDirectory)\..\..\src\Python\**\*.*" />
<!-- 添加 DependencySetup_依赖库安装.bat 文件 -->
<DependencySetupFile Include="$(MSBuildProjectDirectory)\..\..\DependencySetup_依赖库安装.bat" />
</ItemGroup>
<Message Text="Copying resource files" Importance="High" />
<Copy SourceFiles="@(MaaResourceFiles)" DestinationFiles="$(MSBuildProjectDirectory)\..\..\$(Platform)\$(Configuration)\resource\%(RecursiveDir)%(Filename)%(Extension)" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />
<Copy SourceFiles="@(MaaPythonBinding)" DestinationFiles="$(MSBuildProjectDirectory)\..\..\$(Platform)\$(Configuration)\Python\%(RecursiveDir)%(Filename)%(Extension)" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />
<!-- 复制 DependencySetup_依赖库安装.bat 文件 -->
<Copy SourceFiles="@(DependencySetupFile)" DestinationFiles="$(MSBuildProjectDirectory)\..\..\$(Platform)\$(Configuration)\%(Filename)%(Extension)" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />
</Target>
</Project>