Skip to content

Commit cb5025a

Browse files
authored
[Hotfix] Stable 1.82.29 Release (#780)
# What's changed? - **[Fix]** Deprecating CODING CDN and Replace it with CNB CDN (Cloud Native Build by Tencent Cloud Computing (Beijing) Co., Ltd) for Mainland China users, by @shatyuka [**Click here**](https://docs.cnb.cool/en/saas/privacy.html) to see details about its Privacy Policy (in Simplified Chinese). - **[Fix]** Fix FileNotFoundException while changing HDR Settings on Genshin Impact GSP, by @shatyuka - **[Imp]** Accept the use of Symbolic Links on Zip package installation mode, by @bagusnl - **[Fix]** Fix game priority booster returning error on success operations, by @bagusnl - **[Imp]** Update NuGet Packages, by @bagusnl, @neon-nyan - Microsoft.Extensions.DependencyInjection.Abstractions: 9.0.5 -> 9.0.6 - Microsoft.Extensions.Logging.Abstractions: 9.0.5 -> 9.0.6 - Markdig.Signed: 0.41.2 -> 0.41.3 - System.Security.Cryptography.ProtectedData: 9.0.5 -> 9.0.6 - System.Text.Encoding.CodePages: 9.0.5 -> 9.0.6 - System.Text.Json: 9.0.5 -> 9.0.6 - **[Fix]** Unmatched download size + ZZZ Sophon issue, by @neon-nyan, - **[Fix]** @DisableSophon and Disabling Sophon on Settings won't work, by @neon-nyan, - **[Loc]** Update Localizations for zh_CN, es_es/419, ja_JP, by Localizers ### Templates <details> <summary>Changelog Prefixes</summary> ``` **[New]** **[Imp]** **[Fix]** **[Loc]** **[Doc]** ``` </details>
2 parents 709a183 + 05ea274 commit cb5025a

32 files changed

+365
-134
lines changed

CollapseLauncher/Classes/GameManagement/Versioning/GameVersionBase.GameState.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,7 @@ public virtual async ValueTask<List<RegionResourcePlugin>> CheckPluginUpdate(str
539539
return null;
540540
}
541541

542-
public virtual bool IsForceRedirectToSophon()
543-
{
544-
return GamePreset.GameLauncherApi?.IsForceRedirectToSophon ?? false;
545-
}
542+
public virtual bool IsForceRedirectToSophon() => GamePreset.GameLauncherApi?.IsForceRedirectToSophon ?? false;
546543
#endregion
547544
}
548545
}

CollapseLauncher/Classes/Helper/StreamUtility/StreamExtension.cs

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,13 @@ private static string StripAlternateDataStream(string path)
223223
return match.Success ? match.Groups["path"].Value : path;
224224
}
225225

