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

feat(bundler/nsis): store main binary name to be used in registry for future updates #10952

Merged
merged 4 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/bundler-store-main-binary-name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-bundler": "patch:feat"
---

Store main binary name in registry for NSIS installer. This will be used in future app updates to detect main binary name changes.
4 changes: 3 additions & 1 deletion tooling/bundler/src/bundle/windows/msi/wix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,9 @@ pub fn build_wix_app_installer(
data.insert("shortcut_guid", to_json(shortcut_guid.as_str()));

let app_exe_name = settings.main_binary_name().to_string();
data.insert("app_exe_name", to_json(app_exe_name));
// Note: `app_exe_name` kept around to not break custom wix templates depending on it
data.insert("app_exe_name", to_json(&app_exe_name));
data.insert("main_binary_name", to_json(app_exe_name));
Copy link
Member

Choose a reason for hiding this comment

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

are you even using this one? doesn't look like it

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah it was leftover from previous attempt at 497b481, it is fine to keep for now


let binaries = generate_binaries_data(settings)?;

Expand Down
3 changes: 3 additions & 0 deletions tooling/bundler/src/bundle/windows/templates/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ Section Install
WriteRegStr SHCTX "${UNINSTKEY}" $MultiUser.InstallMode 1
!endif

; Save current MAINBINARYNAME for future updates from v2 updater
WriteRegStr SHCTX "${UNINSTKEY}" "MainBinaryName" "${MAINBINARYNAME}.exe"

; Registry information for add/remove programs
WriteRegStr SHCTX "${UNINSTKEY}" "DisplayName" "${PRODUCTNAME}"
WriteRegStr SHCTX "${UNINSTKEY}" "DisplayIcon" "$\"$INSTDIR\${MAINBINARYNAME}.exe$\""
Expand Down
4 changes: 2 additions & 2 deletions tooling/cli/node/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

/* auto-generated by NAPI-RS */

export function run(args: Array<string>, binName: string | undefined | null, callback: (...args: any[]) => any): void
export function logError(error: string): void
export declare function run(args: Array<string>, binName: string | undefined | null, callback: (...args: any[]) => any): void
export declare function logError(error: string): void
Loading