mirror of
https://github.com/SillyTavern/SillyTavern-Launcher.git
synced 2026-11-05 00:27:39 +00:00
[GH-ISSUE #34] [BUG] Launcher.bat actually clears User's Path variable #11
Labels
No labels
🚏 Awaiting User Response
🐛Bug
🐛Bug
🐛Bug
🦄 Feature Request
✅ Fixed
✅ Fixed
👩💻 Good First Issue
‼️ High Priority
🧑💻 In Progress
🐧 Linux
🐧 Linux
💤 Low Priority
🍎 Mac
❕ Medium Priority
pull-request
🪟 Windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
SillyTavern/SillyTavern-Launcher#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @The1stWii2 on GitHub (Feb 3, 2024).
Original GitHub issue: https://github.com/SillyTavern/SillyTavern-Launcher/issues/34
Originally assigned to: @deffcolony on GitHub.
Environment
Windows
System
Windows 11 - 23H2
Describe the problem
I noticed after using the Launcher, I noticed that quite a few of my programs broke. Investigating it, I realised my User Path variable was now empty! Using Process Monitor, I eventually found Silly Tavern Launcher to be the culprit.
The exact section is near the start, used to append paths to the current User Path, if they are missing,
github.com/SillyTavern/SillyTavern-Launcher@9241f92ae4/Launcher.bat (L110-L122)The expected behaviour of the
Launcher.batBatch file is to append Winget current Path value, if it is not found and save it, however, due to Batch evaluation, the actual behaviour saves an empty string.Additional info
Demo video
https://github.com/SillyTavern/SillyTavern-Launcher/assets/109736937/7a519c0d-2fb9-4bff-ab1e-36f929a0ef15
The bug originates from not accounting for Batch evaluates variables in brackets. Batch performs replacement before execution, so
new_pathis never set when it is used. You can try this with the following snippet:Snippet demo
The correct way would be to use
setlocal enabledelayedexpansionand replace any%var%s which are assigned a value within blocks with!var!, like so:This bug probably also exists in other areas, causing other problems, but this is probably the most crucial one to fix.
Please tick the boxes
@deffcolony commented on GitHub (Feb 4, 2024):
@The1stWii2
I fixed the bug in:
github.com/SillyTavern/SillyTavern-Launcher@998070dbc5Please update the launcher
Let me know if the problem still occurs (I did test it)
@The1stWii2 commented on GitHub (Feb 4, 2024):
Just tested.
Seems to work as intended now.