feat: windows app icon (#3753)

* default icon

* cli

* fix typos, fmt + icon fix

I don't think it's a good idea to do
[default.extend-words]
fo = "fo"

 as it's a very common mispelling for 'for'

* fix clippy

* return error on non implemented platforms instead of default dx icon

* fix

* fix

fix the amazing merge
renamed winres to windows
moved windows winres build request to windows

* fix typos

* fix schema

* Update schema.json

* fix schema again

* use default icon if no fallback

* wire up the rest of windows

* fmt

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
KlemenandJonathan Kelley authored and GitHub committed 2026-04-21 18:20:13 -07:00
1 parent 6d1f19067a
commit 3f82c45520
17 files changed
+1125 -25

No files matched your search

+4
View File
@@ -4,6 +4,10 @@ use std::path::PathBuf;
#[derive(Default, Debug, Clone, Serialize, Deserialize, JsonSchema)]
pub(crate) struct ApplicationConfig {
/// Display name of the application
#[serde(default)]
pub(crate) name: Option<String>,
/// The path where global assets will be added when components are added with `dx components add`
#[serde(default)]
pub(crate) asset_dir: Option<PathBuf>,
+40
View File
@@ -31,6 +31,14 @@ pub(crate) struct BundleConfig {
pub(crate) windows: Option<WindowsSettings>,
#[serde(default)]
pub(crate) android: Option<AndroidSettings>,
#[serde(default)]
pub(crate) version: Option<String>,
#[serde(default)]
pub(crate) file_version: Option<String>,
#[serde(default)]
pub(crate) original_file_name: Option<String>,
#[serde(default)]
pub(crate) trademark: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
@@ -225,6 +233,38 @@ pub(crate) struct WindowsSettings {
/// need to use another tool like `osslsigncode`.
#[serde(default)]
pub sign_command: Option<CustomSignCommandSettings>,
/// Free-form developer comments embedded in the executable's VERSIONINFO,
/// surfaced in Windows Explorer → Properties → Details → Comments.
#[serde(default)]
pub(crate) comments: Option<String>,
/// Internal name embedded in the executable's VERSIONINFO. Most apps leave
/// this equal to the product name; override only if the binary is known
/// internally by a different identifier (e.g. an original codename).
#[serde(default)]
pub(crate) internal_name: Option<String>,
/// VERSIONINFO LANGID for the resource block. Hex form like `0x0409`
/// (en-US) or `0x0407` (de-DE). Defaults to `0x0000` (neutral). See
/// <https://learn.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource#langID>
/// for the full table.
#[serde(default)]
pub(crate) language: Option<u16>,
/// Pass the host Windows SDK's `um/` and `shared/` headers to `rc.exe` via
/// `/I` flags. Only relevant when cross-compiling to MSVC from a
/// non-Windows host where the SDK headers aren't on the default include
/// path. Has no effect for the GNU (`windres`) toolchain.
#[serde(default)]
pub(crate) add_toolkit_include: Option<bool>,
/// Raw `.rc` snippet appended verbatim to the generated resource file.
/// Use this to add custom resources not covered by other settings —
/// application manifests, custom string tables, accelerators, etc.
/// Contents are not escaped.
#[serde(default)]
pub(crate) extra_rc: Option<String>,
}
#[derive(Default, Debug, Clone, Serialize, Deserialize, JsonSchema)]
+1
View File
@@ -102,6 +102,7 @@ impl Default for DioxusConfig {
fn default() -> Self {
Self {
application: ApplicationConfig {
name: None,
asset_dir: None,
out_dir: None,
public_dir: Some("public".into()),