Skip to content
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
7 changes: 7 additions & 0 deletions .changes/default-product-name-warning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"tauri-cli": patch:enhance
Comment thread
Legend-Master marked this conversation as resolved.
"@tauri-apps/cli": patch:enhance
"tauri-utils": patch:enhance
---

`tauri build` now warns when `productName` is still set to the default `tauri-app`, since it names the generated bundles and is written into install paths and metadata that are expected to be unique to your application. The config documentation for `productName` now lists what the field controls on each platform, and `identifier`'s documentation notes that the default value is rejected.
4 changes: 2 additions & 2 deletions crates/tauri-cli/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
]
},
"productName": {
"description": "App name.",
"description": "App name.\n\n This is the name your app is known by on the user's system, so it must be changed from the\n default before publishing. Besides naming the generated bundles, it is written into platform\n metadata and install paths that are expected to be unique to your application.\n\n ## Platform-specific\n\n - **macOS**: Names the `.app` bundle and the `.dmg`, and sets the bundle's\n `CFBundleDisplayName` and `CFBundleName` properties. `CFBundleName` can be overridden with\n [`bundle > macOS > bundleName`](MacConfig::bundle_name).\n - **Linux**: Kebab-cased for the Debian and RPM package names, used as the `Name` entry of\n the desktop file and as the resource directory name under `/usr/lib`.\n - **Windows**: Names the installers, the installation directory, the Start Menu folder and\n the `HKCU\\Software\\<publisher>\\<product name>` registry key. It also derives the default\n WiX upgrade code, which must be unique across applications and can be set explicitly with\n [`bundle > windows > wix > upgradeCode`](WixConfig::upgrade_code).",
"type": [
"string",
"null"
Expand All @@ -38,7 +38,7 @@
]
},
"identifier": {
"description": "The application identifier in reverse domain name notation (e.g. `com.tauri.example`).\n This string must be unique across applications since it is used in system configurations like\n the bundle ID and path to the webview data directory.\n This string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-),\n and periods (.).",
"description": "The application identifier in reverse domain name notation (e.g. `com.tauri.example`).\n This string must be unique across applications since it is used in system configurations like\n the bundle ID and path to the webview data directory.\n This string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-),\n and periods (.).\n The default value `com.tauri.dev` is rejected by `tauri build` and must be changed before\n building your application.",
"type": "string"
},
"app": {
Expand Down
6 changes: 6 additions & 0 deletions crates/tauri-cli/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ pub fn setup(
);
}

if config.product_name.as_deref() == Some("tauri-app") {
log::warn!(
"The `productName` is still set to the default value `tauri-app`, it must be unique across applications since it is written into install paths and platform metadata that are expected to be unique to your application, like the Windows installer upgrade code."
);
}

if let Some(before_build) = config.build.before_build_command.clone() {
helpers::run_hook(
"beforeBuildCommand",
Expand Down
4 changes: 2 additions & 2 deletions crates/tauri-schema-generator/schemas/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
]
},
"productName": {
"description": "App name.",
"description": "App name.\n\n This is the name your app is known by on the user's system, so it must be changed from the\n default before publishing. Besides naming the generated bundles, it is written into platform\n metadata and install paths that are expected to be unique to your application.\n\n ## Platform-specific\n\n - **macOS**: Names the `.app` bundle and the `.dmg`, and sets the bundle's\n `CFBundleDisplayName` and `CFBundleName` properties. `CFBundleName` can be overridden with\n [`bundle > macOS > bundleName`](MacConfig::bundle_name).\n - **Linux**: Kebab-cased for the Debian and RPM package names, used as the `Name` entry of\n the desktop file and as the resource directory name under `/usr/lib`.\n - **Windows**: Names the installers, the installation directory, the Start Menu folder and\n the `HKCU\\Software\\<publisher>\\<product name>` registry key. It also derives the default\n WiX upgrade code, which must be unique across applications and can be set explicitly with\n [`bundle > windows > wix > upgradeCode`](WixConfig::upgrade_code).",
"type": [
"string",
"null"
Expand All @@ -38,7 +38,7 @@
]
},
"identifier": {
"description": "The application identifier in reverse domain name notation (e.g. `com.tauri.example`).\n This string must be unique across applications since it is used in system configurations like\n the bundle ID and path to the webview data directory.\n This string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-),\n and periods (.).",
"description": "The application identifier in reverse domain name notation (e.g. `com.tauri.example`).\n This string must be unique across applications since it is used in system configurations like\n the bundle ID and path to the webview data directory.\n This string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-),\n and periods (.).\n The default value `com.tauri.dev` is rejected by `tauri build` and must be changed before\n building your application.",
"type": "string"
},
"app": {
Expand Down
18 changes: 18 additions & 0 deletions crates/tauri-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3744,6 +3744,22 @@ pub struct Config {
#[serde(rename = "$schema")]
pub schema: Option<String>,
/// App name.
///
/// This is the name your app is known by on the user's system, so it must be changed from the
/// default before publishing. Besides naming the generated bundles, it is written into platform
/// metadata and install paths that are expected to be unique to your application.
///
/// ## Platform-specific
///
/// - **macOS**: Names the `.app` bundle and the `.dmg`, and sets the bundle's
/// `CFBundleDisplayName` and `CFBundleName` properties. `CFBundleName` can be overridden with
/// [`bundle > macOS > bundleName`](MacConfig::bundle_name).
/// - **Linux**: Kebab-cased for the Debian and RPM package names, used as the `Name` entry of
/// the desktop file and as the resource directory name under `/usr/lib`.
/// - **Windows**: Names the installers, the installation directory, the Start Menu folder and
/// the `HKCU\Software\<publisher>\<product name>` registry key. It also derives the default
/// WiX upgrade code, which must be unique across applications and can be set explicitly with
/// [`bundle > windows > wix > upgradeCode`](WixConfig::upgrade_code).
#[serde(alias = "product-name")]
#[cfg_attr(feature = "schema", validate(regex(pattern = "^[^/\\:*?\"<>|]+$")))]
pub product_name: Option<String>,
Expand Down Expand Up @@ -3784,6 +3800,8 @@ pub struct Config {
/// 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 (.).
/// The default value `com.tauri.dev` is rejected by `tauri build` and must be changed before
/// building your application.
pub identifier: String,
/// The App configuration.
#[serde(default)]
Expand Down
Loading