Skip to content

Fix: Quote install location in Nullsoft /D= switch to support paths with spaces - #6444

Open
Kaleb Luedtke (Trenly) wants to merge 2 commits into
microsoft:masterfrom
Trenly:NullsoftQuotes
Open

Fix: Quote install location in Nullsoft /D= switch to support paths with spaces#6444
Kaleb Luedtke (Trenly) wants to merge 2 commits into
microsoft:masterfrom
Trenly:NullsoftQuotes

Conversation

@Trenly

@Trenly Kaleb Luedtke (Trenly) commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📖 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:\Program instead of C:\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

  • Added a unit test in ShellExecuteHandlerInstallerArgs that passes C:\Program Files\CustomInstallDir as --location for a Nullsoft installer and asserts the resulting args contain /D="C:\Program Files\CustomInstallDir".
  • Existing Msi and Inno tests continue to pass.

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

This pull request was prepared with assistance from GitHub Copilot.

Microsoft Reviewers: Open in CodeFlow

Kaleb Luedtke (Trenly) and others added 2 commits August 7, 2026 14:54
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

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@Trenly
Kaleb Luedtke (Trenly) marked this pull request as ready for review August 7, 2026 20:08
@Trenly
Kaleb Luedtke (Trenly) requested a review from a team as a code owner August 7, 2026 20:08
@azure-pipelines

Copy link
Copy Markdown
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) + "\"")}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Package Issue]: Joplin.Joplin installed to "C:\Program" instead of the --location path

2 participants