Match WSL launcher argument handling during uninstall

This commit is contained in:
gloamxun committed 2026-12-02 18:23:46 +08:00
1 parent 2c99cade7d
commit 022c4d5712
2 files changed
+12 -3

No files matched your search

+9 -2
View File
@@ -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