diff --git a/desktop/README.md b/desktop/README.md index d74d671..2795171 100644 --- a/desktop/README.md +++ b/desktop/README.md @@ -16,7 +16,9 @@ Windows x64 原生版直接运行包内的引擎、TeX 资源和 BibTeX。项目 ### 准备 Windows 原生版资源 构建 x64 原生引擎。可以在 Windows 使用 MSVC,或在 Fedora WSL -使用仓库的 Windows 构建工具链运行 `cargo xwin build`。 +使用仓库的 Windows 构建工具链运行 `cargo xwin build`。使用新版 +MSVC 标准库交叉构建时,可设置 `TARGET_CXXFLAGS=-std=c++17` +编译 HarfBuzz。 ```sh cargo build --locked --release --target x86_64-pc-windows-msvc --example native_editor diff --git a/desktop/src-tauri/uninstall-projects.nsh b/desktop/src-tauri/uninstall-projects.nsh index 62536dd..3a7609d 100644 --- a/desktop/src-tauri/uninstall-projects.nsh +++ b/desktop/src-tauri/uninstall-projects.nsh @@ -1,12 +1,15 @@ Var TexrraCleanupDistro +Var TexrraCleanupDistroArg Var TexrraCleanupPath Var TexrraCleanupWsl Var TexrraCleanupMode Var TexrraCleanupStatus -; Distro names are passed as a single Windows argument. +; Match the desktop launcher's Windows argument quoting. Some WSL builds +; treat unnecessary quotes around a distribution name as part of its name. !macro TexrraValidateDistro StrCpy $2 0 + StrCpy $TexrraCleanupDistroArg $TexrraCleanupDistro ${Do} StrCpy $1 $TexrraCleanupDistro 1 $2 ${IfThen} $1 == "" ${|} ${ExitDo} ${|} @@ -16,6 +19,10 @@ Var TexrraCleanupStatus ${OrIf} $1 == "$\n" Goto texrra_cleanup_unavailable ${EndIf} + ${If} $1 == " " + ${OrIf} $1 == "$\t" + StrCpy $TexrraCleanupDistroArg '$\"$TexrraCleanupDistro$\"' + ${EndIf} IntOp $2 $2 + 1 ${Loop} !macroend @@ -24,7 +31,7 @@ Var TexrraCleanupStatus ${If} $TexrraCleanupDistro == "" nsExec::Exec ${options} '"$TexrraCleanupWsl" --cd "$PLUGINSDIR" --exec python3 -B ./uninstall-projects.py ${action}' ${Else} - nsExec::Exec ${options} '"$TexrraCleanupWsl" --distribution "$TexrraCleanupDistro" --cd "$PLUGINSDIR" --exec python3 -B ./uninstall-projects.py ${action}' + nsExec::Exec ${options} '"$TexrraCleanupWsl" --distribution $TexrraCleanupDistroArg --cd "$PLUGINSDIR" --exec python3 -B ./uninstall-projects.py ${action}' ${EndIf} Pop $TexrraCleanupStatus !macroend