226+
227+
/// <summary>
228+
/// Strips the alternate data stream from a file path.
229+
/// <para> e.g. "C:\path\to\file.txt:stream" becomes "C:\path\to\file.txt". </para>
230+
/// </summary>
231+
/// <param name="fileInfo">FileInfo to be stripped</param>
232+
/// <returns>FileInfo instance with ADS stripped if detected, returns original if the input doesn't use ADS or there's an error with the process.</returns>
226233
public static FileInfo StripAlternateDataStream(this FileInfo fileInfo)
227234
{
228235
try
@@ -241,7 +248,40 @@ public static FileInfo StripAlternateDataStream(this FileInfo fileInfo)
241248
return fileInfo; // Return original FileInfo if any error occurs
242249
}
243250
}
251+
252+
253+
/// <summary>
254+
/// Resolves the symlink of a FileInfo instance.
255+
/// <para>Detects if the file has ReparsePoint attribute and resolve the target file path.</para>
256+
/// </summary>
257+
/// <param name="fileInfo">FileInfo to be resolved.</param>
258+
/// <returns>Instance of FileInfo to the resolved symlink file.</returns>
259+
/// <exception cref="FileNotFoundException">Target file of the symlink does not exist.</exception>
260+
public static FileInfo ResolveSymlink(this FileInfo fileInfo)
261+
{
262+
if (!fileInfo.Attributes.HasFlag(FileAttributes.ReparsePoint))
263+
return fileInfo;
264+
265+
try
266+
{
267+
var target = new FileInfo(fileInfo.LinkTarget!);
268+
if (!target.Exists)
269+
{
270+
throw new
271+
FileNotFoundException($"[StreamExtension] Target symlink {target.FullName} for {fileInfo.FullName} does not exist.");
272+
}
273+
274+
Logger.LogWriteLine($"[StreamExtension] Resolved symlink: {fileInfo.FullName} -> {target.FullName}",
275+
LogType.Default, true);
276+
return target;
277+
}
278+
catch (Exception ex)
279+
{
280+
Logger.LogWriteLine($"[StreamExtension] Failed to resolve symlink for {fileInfo.FullName}\r\n{ex}",
281+
LogType.Error, true);
282+
SentryHelper.ExceptionHandler(ex);
283+
throw;
284+
}
285+
}
244286
}
245-
246-
247287
}

