diff --git a/.changes/cli-no-dev-server.md b/.changes/cli-no-dev-server.md index 8bbba444929..ecd3e3417f6 100644 --- a/.changes/cli-no-dev-server.md +++ b/.changes/cli-no-dev-server.md @@ -1,5 +1,5 @@ --- -"cli.rs": "patch" +"cli.rs": "minor" --- Add `--no-dev-server` flag to the cli to disable the dev server for static files in dev mode. diff --git a/.changes/tauri-build-windows-manifest.md b/.changes/tauri-build-windows-manifest.md new file mode 100644 index 00000000000..fe96a9f14d0 --- /dev/null +++ b/.changes/tauri-build-windows-manifest.md @@ -0,0 +1,7 @@ +--- +"tauri-build": "minor" +--- + +Add `WindowsAttributes::app_manifest` to specify the application manifest on Windows. + + diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs index a3cb65c3970..ff84c5c8249 100644 --- a/core/tauri-build/src/lib.rs +++ b/core/tauri-build/src/lib.rs @@ -110,6 +110,15 @@ pub struct WindowsAttributes { /// /// If it is left unset, it will look up a path in the registry, i.e. HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots sdk_dir: Option, + /// A string containing an [application manifest] to be included with the application on Windows. + /// + /// Defaults to: + /// ``` + #[doc = include_str!("window-app-manifest.xml")] + /// ``` + /// + /// [application manifest]: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests + app_manifest: Option, } impl WindowsAttributes { @@ -135,6 +144,18 @@ impl WindowsAttributes { self.sdk_dir = Some(sdk_dir.as_ref().into()); self } + + /// Sets the app manifest. Currently only used on Windows. + /// + /// Defaults to: + /// ``` + #[doc = include_str!("window-app-manifest.xml")] + /// ``` + #[must_use] + pub fn app_manifest>(mut self, manifest: S) -> Self { + self.app_manifest = Some(manifest.as_ref().to_string()); + self + } } /// The attributes used on the build. @@ -337,22 +358,10 @@ pub fn try_build(attributes: Attributes) -> Result<()> { let mut res = WindowsResource::new(); res.set_manifest( - r#" - - - - - - - - "#, + &attributes + .windows_attributes + .app_manifest + .unwrap_or(include_str!("window-app-manifest.xml").to_string()), ); if let Some(sdk_dir) = &attributes.windows_attributes.sdk_dir { diff --git a/core/tauri-build/src/window-app-manifest.xml b/core/tauri-build/src/window-app-manifest.xml new file mode 100644 index 00000000000..2d510ed314a --- /dev/null +++ b/core/tauri-build/src/window-app-manifest.xml @@ -0,0 +1,14 @@ + + + + + + +