Skip to content

Commit

Permalink
feat(bundler/nsis): store main binary name to be used in registry for…
Browse files Browse the repository at this point in the history
… future updates (#10952)

* feat(bundler): store main binary name to be used in registry for furture updates

* revert wix changes as leftover binaries are fixed by #10967
  • Loading branch information
amrbashir authored Sep 13, 2024
1 parent 2e87e85 commit 298f8ca
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
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));

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 @@ -570,6 +570,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

0 comments on commit 298f8ca

Please sign in to comment.