RANDOM MAC v1.1.2
RANDOM MAC v1.1.2
A small but important bugfix release on top of v1.1.1. Two correctness fixes around app instancing and the system-tray menu, plus tray-menu localization + restored Fluent icons.
Application logic in RandomMac.Core is unchanged. Existing settings.json / blacklist.json / history.json files load without migration.
Built with C# 13 / .NET 11 (preview) for the App project, .NET 9 for Core.
Bug fixes
- Process duplication on every launch. Every time you opened RANDOM MAC while the previous instance was still resident in the tray (default
MinimizeToTray=truekeeps the process alive when you close the window), a newRandomMac.App.exeprocess started. Over hours of use, Task Manager filled with parallel processes — none of them visibly active.
Fixed via a single-instance gate inProgram.csusingMicrosoft.Windows.AppLifecycle.AppInstance.FindOrRegisterForKey. Secondary launches now redirect activation to the primary instance and exit; the primary'sActivatedhandler marshals to the UI dispatcher and brings the existing window back from the tray. Velopack's--veloapp-*install/update lifecycle still runs first and is unaffected. - Tray right-click menu items didn't fire. The right-click menu showed all 3 items (Show / Randomize Active Adapter / Exit) with correct text and icons, but clicking any of them did nothing.
Root cause: H.NotifyIcon's defaultContextMenuMode = PopupMenubuilds a Win32 popup fromMenuFlyout.Itemsand dispatches selections via each item'sICommand—MenuFlyoutItem.Clickevents do not fire in this mode (documented in the H.NotifyIcon README, easy to miss because the WinUI MenuFlyout API exposes both). All three items now useCommand = new RelayCommand(...)instead ofitem.Click += ....
As defense-in-depth, the--minimizedstartup path also now primes theMenuFlyout'sXamlRootvia an off-screen activate-then-hide, so a future switch toContextMenuMode.SecondWindowwould work without further changes.
Changed
- Tray menu localized. Items used to render hardcoded English regardless of the chosen UI language. New keys
Tray_Show,Tray_RandomizeActive,Tray_ExitinLang.resx(en) andLang.vi.resx(vi: "Hiện cửa sổ" / "Đổi MAC adapter đang hoạt động" / "Thoát"), pulled viaLoc.Get(...)at menu-build time. - Tray FontIcon glyphs rewritten as
\uXXXXC# escape sequences (Window,Shuffle,ChromeClose) instead of raw Private-Use-Area chars, so they survive any future tooling write that strips PUA codepoints.
What did NOT change
- Every algorithm in
RandomMac.Core: MAC generation, registry write, WMI restart, blacklist, history, settings, OUI lookup, update service. - Velopack 0.0.1298 packaging (unpackaged, self-contained).
requireAdministratormanifest (no UAC at boot via Task Scheduler).- All 37 RandomMac.Tests unit tests still pass.
Smoke checklist (manual)
- Launch as Administrator. Window opens, tray icon appears.
- Close the window with
MinimizeToTray=true(default). Process stays in the tray. - Double-click the desktop shortcut (or run the exe again) — the existing window comes back to the foreground; Task Manager shows exactly one
RandomMac.App.exe, not two. - Repeat step 3 several times — process count stays at 1.
- Right-click the tray icon → menu shows three localized items with Fluent icons.
- Click "Hiện cửa sổ" / "Show" → window appears centered on screen.
- Close → returns to tray. Right-click → "Đổi MAC adapter đang hoạt động" / "Randomize Active Adapter" → notification confirms MAC change.
- Right-click → "Thoát" / "Exit" → process exits cleanly.
- Settings → enable Run at Startup + Start Minimized. Sign out and back in (or run the scheduled task manually). Window does not flash on screen, tray icon appears, right-click menu works on first try.
Compatibility
- Windows 11 (Mica) / Windows 10 22H2 (Acrylic fallback) / older (solid backdrop).
- x64 only. ARM64 not supported in this release.
- Bundled WinAppSDK runtime + .NET 11 (~225 MB self-contained).
- Building from source needs the .NET 11 preview SDK (
global.jsonpinned); see DEV_ENVIRONMENT.md.