CollapseLauncher/Classes/InstallManagement/Base/GameInstallPackage.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Hi3Helper;
1+
using CollapseLauncher.Helper.StreamUtility;
2+
using Hi3Helper;
23
using Hi3Helper.Data;
34
using Hi3Helper.EncTool;
45
using Hi3Helper.Http.Legacy;
@@ -124,7 +125,7 @@ public bool IsReadStreamExist(int count)
124125
public Stream GetReadStream(int count)
125126
{
126127
// Get the file info of the single file
127-
FileInfo fileInfo = new FileInfo(PathOutput!);
128+
FileInfo fileInfo = new FileInfo(PathOutput!).ResolveSymlink();
128129
// Check if the file exist and the length is equal to the size
129130
if (fileInfo.Exists && fileInfo.Length == Size)
130131
{

CollapseLauncher/Classes/InstallManagement/Base/InstallManagerBase.Sophon.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,23 @@ public virtual bool IsUseSophon
8686
{
8787
get
8888
{
89+
if ((_canDeltaPatch && !_forceIgnoreDeltaPatch) || GameVersionManager.GamePreset.LauncherResourceChunksURL == null)
90+
{
91+
return false;
92+
}
93+
8994
bool isForceRedirect = GameVersionManager.IsForceRedirectToSophon();
90-
bool isEnabled = GameVersionManager.GamePreset.LauncherResourceChunksURL != null
91-
&& !File.Exists(Path.Combine(GamePath, "@DisableSophon"))
92-
&& !_canDeltaPatch
93-
&& !_forceIgnoreDeltaPatch
94-
&& LauncherConfig.GetAppConfigValue("IsEnableSophon").ToBool();
95+
if (!isForceRedirect && File.Exists(Path.Combine(GamePath, "@DisableSophon")))
96+
{
97+
return false;
98+
}
99+
100+
if (!isForceRedirect && !LauncherConfig.GetAppConfigValue("IsEnableSophon"))
101+
{
102+
return false;
103+
}
95104

96-
return isForceRedirect || isEnabled;
105+
return true;
97106
}
98107
}
99108

CollapseLauncher/Classes/InstallManagement/Base/InstallManagerBase.SophonPatch.cs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ protected async Task<bool> SpawnAdditionalPackageDownloadDialog(long baseDownloa
335335
matchingField: matchingField,
336336
token: token);
337337

338+
Logger.LogWriteLine($"Getting diff for matching field: {matchingField}", LogType.Debug, true);
339+
338340
// Get the manifest pair based on the matching field
339341
SophonChunkManifestInfoPair patchManifest = rootPatchManifest
340342
.GetOtherPatchInfoPair(matchingField, updateVersionfrom);
@@ -369,16 +371,6 @@ protected async Task<bool> SpawnAdditionalPackageDownloadDialog(long baseDownloa
369371
downloadLimiter,
370372
token))
371373
{
372-
if (!manifestPair.IsCommon)
373-
{
374-
string existingFilePath = Path.Combine(GamePath, patchAsset.TargetFilePath);
375-
if (!File.Exists(existingFilePath))
376-
{
377-
Logger.LogWriteLine($"Patch from matching field: {manifestPair.Main.MatchingField} is discarded: {patchAsset.TargetFilePath}", LogType.Warning, true);
378-
continue;
379-
}
380-
}
381-
382374
patchAssets.Add(patchAsset);
383375
}
384376
}
@@ -422,12 +414,14 @@ protected virtual async Task StartAlterSophonPatch(HttpClient httpClient,
422414
Dictionary<string, int> downloadedPatchHashSet = new();
423415
Lock dictionaryLock = new();
424416

425-
IEnumerable<Tuple<SophonPatchAsset, Dictionary<string, int>>> pipelineDownloadEnumerable = patchAssets
417+
List<Tuple<SophonPatchAsset, Dictionary<string, int>>> pipelineDownloadEnumerable = patchAssets
426418
.EnsureOnlyGetDedupPatchAssets()
427-
.Select(x => new Tuple<SophonPatchAsset, Dictionary<string, int>>(x, downloadedPatchHashSet));
419+
.Select(x => new Tuple<SophonPatchAsset, Dictionary<string, int>>(x, downloadedPatchHashSet))
420+
.ToList();
428421

429-
IEnumerable<Tuple<SophonPatchAsset, Dictionary<string, int>>> pipelinePatchEnumerable = patchAssets
430-
.Select(x => new Tuple<SophonPatchAsset, Dictionary<string, int>>(x, downloadedPatchHashSet));
422+
List<Tuple<SophonPatchAsset, Dictionary<string, int>>> pipelinePatchEnumerable = patchAssets
423+
.Select(x => new Tuple<SophonPatchAsset, Dictionary<string, int>>(x, downloadedPatchHashSet))
424+
.ToList();
431425

432426
ParallelOptions parallelOptions = new()
433427
{
@@ -444,7 +438,6 @@ protected virtual async Task StartAlterSophonPatch(HttpClient httpClient,
444438

445439
// Get download counts
446440
int downloadCountTotalAssetRemote = patchAssets.Count;
447-
int downloadCountPatchOnlyRemote = patchManifestInfoPairs.Sum(x => x.ChunksInfo.ChunksCount);
448441

449442
// Ensure disk space sufficiency
450443
await EnsureDiskSpaceSufficiencyAsync(downloadSizePatchOnlyRemote,
@@ -473,8 +466,8 @@ await EnsureDiskSpaceSufficiencyAsync(downloadSizePatchOnlyRemote,
473466
token);
474467

475468
// Assign local download progress
476-
ProgressAllCountCurrent = 1;
477-
ProgressAllCountTotal = downloadCountPatchOnlyRemote;
469+
ProgressAllCountCurrent = 0;
470+
ProgressAllCountTotal = pipelineDownloadEnumerable.Count;
478471
ProgressPerFileSizeCurrent = 0;
479472
ProgressPerFileSizeTotal = downloadSizePatchOnlyRemote;
480473
ProgressAllSizeCurrent = 0;
@@ -491,7 +484,7 @@ await EnsureDiskSpaceSufficiencyAsync(downloadSizePatchOnlyRemote,
491484
}
492485

493486
// If it's not a preload mode (patch mode), then execute the patch pipeline as well
494-
ProgressAllCountCurrent = 1;
487+
ProgressAllCountCurrent = 0;
495488
ProgressAllCountTotal = downloadCountTotalAssetRemote;
496489
ProgressPerFileSizeCurrent = 0;
497490
ProgressPerFileSizeTotal = downloadSizePatchOnlyRemote;

CollapseLauncher/Classes/RegionManagement/FallbackCDNUtil.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,9 @@ private static async ValueTask<CDNUtilHTTPStatus> TryGetURLStatus(CDNURLProperty
483483
LogWriteLine($"Getting CDN Content from: {cdnProp.Name} at URL: {absoluteURL}", LogType.Default, true);
484484

485485
// Try check the status of the URL
486-
var httpResponse = await GetURLHttpResponse(absoluteURL, token, isUncompressRequest);
486+
using var timeoutCts = new CancellationTokenSource(5000);
487+
using var linkedCts = CancellationTokenSource.CreateLinkedTokenSource(token, timeoutCts.Token);
488+
var httpResponse = await GetURLHttpResponse(absoluteURL, linkedCts.Token, isUncompressRequest, 1);
487489

488490
// If it's not a successful code, log the information
489491
if (!httpResponse.IsSuccessStatusCode)

CollapseLauncher/CollapseLauncher.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<Authors>$(Company). neon-nyan, Cry0, bagusnl, shatyuka, gablm.</Authors>
1717
<Copyright>Copyright 2022-2025 $(Company)</Copyright>
1818
<!-- Versioning -->
19-
<Version>1.82.28</Version>
19+
<Version>1.82.29</Version>
2020
<LangVersion>preview</LangVersion>
2121
<!-- Target Settings -->
2222
<Platforms>x64</Platforms>
@@ -171,9 +171,9 @@
171171
<PackageReference Include="Clowd.Squirrel" Version="2.11.1" Condition="!$(DefineConstants.Contains('USEVELOPACK'))" />
172172
<PackageReference Include="Libsql.Client" Version="0.5.0" />
173173
<!-- Velopacks' outdated dependencies, remove this once they switched to .NET 9 -->
174-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.5" />
174+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.6" />
175175
<!-- Velopacks' outdated dependencies, remove this once they switched to .NET 9 -->
176-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.5" />
176+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.6" />
177177
<PackageReference Include="TurnerSoftware.DinoDNS" Version="0.3.0" />
178178
<PackageReference Include="Velopack" Version="0.0.1297" Condition="$(DefineConstants.Contains('USEVELOPACK'))" />
179179

@@ -194,7 +194,7 @@
194194

195195
<PackageReference Include="GitInfo" Version="3.5.0" PrivateAssets="all" />
196196
<PackageReference Include="HtmlAgilityPack" Version="1.12.1" />
197-
<PackageReference Include="Markdig.Signed" Version="0.41.2" />
197+
<PackageReference Include="Markdig.Signed" Version="0.41.3" />
198198
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.2" />
199199
<PackageReference Include="Microsoft.NETCore.Targets" Version="6.0.0-preview.4.21253.7" />
200200
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3344-prerelease" />
@@ -209,9 +209,9 @@
209209
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
210210
<PackageReference Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-beta4.22272.1" />
211211
<PackageReference Include="System.Security.AccessControl" Version="6.0.1" />
212-
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="9.0.5" />
213-
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.5" />
214-
<PackageReference Include="System.Text.Json" Version="9.0.5" />
212+
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="9.0.6" />
213+
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.6" />
214+
<PackageReference Include="System.Text.Json" Version="9.0.6" />
215215
</ItemGroup>
216216

217217
<ItemGroup>
@@ -403,16 +403,16 @@
403403
<FilesToDelete Include="$(PublishDir)Microsoft.Windows.Vision*.dll;" />
404404
<FilesToDelete Include="$(PublishDir)Microsoft.Windows.Workloads*.dll;" />
405405
<FilesToDelete Include="$(PublishDir)Microsoft.Windows.AI*.dll;" />
406+
<FilesToDelete Include="$(PublishDir)Microsoft.Windows.Widgets*.dll;" />
406407
<FilesToDelete Include="$(PublishDir)workloads*.json;" />
407408
</ItemGroup>
408409
<Delete Files="@(FilesToDelete)" />
409410
<Delete Files="$(PublishDir)aspnetcorev2_inprocess.dll" />
410411
<Delete Files="$(PublishDir)DwmSceneI.dll" />
411412
<Delete Files="$(PublishDir)DWriteCore.dll" />
412-
<Delete Files="$(PublishDir)Microsoft.Graphics.Display.dll" />
413413
<Delete Files="$(PublishDir)Microsoft.Graphics.Imaging.dll" />
414-
<Delete Files="$(PublishDir)Microsoft.Windows.Widgets.dll" />
415414
<Delete Files="$(PublishDir)Microsoft.WindowsAppRuntime.Bootstrap.dll" />
415+
<Delete Files="$(PublishDir)Microsoft.WindowsAppRuntime.Bootstrap.Net.dll" />
416416
<Delete Files="$(PublishDir)Microsoft.WindowsAppRuntime.Insights.Resource.dll" />
417417
<Delete Files="$(PublishDir)Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.dll" />
418418
<Delete Files="$(PublishDir)PushNotificationsLongRunningTask.ProxyStub.dll" />

CollapseLauncher/Program.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ public static class MainEntryPoint
5454
[STAThread]
5555
public static void Main(params string[] args)
5656
{
57+
// Basically, the Libzstd's DLL will be checked if they exist on Non-AOT build.
58+
// But due to AOT build uses Static Library in favor of Shared ones (that comes
59+
// with .dll files), the check will be ignored.
60+
#if AOT
61+
ZstdNet.DllUtils.IsIgnoreMissingLibrary = true;
62+
#endif
63+
5764
AppCurrentArgument = args.ToList();
5865
#if PREVIEW
5966
IsPreview = true;

CollapseLauncher/Properties/PublishProfiles/Publish-DebugCIReleaseAOT.pubxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
66
<PropertyGroup>
77
<!-- Configuration and Platform -->
88
<Configuration>Debug</Configuration>
9-
<DefineConstants>$(DefineConstants);DISABLE_XAML_GENERATED_MAIN;USEVELOPACK;USENEWZIPDECOMPRESS;ENABLEHTTPREPAIR;DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION;PREVIEW;DUMPGIJSON;SIMULATEGIHDR;GSPBYPASSGAMERUNNING;MHYPLUGINSUPPORT</DefineConstants>
9+
<DefineConstants>$(DefineConstants);AOT;DISABLE_XAML_GENERATED_MAIN;USEVELOPACK;USENEWZIPDECOMPRESS;ENABLEHTTPREPAIR;DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION;PREVIEW;DUMPGIJSON;SIMULATEGIHDR;GSPBYPASSGAMERUNNING;MHYPLUGINSUPPORT</DefineConstants>
1010
<Platform>x64</Platform>
1111

1212
<!-- Publish Directory and Protocol -->

CollapseLauncher/Properties/PublishProfiles/Publish-PreviewReleaseAOT.pubxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
66
<PropertyGroup>
77
<!-- Configuration and Platform -->
88
<Configuration>Release</Configuration>
9-
<DefineConstants>$(DefineConstants);DISABLE_XAML_GENERATED_MAIN;USEVELOPACK;USENEWZIPDECOMPRESS;ENABLEHTTPREPAIR;DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION;PREVIEW;MHYPLUGINSUPPORT</DefineConstants>
9+
<DefineConstants>$(DefineConstants);AOT;DISABLE_XAML_GENERATED_MAIN;USEVELOPACK;USENEWZIPDECOMPRESS;ENABLEHTTPREPAIR;DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION;PREVIEW;MHYPLUGINSUPPORT</DefineConstants>
1010
<Platform>x64</Platform>
1111

1212
<!-- Publish Directory and Protocol -->

0 commit comments

Comments
 (0)