Repository navigation
Find Visual Studio with vswhere in build and deploy scripts - #4
Merged
Merged
Conversation
build.bat now finds the newest Visual Studio with the C++ x64 tools using vswhere, instead of looking for VS 2022 at fixed paths. It keeps the project's platform toolset (v145) when it is installed and falls back to the newest installed toolset otherwise, such as v143 on VS 2022. A /nopause flag lets other scripts call it. deploy.bat checks for admin rights before doing anything and reuses build.bat. It asks Notepad++ to close normally instead of running taskkill /f, so unsaved files get a save prompt, and it won't copy the DLL while Notepad++ is still open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Closing Notepad++ with unsaved documents needs human validation on Windows beyond the reported mock tests.
0 open findings
What changed in this PR
Updates Windows build and deployment scripts to discover compatible Visual Studio installations and close Notepad++ without forced termination.
Changes:
- Detects Visual Studio with
vswhereand selects an available platform toolset. - Reuses the build script during deployment, checks administrator rights, and adds shutdown retry/cancel handling.
- Updates build prerequisites and deployment documentation.
| File | Description |
|---|---|
| README.md | Documents toolset selection and deployment behavior. |
| deploy.bat | Reuses builds and adds safer shutdown handling. |
| build.bat | Discovers Visual Studio and supports toolset fallback and noninteractive use. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Tested deploy's graceful close against a real Notepad++ instance. With session snapshot off it keeps running and shows its Save dialog; with snapshot on (Notepad++'s default) it exits without asking and keeps the unsaved edit in its backup. The README promised a save prompt in every case, so it now describes both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
build.batanddeploy.batlooked for Visual Studio 2022 only at fixed Community/Professional/Enterprise paths and always passed/p:PlatformToolset=v143. On a machine with Visual Studio 2026 (v145) they failed with either "Visual Studio 2022 not found" or MSB8020. MSB8020 also happens when a VS 2022 install without the C++ workload sits next to VS 2026, because the old script picked that install.deploy.batalso usedtaskkill /f, which could lose unsaved work in Notepad++.What changed
build.bat
vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64, then calls itsVsDevCmd.bat. It prints a clear error if none is found.PlatformToolset(v145) when that toolset is installed. Otherwise it passes the newest installed toolset, for example v143 on VS 2022./nopauseskips the pauses so other scripts can call it.deploy.bat
build.bat /nopauseinstead of keeping its own copy of the Visual Studio logic.taskkillwithout/f), so unsaved files are handled as usual: Notepad++ asks whether to save them, or, with session snapshot on, keeps them in its backup. It waits up to 20 s, then lets you retry after closing Notepad++ yourself, or cancel. Cancelling copies nothing.README.md: the build prerequisites and script description now match.
Testing
build.baton a machine with VS 2026 Community (plus a VS 2022 Professional that has no C++ tools) picks VS 2026 and v145, and buildsx64\Release\LLMAssistant.dllfrom scratch with 0 warnings.-multiInstinstance with its own-settingsDir) with an unsaved edit: with session snapshot off, it stayed open and showed its Save dialog, and the file on disk was unchanged. With snapshot on, the Notepad++ default, it closed without asking and kept the edit in its backup and session for the next start.deploy.batwithout admin rights stops at the admin check. Run as Administrator, it deployed a DLL byte-identical to the build (SHA-256 match).Notes for reviewers
build-and-release.yml) is unchanged. It still passes/p:PlatformToolset=v143onwindows-latest(VS 2022), andLLMAssistant.vcxprojstays at v145.deploy.bat, Notepad++ still starts with admin rights, as it did before.🤖 Generated with Claude Code