Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core/updater): pass /NS to nsis installer to disable creating shortcuts on updates #9413

Open
wants to merge 2 commits into
base: 1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/updater-nsis-shortcut.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": "patch:bug"
---

Fix NSIS updater creating new shortcuts on update.
5 changes: 5 additions & 0 deletions .changes/utils-nsis-args-ns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-utils": "patch:enhance"
---

Added `/NS` flag in the return of `WindowsUpdateInstallMode::nsis_args`.
8 changes: 4 additions & 4 deletions core/tauri-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2587,12 +2587,12 @@ impl WindowsUpdateInstallMode {

/// Returns the associated nsis arguments.
///
/// [WindowsUpdateInstallMode::Passive] will return `["/P", "/R"]`
/// [WindowsUpdateInstallMode::Quiet] will return `["/S", "/R"]`
/// [WindowsUpdateInstallMode::Passive] will return `["/P", "/R", "/NS"]`
/// [WindowsUpdateInstallMode::Quiet] will return `["/S", "/R", "/NS"]`
pub fn nsis_args(&self) -> &'static [&'static str] {
match self {
Self::Passive => &["/P", "/R"],
Self::Quiet => &["/S", "/R"],
Self::Passive => &["/P", "/R", "/NS"],
Copy link
Member

Choose a reason for hiding this comment

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

since this isn't related to the install mode, shouldn't it be set in core/tauri/src/updater/core.rs instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

that could be argued for /R as well, but both should stay here because it is called WindowsUpdateInstallMode, i.e. related to updater and these flags are in scope of the updater.

Self::Quiet => &["/S", "/R", "/NS"],
_ => &[],
}
}
Expand Down