Fix: Quote install location in Nullsoft /D= switch to support paths with spaces - #6444
Open
Kaleb Luedtke (Trenly) wants to merge 2 commits into
Open
Fix: Quote install location in Nullsoft /D= switch to support paths with spaces#6444Kaleb Luedtke (Trenly) wants to merge 2 commits into
Kaleb Luedtke (Trenly) wants to merge 2 commits into
Conversation
Verify that a --location value containing spaces (e.g. C:\Program Files\CustomInstallDir) is properly quoted in the /D= switch produced for Nullsoft installers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Kaleb Luedtke (Trenly)
marked this pull request as ready for review
August 7, 2026 20:08
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
| {InstallerSwitchType::Silent, ManifestInstaller::string_t("/S")}, | ||
| {InstallerSwitchType::SilentWithProgress, ManifestInstaller::string_t("/S")}, | ||
| {InstallerSwitchType::InstallLocation, ManifestInstaller::string_t("/D=" + std::string(ARG_TOKEN_INSTALLPATH))} | ||
| {InstallerSwitchType::InstallLocation, ManifestInstaller::string_t("/D=\"" + std::string(ARG_TOKEN_INSTALLPATH) + "\"")} |
Contributor
Author
There was a problem hiding this comment.
Just adding the note here for reviewers that MSI and Inno already had quotes around the paths. I'm not sure why Nullsoft didn't
isaq82760-cell
approved these changes
Aug 8, 2026
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.
📖 Description
Nullsoft (NSIS) installers use a non-standard
/D=<path>switch to specify the install directory. Unlike standard command-line switches,/D=does not support quoted paths — NSIS parses it literally and treats everything after=as the path. This means a path containing spaces (e.g.C:\Program Files\MyApp) would be split at the first space, causing the installer to target the wrong directory (e.g.C:\Programinstead ofC:\Program Files\MyApp).This fix wraps the install location token in double quotes within the default switch template (
/D="<installpath>"), so paths with spaces are passed correctly.Note
This issue was reported against a Joplin install in microsoft/winget-pkgs#413775.
🔗 References
Resolves microsoft/winget-pkgs#413775
🔍 Validation
ShellExecuteHandlerInstallerArgsthat passesC:\Program Files\CustomInstallDiras--locationfor a Nullsoft installer and asserts the resulting args contain/D="C:\Program Files\CustomInstallDir".✅ Checklist
📋 Issue Type
Microsoft Reviewers: Open in CodeFlow