Skip to content

Add Windows system-tray desktop app (ParaAir.exe), Start Menu shortcut, and PE resources - #108

Open
owenisas wants to merge 1 commit into
mainfrom
feat/windows-tray-app
Open

owenisas wants to merge 1 commit into
mainfrom
feat/windows-tray-app

Conversation

@owenisas

Copy link
Copy Markdown
Collaborator

What and why

Adds a native Windows desktop system-tray application (ParaAir.exe) so Windows users can sign in, pick a drive and drive letter, connect/disconnect their streaming WinFsp drive, open it in File Explorer, toggle Start at Windows sign-in, and view Account & Billing without using the command line. Also embeds the ParaAir icon, Per-Monitor DPI v2 / Common Controls v6 manifest, and PE VERSIONINFO metadata into Windows binaries, and adds a Start Menu shortcut to the WiX MSI installer.

Key changes:

  • Sources/CWinTrayUI/: pure Win32 single-instance system-tray icon (Shell_NotifyIconW) + native Windows 11 rounded panel window matching the Mac app's light palette, with tray context menu, Explorer launcher, and HKCU\...\Run autostart helpers (compiles as a clean stub on macOS/Linux).
  • Sources/StreamDriveWinFsp/WinAppController.swift & Sources/StreamDriveWinApp/: Swift state machine and ParaAir.exe GUI subsystem executable (/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup) connecting the tray UI to ParaAirCloudSignIn, CloudDriveSetup, and WinFspHost.
  • windows/resources/: multi-resolution paraair.ico (16/32/48/256 px from site/logo.png), paraair.manifest, and self-contained paraair.rc (VERSIONINFO + icon + manifest), compiled and linked in scripts/windows/build.ps1.
  • Installer & docs (Package.swift, scripts/windows/package.ps1, windows/installer/ParaAir.wxs, site/get-started.html): avoids NTFS case collisions by naming the Windows binaries ParaAir.exe, paraair-cli.exe, and paraair-winfsp.exe, adds the Start Menu shortcut and Add/Remove Programs icon to the MSI, and updates Windows setup instructions.

How it was tested

Verified locally on macOS (Swift 6.4.2):

  • swift build --build-system native --jobs 4 -> succeeded
  • bash scripts/acceptance.sh "$(swift build --build-system native --show-bin-path)/streamdrive" -> PASS
  • swift test --build-system native --jobs 4 --filter StreamDriveWinFspTests -> Executed 21 tests, with 0 failures (including new WinAppControllerTests)
  • python3 -I scripts/check-site.py site -> PASS
  • node scripts/check-download.mjs -> PASS

Checklist

  • One focused change; no unrelated formatting or file moves
  • Tests added or updated where behaviour changed
  • No secrets, credentials, personal paths or generated build output in the diff
  • Changes to .github/ or scripts/ are called out above (they run in CI)

By opening this pull request I agree that my contribution is licensed under the Apache License 2.0, as described in CONTRIBUTING.md.

Copilot AI balanced review requested due to automatic review settings November 29, 2026 08:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical defects can mount the wrong remote drive and pass a freed tray handle to native UI calls, creating correctness and memory-safety risks.

12 open issues
What changed in this PR

Adds a native Windows tray application that connects the existing cloud sign-in and WinFsp drive services to a desktop interface.

Changes:

  • Adds drive selection, connection controls, browser sign-in, account access, and Windows autostart controls.
  • Integrates the GUI executable, Windows resources, and Start Menu shortcut into builds and packaging.
  • Adds presentation-state tests and updates Windows setup instructions.
File Description
windows/​resources/​paraair.rc Defines embedded icon, manifest, and executable metadata.
windows/​resources/​paraair.manifest Declares visual styles, execution privileges, and DPI awareness.
windows/​installer/​ParaAir.wxs Installs the GUI, adds a Start Menu shortcut, and updates CLI naming.
Tests/​StreamDriveWinFspTests/​WinAppControllerTests.swift Tests presentation states and C-state marshaling.
Sources/​StreamDriveWinFsp/​WinAppController.swift Coordinates account state, drive mounting, and tray actions.
Sources/​StreamDriveWinApp/​main.swift Adds the desktop application entry point.
Sources/​CWinTrayUI/​win_tray_ui.c Implements the native tray, panel, and Windows helpers.
Sources/​CWinTrayUI/​include/​win_tray_ui.h Defines the Swift-to-C UI interface.
site/​get-started.html Replaces CLI-first Windows instructions with desktop setup guidance.
scripts/​windows/​package.ps1 Packages all three executables and updates bundled instructions.
scripts/​windows/​build.ps1 Compiles and links Windows resources.
Package.swift Registers GUI targets, Windows libraries, and collision-free executable names.

Review effort: Balanced

// Attach on demand if this remote drive has no local profile yet.
let profile: DriveProfile
let stateDir: URL
if let existing = try? ProfileStore(root: choice.stateRoot).load(choice.profileName) {
lock.lock()
let timer = statusTimer
statusTimer = nil
let ui = uiHandle
Comment on lines +288 to +289
int disabled = (dis->itemState & ODS_DISABLED) != 0;
int pressed = (dis->itemState & ODS_SELECTED) != 0;
case WM_APP_TRAY: {
if (!ui) break;
UINT ev = LOWORD(lParam);
if (ev == WM_LBUTTONUP || ev == NIN_SELECT || ev == WM_LBUTTONDBLCLK) {
Comment on lines +523 to +524
ui->dpi = (int)GetDpiForSystem();
if (ui->dpi <= 0) ui->dpi = 96;
done.wait()

switch box.result {
case .success(let signedIn):
guard let current else { return }
setBusy("Signing out...")
let vault = CloudAccountStore.liveVault
if let tokens = try? CloudAccountStore(root: current.root).signOut(current.account.id, vault: vault),
)
stateDir = targetRoot
lock.lock()
reloadLocalStateLocked()
foundAccount = (acct, root)
}
if let profiles = try? ProfileStore(root: root).list() {
for p in profiles {
Comment on lines +695 to +697
signedInAccount = foundAccount
drives = foundChoices
if selectedDriveIndex >= drives.count { selectedDriveIndex = 0 }

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants