A SecRandom plugin that adds a button to SecRandom's floating window. Clicking it opens or focuses the SecScore main window:
- If SecScore is running, its window is raised to the foreground (works even when it is closed to the
system tray). Focus uses the Win32
AttachThreadInputworkaround so aNoActivatefloating window can still bring SecScore forward. - If SecScore is not running, the plugin launches the executable. The path is user-configurable
(Settings → SecScore) and auto-detected as a fallback (running process, Program Files, local user
installs, and a sibling
SecScorefolder).
Windows-focused; on other platforms the button is a logged no-op.
- .NET 10 SDK
- The SecRandom source checkout (the SDK is not published, so the plugin compiles against it from
source). The build prefers
D:\code\secrandom\_srcand falls back toD:\code\secrandom_src\SecRandom-masterwhen the preferred checkout is unavailable.
Because SecRandom.PluginSdk is not published to public feeds, the plugin compiles against the SDK
from source (and therefore also SecRandom.Core + Avalonia/FluentAvalonia, so the first build is
slow). Two prerequisites:
- A .NET 10 SDK.
- The SecRandom source checkout at one of the paths selected by
<SecRandomSourceDir>insrc/SecScoreLauncher/SecScoreLauncher.csproj.
On a machine with an up-to-date Windows you can build directly:
dotnet build src/SecScoreLauncher/SecScoreLauncher.csproj -c ReleaseThis machine's Windows 10 build ships ntdll.dll 10.0.19041.1566, below the 10.0.19041.5007
that .NET 10 requires for CET, and the CPU's CET shadow stacks are enabled. As a result the .NET SDK's
native compiler apphost (csc.exe) refuses to start with
Your Windows doesn't fully support CET. Running the compiler through the dotnet muxer
(dotnet exec csc.dll) works, so build.ps1 points the MSBuild Csc task at a csc.cmd wrapper and
sets DOTNET_EnableCETShadowStacks=0:
./build.ps1Alternatively, fix the root cause on the OS: install the latest Windows Update (so ntdll.dll is
>= 10.0.19041.5007), or disable CET shadow stacks in firmware/registry and reboot — then the plain
dotnet build command above is enough.
Either way the installable package is produced at:
src/SecScoreLauncher/srpx/SecScoreLauncher.srpx
- Copy
SecScoreLauncher.srpxinto the SecRandom app's package folder:- Installed app:
<SecRandom data folder>\cache\plugin-packages\ - (Dev/portable:
<SecRandom package root>\data\cache\plugin-packages\)
- Installed app:
- Restart SecRandom.
The button is not shown by default — enable it in Settings → Personalized → Floating Window, and switch the SecScore button on.
After a SecRandom flash draw finishes, the plugin registers the drawn student in SecScore as the temporary quick-operation student. A new draw replaces the previous one; three minutes after the latest successful registration, the temporary student is removed automatically. Configure the SecScore REST API address and optional token in Settings → SecScore. The SecScore REST API must be enabled, and authentication must either be disabled or have its token entered in the plugin settings.
Open Settings → SecScore. Set the SecScore.exe path, or click 自动检测 (auto-detect) and then
保存 (save). Leave it empty to always auto-detect at launch.
Plugin.cs— entrance (PluginBase) that registers a hosted service and a settings page.Services/SecScoreLauncherService.cs— hosted service that registers the floating-window button (FloatingWindowButtonDescriptor) viaIFloatingWindowButtonRegistry.Services/SecScoreLauncherConfig.cs— exe path persistence (settings.jsonunder the plugin config folder) and auto-detect.Win32/SecScoreWindowFocus.cs—FindWindowW("SecScore")→ForceForeground, else launch viaProcess.Start.Views/SettingsPages/SecScoreLauncherSettingsPage.cs— path editor.