Skip to content

Commit

Permalink
Add Mile.Aria2 Nuget Package
Browse files Browse the repository at this point in the history
Add Mile.Aria2 Nuget Package
  • Loading branch information
Gaoyifei1011 committed Apr 8, 2023
1 parent f552866 commit d087599
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 44 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<!--从兼容性考虑,继续向上搜索 Directory.Build.props-->
<PropertyGroup>
<NoWarn>CA1069;CA1401;CA1416;CA1822;CA2211;IDE0090;IL2050;IL2070;MSB4018;NU1201;NU1702</NoWarn>
<NoWarn>CA1069;CA1401;CA1416;CA1822;CA2211;CS0649;IDE0090;IL2050;IL2070;MSB4018;NU1201;NU1702</NoWarn>
<DirectoryBuildPropsPath>$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))</DirectoryBuildPropsPath>
</PropertyGroup>
<Import Project="$(DirectoryBuildPropsPath)" Condition="'$(DirectoryBuildPropsPath)' != ''"/>
Expand Down
Binary file removed GetStoreApp/Aria2/Mile.Aria2.ARM64.exe
Binary file not shown.
Binary file removed GetStoreApp/Aria2/Mile.Aria2.X64.exe
Binary file not shown.
Binary file removed GetStoreApp/Aria2/Mile.Aria2.X86.exe
Binary file not shown.
22 changes: 4 additions & 18 deletions GetStoreApp/GetStoreApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<EnableMsixTooling>false</EnableMsixTooling>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<FileAlignment>512</FileAlignment>
<FileVersion>1.4.405.0</FileVersion>
<FileVersion>1.4.408.0</FileVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
Expand Down Expand Up @@ -43,7 +43,7 @@
<TargetFramework>net7.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<TrimMode>partial</TrimMode>
<Version>1.4.405.0</Version>
<Version>1.4.408.0</Version>
<UseWindowsForms>False</UseWindowsForms>
<UseWinUI>true</UseWinUI>
<UseWPF>False</UseWPF>
Expand Down Expand Up @@ -88,24 +88,9 @@
<DependentUpon>Resources.resx</DependentUpon>
</Compile>

<Content Include="Aria2\Aria2c.conf">
<Content Include="Mile.Aria2.conf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Aria2\Mile.Aria2.ARM64.exe" Link="Aria2\Mile.Aria2.exe">
<CopyToOutputDirectory Condition="'$(Platform)'=='x86'">Never</CopyToOutputDirectory>
<CopyToOutputDirectory Condition="'$(Platform)'=='x64'">Never</CopyToOutputDirectory>
<CopyToOutputDirectory Condition="'$(Platform)'=='ARM64'">Always</CopyToOutputDirectory>
</Content>
<Content Include="Aria2\Mile.Aria2.X64.exe" Link="Aria2\Mile.Aria2.exe">
<CopyToOutputDirectory Condition="'$(Platform)'=='x86'">Never</CopyToOutputDirectory>
<CopyToOutputDirectory Condition="'$(Platform)'=='x64'">Always</CopyToOutputDirectory>
<CopyToOutputDirectory Condition="'$(Platform)'=='ARM64'">Never</CopyToOutputDirectory>
</Content>
<Content Include="Aria2\Mile.Aria2.X86.exe" Link="Aria2\Mile.Aria2.exe">
<CopyToOutputDirectory Condition="'$(Platform)'=='x86'">Always</CopyToOutputDirectory>
<CopyToOutputDirectory Condition="'$(Platform)'=='x64'">Never</CopyToOutputDirectory>
<CopyToOutputDirectory Condition="'$(Platform)'=='ARM64'">Never</CopyToOutputDirectory>
</Content>

<Content Remove="Assets\ControlIcon\About.png" />
<Content Remove="Assets\ControlIcon\Download.png" />
Expand Down Expand Up @@ -300,6 +285,7 @@
</ApplicationDefinition>

<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.230313.1" />
<PackageReference Include="Mile.Aria2" Version="1.0.8" />

<Page Update="Styles\Button.xaml">
<Generator>MSBuild:Compile</Generator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 如果Aria2程序无法正常下载,可能是应用配置文件出现了问题。建议您删除该文件,在应用程序下次启动时会生成默认的配置文件

# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc
# 预分配所需时间: none < falloc ? trunc < prealloc
# 预分配所需时间: none < falloc < trunc < prealloc
# falloc 和 trunc 则需要文件系统和内核支持
# NTFS 建议使用 falloc, EXT3/4 建议 trunc, MAC 下需要注释此项
file-allocation=none
Expand Down
4 changes: 2 additions & 2 deletions GetStoreApp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.4.405.0")]
[assembly: AssemblyFileVersion("1.4.405.0")]
[assembly: AssemblyVersion("1.4.408.0")]
[assembly: AssemblyFileVersion("1.4.408.0")]
4 changes: 2 additions & 2 deletions GetStoreApp/Services/Controls/Download/Aria2Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ namespace GetStoreApp.Services.Controls.Download
/// </summary>
public static class Aria2Service
{
private static string Aria2FilePath { get; } = string.Format(@"{0}\{1}", InfoHelper.GetAppInstalledLocation(), @"Aria2\Mile.Aria2.exe");
private static string Aria2FilePath { get; } = string.Format(@"{0}\{1}", InfoHelper.GetAppInstalledLocation(), @"Mile.Aria2.exe");

private static string DefaultAria2ConfPath { get; } = string.Format(@"{0}\{1}", InfoHelper.GetAppInstalledLocation(), @"Aria2\Aria2c.conf");
private static string DefaultAria2ConfPath { get; } = string.Format(@"{0}\{1}", InfoHelper.GetAppInstalledLocation(), @"Mile.Aria2.conf");

public static string Aria2ConfPath { get; } = string.Format(@"{0}\{1}", ApplicationData.Current.LocalFolder.Path, "Aria2.conf");

Expand Down
6 changes: 0 additions & 6 deletions GetStoreApp/Services/Root/DesktopLaunchService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ private static async Task InitializeStartupKindAsync()
ParseLaunchArgs();
break;
}
// 使用 Protocol协议启动
case ExtendedActivationKind.Protocol:
{
NeedToSendMesage = 0;
break;
}
// 使用共享目标方式启动
case ExtendedActivationKind.ShareTarget:
{
Expand Down
2 changes: 1 addition & 1 deletion GetStoreApp/Services/Shell/DownloadService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private static unsafe void DownloadFile(string fileLink)
null,
string.Format(
@"{0}\{1} --file-allocation=none -d ""{2}"" ""{3}""",
InfoHelper.GetAppInstalledLocation(), @"Aria2\Mile.Aria2.exe",
InfoHelper.GetAppInstalledLocation(), @"Mile.Aria2.exe",
DownloadOptionsService.DownloadFolder.Path, fileLink
),
IntPtr.Zero,
Expand Down
2 changes: 1 addition & 1 deletion GetStoreAppHelper/GetStoreAppHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<DisableXbfLineInfo>False</DisableXbfLineInfo>
<EnableTypeInfoReflection>true</EnableTypeInfoReflection>
<FileAlignment>512</FileAlignment>
<FileVersion>1.4.405.0</FileVersion>
<FileVersion>1.4.408.0</FileVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<LangVersion>latest</LangVersion>
<OutputType>WinExe</OutputType>
Expand Down
4 changes: 2 additions & 2 deletions GetStoreAppHelper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.4.405.0")]
[assembly: AssemblyFileVersion("1.4.405.0")]
[assembly: AssemblyVersion("1.4.408.0")]
[assembly: AssemblyFileVersion("1.4.408.0")]
12 changes: 2 additions & 10 deletions GetStoreAppPackage/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Identity
Name="Gaoyifei1011.GetStoreApp"
Publisher="CN=高怡飞"
Version="1.4.405.0" />
Version="1.4.408.0" />

<Properties>
<DisplayName>ms-resource:PackageDisplayName</DisplayName>
Expand Down Expand Up @@ -51,14 +51,6 @@
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<!--通过协议方式启动-->
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="getstoreapp">
<uap:Logo>Assets\StoreLogo.png</uap:Logo>
<uap:DisplayName>ms-resource:ProtocolName</uap:DisplayName>
</uap:Protocol>
</uap:Extension>

<!--共享目标-->
<uap:Extension Category="windows.shareTarget" Executable="GetStoreApp.exe" EntryPoint="Windows.FullTrustApplication">
<uap:ShareTarget>
Expand Down Expand Up @@ -92,7 +84,7 @@
<Extensions>
<!--Mile.Aria2.exe进程预定义的防火墙规则-->
<desktop2:Extension Category="windows.firewallRules">
<desktop2:FirewallRules Executable="Aria2/Mile.Aria2.exe">
<desktop2:FirewallRules Executable="Mile.Aria2.exe">
<desktop2:Rule Direction="in" IPProtocol="TCP" Profile="all"/>
<desktop2:Rule Direction="in" IPProtocol="UDP" Profile="all"/>
</desktop2:FirewallRules>
Expand Down

0 comments on commit d087599

Please sign in to comment.