Skip to content

Commit

Permalink
Merge branch 'feat/store-main-binary-name' into refactor/wix-updater-…
Browse files Browse the repository at this point in the history
…launch-app
  • Loading branch information
amrbashir committed Sep 11, 2024
2 parents 60bde0b + 497b481 commit d9b9a11
Show file tree
Hide file tree
Showing 5 changed files with 17 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 and MSI installers. 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 @@ -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: 4 additions & 0 deletions tooling/bundler/src/bundle/windows/templates/main.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
<RegistryKey Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}">
<RegistryValue Name="InstallDir" Type="string" Value="[INSTALLDIR]" KeyPath="yes" />
</RegistryKey>
<!-- Save current MAINBINARYNAME for future updates from v2 updater -->
<RegistryKey Root="HKLM" Key="Software\\{{manufacturer}}\\{{product_name}}">
<RegistryValue Name="MainBinaryName" Type="string" Value="{{main_binary_name}}"/>
</RegistryKey>
</Component>
<Component Id="Path" Guid="{{path_component_guid}}" Win64="$(var.Win64)">
<File Id="Path" Source="{{app_exe_source}}" KeyPath="yes" Checksum="yes"/>
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 d9b9a11

Please sign in to comment.