From 2e87e85f8550eccf2a3b23a36b135f3ad682509e Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Thu, 12 Sep 2024 19:51:46 +0200 Subject: [PATCH] fix(core): Use productName for FileDescription (#10976) --- .changes/fix-tauri-build-filedescription.md | 6 ++++++ core/tauri-build/src/lib.rs | 13 ++++++++++--- core/tauri-config-schema/schema.json | 4 ++-- core/tauri-utils/src/config.rs | 4 ++-- tooling/bundler/Cargo.lock | 4 ++-- .../src/bundle/windows/templates/installer.nsi | 3 +-- tooling/cli/schema.json | 4 ++-- 7 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 .changes/fix-tauri-build-filedescription.md diff --git a/.changes/fix-tauri-build-filedescription.md b/.changes/fix-tauri-build-filedescription.md new file mode 100644 index 00000000000..02ddec1ec97 --- /dev/null +++ b/.changes/fix-tauri-build-filedescription.md @@ -0,0 +1,6 @@ +--- +tauri-build: 'patch:bug' +tauri-bundler: 'patch:bug' +--- + +The executable and NSIS installer on Windows will now use the `productName` config for the `FileDescription` property instead of `shortDescription`. diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs index 57071d1eb42..a1baaf4d207 100644 --- a/core/tauri-build/src/lib.rs +++ b/core/tauri-build/src/lib.rs @@ -537,12 +537,19 @@ pub fn try_build(attributes: Attributes) -> Result<()> { res.set("FileVersion", version_str); res.set("ProductVersion", version_str); } + if let Some(product_name) = &config.package.product_name { res.set("ProductName", product_name); } - if let Some(short_description) = &config.tauri.bundle.short_description { - res.set("FileDescription", short_description); - } + + let file_description = config + .package + .product_name + .or_else(|| manifest.package.as_ref().map(|p| p.name.clone())) + .or_else(|| std::env::var("CARGO_PKG_NAME").ok()); + + res.set("FileDescription", &file_description.unwrap()); + if let Some(copyright) = &config.tauri.bundle.copyright { res.set("LegalCopyright", copyright); } diff --git a/core/tauri-config-schema/schema.json b/core/tauri-config-schema/schema.json index 1156868eca7..6cb58cd362e 100644 --- a/core/tauri-config-schema/schema.json +++ b/core/tauri-config-schema/schema.json @@ -1099,7 +1099,7 @@ ] }, "identifier": { - "description": "The application identifier in reverse domain name notation (e.g. `com.tauri.example`). This string must be unique across applications since it is used in system configurations like the bundle ID and path to the webview data directory. This string must contain only alphanumeric characters (A–Z, a–z, and 0–9), hyphens (-), and periods (.).", + "description": "The application identifier in reverse domain name notation (e.g. `com.tauri.example`). This string must be unique across applications since it is used in system configurations like the bundle ID and path to the webview data directory. This string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), and periods (.).", "type": "string" }, "publisher": { @@ -1509,7 +1509,7 @@ } }, "obsoletes": { - "description": "The list of RPM dependencies your application supersedes - if this package is installed, packages listed as “obsoletes” will be automatically removed (if they are present).", + "description": "The list of RPM dependencies your application supersedes - if this package is installed, packages listed as \"obsoletes\" will be automatically removed (if they are present).", "type": [ "array", "null" diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index a36e809c82e..4db5910532e 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -311,7 +311,7 @@ pub struct RpmConfig { /// in order for the package to be installed. pub conflicts: Option>, /// The list of RPM dependencies your application supersedes - if this package is installed, - /// packages listed as “obsoletes” will be automatically removed (if they are present). + /// packages listed as "obsoletes" will be automatically removed (if they are present). pub obsoletes: Option>, /// The RPM release tag. #[serde(default = "default_release")] @@ -847,7 +847,7 @@ pub struct BundleConfig { /// The application identifier in reverse domain name notation (e.g. `com.tauri.example`). /// This string must be unique across applications since it is used in system configurations like /// the bundle ID and path to the webview data directory. - /// This string must contain only alphanumeric characters (A–Z, a–z, and 0–9), hyphens (-), + /// This string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), /// and periods (.). pub identifier: String, /// The application's publisher. Defaults to the second element in the identifier string. diff --git a/tooling/bundler/Cargo.lock b/tooling/bundler/Cargo.lock index e5d53988181..97ff3b386aa 100644 --- a/tooling/bundler/Cargo.lock +++ b/tooling/bundler/Cargo.lock @@ -3022,7 +3022,7 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri-bundler" -version = "1.6.0" +version = "1.6.1" dependencies = [ "anyhow", "ar", @@ -3073,7 +3073,7 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.6.0" +version = "1.6.1" dependencies = [ "ctor", "dunce", diff --git a/tooling/bundler/src/bundle/windows/templates/installer.nsi b/tooling/bundler/src/bundle/windows/templates/installer.nsi index 51dbc889cf0..5d6d387ef52 100644 --- a/tooling/bundler/src/bundle/windows/templates/installer.nsi +++ b/tooling/bundler/src/bundle/windows/templates/installer.nsi @@ -20,7 +20,6 @@ ${StrLoc} !define PRODUCTNAME "{{product_name}}" !define VERSION "{{version}}" !define VERSIONWITHBUILD "{{version_with_build}}" -!define SHORTDESCRIPTION "{{short_description}}" !define INSTALLMODE "{{install_mode}}" !define LICENSE "{{license}}" !define INSTALLERICON "{{installer_icon}}" @@ -50,7 +49,7 @@ OutFile "${OUTFILE}" VIProductVersion "${VERSIONWITHBUILD}" VIAddVersionKey "ProductName" "${PRODUCTNAME}" -VIAddVersionKey "FileDescription" "${SHORTDESCRIPTION}" +VIAddVersionKey "FileDescription" "${PRODUCTNAME}" VIAddVersionKey "LegalCopyright" "${COPYRIGHT}" VIAddVersionKey "FileVersion" "${VERSION}" VIAddVersionKey "ProductVersion" "${VERSION}" diff --git a/tooling/cli/schema.json b/tooling/cli/schema.json index 1156868eca7..6cb58cd362e 100644 --- a/tooling/cli/schema.json +++ b/tooling/cli/schema.json @@ -1099,7 +1099,7 @@ ] }, "identifier": { - "description": "The application identifier in reverse domain name notation (e.g. `com.tauri.example`). This string must be unique across applications since it is used in system configurations like the bundle ID and path to the webview data directory. This string must contain only alphanumeric characters (A–Z, a–z, and 0–9), hyphens (-), and periods (.).", + "description": "The application identifier in reverse domain name notation (e.g. `com.tauri.example`). This string must be unique across applications since it is used in system configurations like the bundle ID and path to the webview data directory. This string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), and periods (.).", "type": "string" }, "publisher": { @@ -1509,7 +1509,7 @@ } }, "obsoletes": { - "description": "The list of RPM dependencies your application supersedes - if this package is installed, packages listed as “obsoletes” will be automatically removed (if they are present).", + "description": "The list of RPM dependencies your application supersedes - if this package is installed, packages listed as \"obsoletes\" will be automatically removed (if they are present).", "type": [ "array", "null"