Repository navigation
Conversation
…t, and PE resources
There was a problem hiding this comment.
🟡 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
Verify drive identity before reusing a profile-name slug · New Clear the UI handle before processing shutdown · New Draw focus indicators for owner-drawn buttons · New Handle keyboard activation of the tray icon · New Handle per-monitor DPI changes · New Recreate the tray icon after Explorer restarts · New Make browser sign-in cancellable without blocking the work queue · New Restore shared account copies after sign-in · New Sign out all shared account roots · New Preserve cached remote drives during local-only reloads · New Exclude signed-out cloud profiles from connect choices · New Preserve drive selection by identity when choices change · New
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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 PEVERSIONINFOmetadata 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, andHKCU\...\Runautostart helpers (compiles as a clean stub on macOS/Linux).Sources/StreamDriveWinFsp/WinAppController.swift&Sources/StreamDriveWinApp/: Swift state machine andParaAir.exeGUI subsystem executable (/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup) connecting the tray UI toParaAirCloudSignIn,CloudDriveSetup, andWinFspHost.windows/resources/: multi-resolutionparaair.ico(16/32/48/256 px fromsite/logo.png),paraair.manifest, and self-containedparaair.rc(VERSIONINFO+ icon + manifest), compiled and linked inscripts/windows/build.ps1.Package.swift,scripts/windows/package.ps1,windows/installer/ParaAir.wxs,site/get-started.html): avoids NTFS case collisions by naming the Windows binariesParaAir.exe,paraair-cli.exe, andparaair-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-> succeededbash scripts/acceptance.sh "$(swift build --build-system native --show-bin-path)/streamdrive"-> PASSswift test --build-system native --jobs 4 --filter StreamDriveWinFspTests->Executed 21 tests, with 0 failures(including newWinAppControllerTests)python3 -I scripts/check-site.py site-> PASSnode scripts/check-download.mjs-> PASSChecklist
.github/orscripts/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.