Skip to content

Desktop en

AminiamEva edited this page Nov 29, 2026 · 3 revisions

Desktop (English)

中文 · English

The desktop app wraps the apps/web editor in a Tauri 2 shell and currently targets three platforms:

Platform Artifacts Signing
Windows x64 Offline NSIS installer (bundles the WebView2 runtime), portable ZIP Formal v* tags require Authenticode signing
macOS Apple Silicon (macOS 13.0+) DMG, app ZIP ad-hoc signed (not notarized)
Linux x86_64 AppImage, Debian package unsigned

The latest version is v0.2.3 (see Releases). Every artifact ships with a SHA-256 checksum file; verify your download.

Desktop builds are identified by commit and CI run ID, not by the app version alone. Back up documents and export preferences before testing preview builds.

Native LuaLaTeX workspace

The key difference from the web app: the desktop app bundles rtex 0.0.8 (a pinned, SHA-256-verified release including its TeX assets) and opens documents in the native LuaLaTeX workspace by default (the legacy JS workspace remains selectable in settings, applied after a restart).

  • Pages are rendered by real LuaLaTeX; prose, math, and tables are edited directly on the rendered result
  • Hybrid editing: ProseMirror owns input, composition, selection, and history; the native page owns the confirmed glyphs, masked until the matching revision is painted
  • A separate native trust dialog starts each session (LuaLaTeX can execute Lua; a temporary directory with disabled shell-escape is not a sandbox)
  • Content the glyph painter cannot draw uses a revision-frozen whole-page PDF rendered by the bundled PDF.js 4.10.38
  • A system TeX Live LuaLaTeX is auto-detected (macOS /Library/TeX/texbin, latest \texlive\<year> on Windows); RTEX_TEXLIVE_BIN / LINEAE_RTEX_PATH override

Included

  • Native open/save/save-as dialogs handling UTF-8 .tex files and projects
  • Native ZIP / YAML export, reusing the web project-export code
  • Bundled MathLive scripts, fonts, brand assets, the editor bundle, rtex 0.0.8 with its TeX assets, and PDF.js 4.10.38 (offline PDF rendering)
  • macOS native window menu and tiling shortcuts

Not included

  • File watching and auto-reload
  • Auto-update

Code signing (Windows)

When a v* tag is pushed, Tauri invokes the Authenticode signing command before embedding the program into NSIS, then signs the uninstaller and the final installer; every signature and the final artifacts are verified with signtool verify /pa. Signing requires these repository secrets:

Secret Purpose
WINDOWS_CERTIFICATE Code-signing certificate as base64 PKCS#12 (.pfx)
WINDOWS_CERTIFICATE_PASSWORD The .pfx password
WINDOWS_TIMESTAMP_URL Optional RFC 3161 timestamp server, defaults to DigiCert

Without WINDOWS_CERTIFICATE, preview tags still build unsigned artifacts; formal tags require a certificate by default, and a manual release may explicitly set allow_unsigned: true to publish unsigned — the workflow verifies those binaries are unsigned and the release notes must disclose the status.

Configure locally (never paste certificates or passwords into issues or chats):

pwsh apps/desktop/scripts/configure-signing.ps1 -Certificate C:\secure\lineae.pfx

macOS artifacts are ad-hoc signed and not notarized; on first launch allow them under "System Settings → Privacy & Security".

How it works

apps/desktop/src-tauri is the Rust shell:

  • Creates the main window and loads the packaged web app; macOS gets a native window menu.
  • Injects src/bridge.js before page load, mapping the web app's File System Access calls to native capabilities.
  • scripts/stage.mjs copies runtime files (including rtex resources) into apps/desktop/dist; editor sources and test fixtures never enter the installer.
  • The main window enables zoom controls so Ctrl+wheel and trackpad pinch reach the page and zoom the document, not the UI.

IPC commands:

Command Purpose
open_tex Open the native picker and read a UTF-8 file
pick_save_tex Open the native save picker and record the target path
write_tex Write only to paths previously chosen via the native dialog
save_bytes Save ZIP / YAML export contents

The Rust side keeps a whitelist of dialog-chosen paths. IPC cannot write arbitrary paths, and the webview receives no broad filesystem permissions.

Builds and preview releases

  • desktop.yml (Windows) — runs on pull requests, v* tags, and manual triggers; tag builds publish a Release.
  • macos-release.yml (macOS Apple Silicon) — DMG + ZIP with ad-hoc signing; check publish_preview for a manual preview.
  • linux-release.yml (Linux x86_64) — AppImage and Debian package.
  • Merges to main automatically publish desktop previews (Windows + macOS) as desktop-preview-<run ID> prereleases.

Do not build installers locally; edit sources locally and install CI artifacts.

Known limitations

  • Only UTF-8 .tex is accepted; malformed files are reported in the status bar.
  • The Windows portable build assumes WebView2 is installed; the offline installer installs it when missing.
  • Unsigned/un-notarized artifacts may trigger SmartScreen or Gatekeeper prompts.
  • The desktop app does not auto-update; download a new installer to upgrade.

Clone this wiki locally