Snapshot for release 2026.10.13.1 (internal 90a2f4a)
This commit is contained in:
parent
b0f9d74b21
commit
1d86acdf27
218 changed files with 24019 additions and 1517 deletions
29
src/RynthCore.App.Avalonia/InstallerHandoff.cs
Normal file
29
src/RynthCore.App.Avalonia/InstallerHandoff.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using RynthCore.Install;
|
||||
|
||||
namespace RynthCore.App.Avalonia;
|
||||
|
||||
/// <summary>
|
||||
/// One-shot values the installer leaves under <c>Software\Rynth</c> for the launcher
|
||||
/// (e.g. <c>PendingPluginRegistration</c>). Kept out of the shared, read-only
|
||||
/// <see cref="RynthInstallPaths"/>, which must stay byte-identical with RynthSuite's copy.
|
||||
/// </summary>
|
||||
internal static class InstallerHandoff
|
||||
{
|
||||
/// <summary>A string value from <c>Software\Rynth</c>: HKCU first, then HKLM (32-bit view); null when absent.</summary>
|
||||
public static string? ReadSetting(string valueName)
|
||||
=> SystemInstallSettings.Instance.CurrentUser(valueName)
|
||||
?? SystemInstallSettings.Instance.LocalMachine(valueName);
|
||||
|
||||
/// <summary>Deletes a value from HKCU <c>Software\Rynth</c> once it has been acted on. Best effort.</summary>
|
||||
public static void DeleteUserSetting(string valueName)
|
||||
{
|
||||
try { RegDeleteKeyValueW(HKEY_CURRENT_USER, RynthInstallPaths.RegistryKey, valueName); } catch { }
|
||||
}
|
||||
|
||||
private static readonly IntPtr HKEY_CURRENT_USER = new(unchecked((int)0x80000001));
|
||||
|
||||
[DllImport("advapi32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
|
||||
private static extern int RegDeleteKeyValueW(IntPtr hkey, string lpSubKey, string lpValueName);
|
||||
}
|
||||
Loading…
Reference in a new issue