v5.1: install RemSound as a proper Windows app, plus smaller sounds
New Options -> Install / Uninstall RemSound on this PC: a per-user self-installer (%LOCALAPPDATA%\Programs\RemSound, no admin) with optional desktop + Start-menu shortcuts, login auto-start (reuses StartupAutoStart), Windows Installed-apps registration, and copy-across of profiles+config, recordings and logs. Install state is decided by a marker file, not a folder-path guess; the post-install relaunch hands over foreground via AllowSetForegroundWindow so the installed copy comes to the front; uninstall uses a batch remover (no PowerShell) and confirms with two independent tick-boxes. All new dialogs use the house accessible controls (AccessibleCheckBox, Theme.Heading). Also: iOS (TestFlight) companion link alongside Android in README + manual; slimmed-down default cue WAVs; About/RELEASE_NOTES/manual updated; version -> 5.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
a92928d357
commit
7038fef67c
@@ -45,20 +45,30 @@ internal static class StartupAutoStart
|
||||
/// <summary>Add or update the Run-key entry to point at the currently-running exe.
|
||||
/// Quotes the path so spaces work. Returns true on success.</summary>
|
||||
public static bool TryEnable()
|
||||
{
|
||||
var exePath = Environment.ProcessPath;
|
||||
if (string.IsNullOrEmpty(exePath))
|
||||
{
|
||||
// Fallback: use AppContext.BaseDirectory. .NET hosting produces a
|
||||
// different process path for self-contained vs framework-dependent
|
||||
// publish, but BaseDirectory is reliable.
|
||||
exePath = System.IO.Path.Combine(AppContext.BaseDirectory, "RemSound.exe");
|
||||
}
|
||||
return TryEnable(exePath);
|
||||
}
|
||||
|
||||
/// <summary>Add or update the Run-key entry to point at a specific exe path. Used by the
|
||||
/// self-installer to re-point login-launch at the freshly INSTALLED copy while it's still
|
||||
/// running from the portable one, so auto-start doesn't keep launching the old folder.
|
||||
/// Quotes the path so spaces work. Returns true on success.</summary>
|
||||
public static bool TryEnable(string exePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(exePath)) return false;
|
||||
using var key = Registry.CurrentUser.OpenSubKey(RunKeyPath, writable: true)
|
||||
?? Registry.CurrentUser.CreateSubKey(RunKeyPath, writable: true);
|
||||
if (key is null) return false;
|
||||
var exePath = Environment.ProcessPath;
|
||||
if (string.IsNullOrEmpty(exePath))
|
||||
{
|
||||
// Fallback: use AppContext.BaseDirectory. .NET hosting produces a
|
||||
// different process path for self-contained vs framework-dependent
|
||||
// publish, but BaseDirectory is reliable.
|
||||
exePath = System.IO.Path.Combine(AppContext.BaseDirectory, "RemSound.exe");
|
||||
}
|
||||
// Wrap in double-quotes so a path containing spaces (e.g. C:\Program Files\)
|
||||
// parses correctly when Windows launches it.
|
||||
key.SetValue(ValueName, $"\"{exePath}\"");
|
||||
|
||||
Reference in New Issue
Block a user