Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Mar 8, 2022
1 parent f51ce97 commit e202f4a
Show file tree
Hide file tree
Showing 30 changed files with 76 additions and 9 deletions.
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@

<!--Command Line Tools-->
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta3.22114.1" />
<PackageVersion Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-beta3.22114.1" />

<!-- Pinyin -->
<PackageVersion Include="TinyPinyin.Net" Version="1.0.2" />
Expand Down
2 changes: 1 addition & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ English | [简体中文](./README.md)
- [GitHub Releases](https://github.com/BeyondDimension/SteamTools/releases)
- [Gitee Releases](https://gitee.com/rmbgame/SteamTools/releases)
- [Official WebSite](https://steampp.net)
- [![Microsoft Store](./resources/MSStore_English.png)](https://www.microsoft.com/store/apps/9MTCFHS560NG)
- [![Microsoft Store](./resources/MSStore_English.png)](https://www.microsoft.com/store/apps/9PB0L9J4K006)
- [Arch Linux Package](https://aur.archlinux.org/packages/steam%2B%2B-bin)(By [zhanghua000](https://github.com/zhanghua000))

## ✨ Functions
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
- [GitHub Releases](https://github.com/BeyondDimension/SteamTools/releases)
- [Gitee Releases](https://gitee.com/rmbgame/SteamTools/releases)
- [Official WebSite](https://steampp.net)
- [![Microsoft Store](./resources/MSStore_English.png)](https://www.microsoft.com/store/apps/9MTCFHS560NG)
- [![Microsoft Store](./resources/MSStore_English.png)](https://www.microsoft.com/store/apps/9PB0L9J4K006)
- [Arch Linux Package](https://aur.archlinux.org/packages/steam%2B%2B-bin)(By [zhanghua000](https://github.com/zhanghua000))

## ✨ 功能
Expand Down
43 changes: 41 additions & 2 deletions src/Common.CoreLib/IOPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.IO;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Threading;
#if !NET35 && !NOT_XE
using System.Threading.Tasks;
Expand Down Expand Up @@ -180,19 +181,57 @@ protected static void InitFileSystemWithMigrations(
var old_paths = new[] { sourceAppDataPath, sourceCachePath, };
if (old_paths.All(x => Directory.Exists(x) && Directory.EnumerateFileSystemEntries(x).Any())) // 迁移之前根目录上的文件夹
{
var isNotFirst = false;
for (int i = 0; i < old_paths.Length; i++)
{
var path = paths[i];
var old_path = old_paths[i];
try
{
if (!isNotFirst)
{
try
{
// 尝试搜索之前版本的进程将其结束
var currentProcess = Process.GetCurrentProcess();
var query = from x in Process.GetProcessesByName(currentProcess.ProcessName)
where x != currentProcess
let m = x.TryGetMainModule()
where m != null && m.FileName != currentProcess.TryGetMainModule()?.FileName
select x;
var process = query.ToArray();
foreach (var proces in process)
{
try
{
#if NETCOREAPP3_0_OR_GREATER
proces.Kill(true);
#else
proces.Kill();
#endif
}
catch
{

}
}
}
catch
{

}
isNotFirst = true;
}
Directory.Move(old_path, path);
dict_paths[path] = true;
}
catch
{
// 跨卷移动失败或其他原因失败,使用旧的目录,并尝试删除创建的空文件夹
DirTryDelete(path);
if (!DesktopBridge.IsRunningAsUwp)
{
// 跨卷移动失败或其他原因失败,使用旧的目录,并尝试删除创建的空文件夹
DirTryDelete(path);
}
paths[i] = old_path;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
<AppxBundlePlatforms>x64</AppxBundlePlatforms>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
<PackageCertificateKeyFile>ST.Client.Desktop.Avalonia.App.Bridge.Package_TemporaryKey.pfx</PackageCertificateKeyFile>
<EntryPointProjectUniqueName>..\ST.Client.Desktop.Avalonia.App.Bridge\Steam++.csproj</EntryPointProjectUniqueName>
<PackageCertificateThumbprint>96028D399EC2DDDA358B18CD2A2669C4A0D6A862</PackageCertificateThumbprint>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AppxBundle>Always</AppxBundle>
Expand Down Expand Up @@ -157,7 +157,7 @@
<Content Include="Images\Wide310x150Logo.scale-150.png" />
<Content Include="Images\Wide310x150Logo.scale-200.png" />
<Content Include="Images\Wide310x150Logo.scale-400.png" />
<None Include="ST.Client.Desktop.Avalonia.App.Bridge.Package_TemporaryKey.pfx" />
<None Include="ST.Client.Avalonia.App.Bridge.Package_TemporaryKey.pfx" />
<None Include="Package.StoreAssociation.xml" />
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics;
using System.Runtime.Versioning;
using Windows.Storage;

Expand Down Expand Up @@ -27,6 +28,6 @@ internal static void InitFileSystem()
}

const string SOURCE_PACKAGE_ID = "4651ED44255E.47979655102CE_k6txddmbb6c52";
const string DEST_PACKAGE_ID = "31F8A90E.SteamforWindows";
const string DEST_PACKAGE_ID = "31F8A90E.SteamforWindows_0pj7be8rz1f1e";
}
}
6 changes: 5 additions & 1 deletion src/ST.Client.Desktop.Avalonia.App.Bridge/Steam++.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@
</AvaloniaResource>
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='Release'">
<ProjectReference Include="..\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Avalonia.Native\Avalonia.Native.csproj" />
<ProjectReference Include="..\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj" />
<ProjectReference Include="..\Avalonia.Themes.Fluent\Avalonia.Themes.Fluent.csproj" />
Expand Down Expand Up @@ -108,6 +111,7 @@

<ItemGroup>
<PackageReference Include="System.CommandLine" />
<PackageReference Include="System.CommandLine.NamingConventionBinder" />
</ItemGroup>

<ItemGroup Condition="Exists('$(MSBuildProjectDirectory)\..\..\aes-key.pfx')">
Expand Down
1 change: 1 addition & 0 deletions src/ST.Client.Desktop.Avalonia.App/CommandLineTools.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Application.Services;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.Threading.Tasks;
using LogLevel = Microsoft.Extensions.Logging.LogLevel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@

<ItemGroup>
<PackageReference Include="System.CommandLine" />
<PackageReference Include="System.CommandLine.NamingConventionBinder" />
</ItemGroup>

<ItemGroup Condition=" $(RuntimeIdentifier.Contains(`win`)) Or ('$(OS)' == 'Windows_NT' And !$(DefineConstants.Contains(`PUBLISH`))) ">
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Models/ToolConfig.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;

namespace System.Application.Models
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/ST.Tools.Publish.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
<ItemGroup>
<PackageReference Include="Squid-Box.SevenZipSharp.Lite" />
<PackageReference Include="System.CommandLine" />
<PackageReference Include="System.CommandLine.NamingConventionBinder" />
<PackageReference Include="TextCopy" />
<PackageReference Include="SharpZipLib" />
<PackageReference Include="Portable.BouncyCastle" />
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/Step12.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//using System.Collections.Generic;
//using System.CommandLine;
//using System.CommandLine.Invocation;
//using System.CommandLine.NamingConventionBinder;
//using System.IO;
//using System.Security.Cryptography;
//using static System.Application.Utils;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/StepAppHostPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Linq;
using static System.ProjectPathUtil;
using static System.Application.Utils;
using System.CommandLine.NamingConventionBinder;

namespace System.Application.Steps
{
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/StepReadMSALClientId.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using TextCopy;
using static System.Application.Utils;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/Step_cd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.Diagnostics;
using System.IO;
using System.Linq;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/Step_deb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using System.Linq;
using static System.Application.Utils;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/Step_packasfui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using System.Linq;
using System.Text;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/Step_readdesc.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using TextCopy;

namespace System.Application.Steps
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/Step_readrsa.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Application.Models;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using TextCopy;
using static System.Application.Utils;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/Step_rel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/Step_rpm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using System.Linq;
using static System.Application.Utils;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/Step_start.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/Step_sv.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using static System.Application.Utils;
using static System.ProjectPathUtil;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Publish/Steps/Step_tgz_7z_tbr.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Application.Models;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Translate/Commands/DelByKeyCommand.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//using System.Collections.Generic;
//using System.CommandLine;
//using System.CommandLine.Invocation;
//using System.CommandLine.NamingConventionBinder;
//using System.Linq;
//using System.Threading.Tasks;
//using static System.Constants;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Translate/Commands/ProofreadCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Translate/Commands/ReadCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using System.Text;
using System.Threading.Tasks;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Translate/Commands/WriteCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
Expand Down
1 change: 1 addition & 0 deletions src/ST.Tools.Translate/ST.Tools.Translate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<ItemGroup>
<PackageReference Include="NPOI" />
<PackageReference Include="System.CommandLine" />
<PackageReference Include="System.CommandLine.NamingConventionBinder" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v12.0</TargetFrameworkVersion>
<AndroidUseIntermediateDesignerFile>false</AndroidUseIntermediateDesignerFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down

0 comments on commit e202f4a

Please sign in to comment.