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
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ unparented = "unparented"
flate2="flate2"

[files]
extend-exclude = ["notes/translations/*", "CHANGELOG.md", "*.js"]
extend-exclude = ["notes/translations/*", "CHANGELOG.md", "*.js", "packages/cli/src/build/windows.rs"]
Binary file added packages/cli/assets/icon.ico
Binary file not shown.
68 changes: 68 additions & 0 deletions packages/cli/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,13 @@
"null"
]
},
"name": {
"description": "Display name of the application",
"type": [
"string",
"null"
]
},
"out_dir": {
"type": [
"string",
Expand Down Expand Up @@ -649,6 +656,12 @@
"type": "string"
}
},
"file_version": {
"type": [
"string",
"null"
]
},
"icon": {
"type": [
"array",
Expand Down Expand Up @@ -680,6 +693,12 @@
}
]
},
"original_file_name": {
"type": [
"string",
"null"
]
},
"publisher": {
"type": [
"string",
Expand All @@ -701,6 +720,18 @@
"null"
]
},
"trademark": {
"type": [
"string",
"null"
]
},
"version": {
"type": [
"string",
"null"
]
},
"windows": {
"anyOf": [
{
Expand Down Expand Up @@ -2864,6 +2895,13 @@
"WindowsSettings": {
"type": "object",
"properties": {
"add_toolkit_include": {
"description": "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.",
"type": [
"boolean",
"null"
]
},
"allow_downgrades": {
"type": "boolean"
},
Expand All @@ -2873,18 +2911,48 @@
"null"
]
},
"comments": {
"description": "Free-form developer comments embedded in the executable's VERSIONINFO, surfaced in Windows Explorer → Properties → Details → Comments.",
"type": [
"string",
"null"
]
},
"digest_algorithm": {
"type": [
"string",
"null"
]
},
"extra_rc": {
"description": "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.",
"type": [
"string",
"null"
]
},
"icon_path": {
"type": [
"string",
"null"
]
},
"internal_name": {
"description": "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).",
"type": [
"string",
"null"
]
},
"language": {
"description": "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.",
"type": [
"integer",
"null"
],
"format": "uint16",
"minimum": 0.0
},
"nsis": {
"anyOf": [
{
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
mod android;
mod apple;
mod web;
mod windows;

mod assets;
mod builder;
Expand Down
16 changes: 15 additions & 1 deletion packages/cli/src/build/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,15 @@ impl BuildRequest {
AndroidTools::unpack_prebuilt_openssl()?;
}

// Compile the Windows resource (.res) so it's ready to be linked in later
if matches!(self.triple.operating_system, OperatingSystem::Windows) {
if let Err(err) = self.write_winres() {
if self.using_dioxus_explicitly {
tracing::warn!("Application may not have an icon: {err}");
}
}
}

Ok(())
}

Expand Down Expand Up @@ -1767,6 +1776,11 @@ impl BuildRequest {
cargo_args.push("-Clink-arg=-Wl,-rpath,$ORIGIN/../lib".to_string());
cargo_args.push("-Clink-arg=-Wl,-rpath,$ORIGIN".to_string());
}
OperatingSystem::Windows => {
if let Some((search_path, link_spec)) = self.winres_linker_args() {
cargo_args.extend(["-L".to_string(), search_path, "-l".to_string(), link_spec]);
}
}
_ => {}
}

Expand Down Expand Up @@ -2505,7 +2519,7 @@ impl BuildRequest {
/// target/dx/build/app/web/
/// target/dx/build/app/web/public/
/// target/dx/build/app/web/server.exe
fn platform_dir(&self) -> PathBuf {
pub(crate) fn platform_dir(&self) -> PathBuf {
self.internal_out_dir()
.join(&self.main_target)
.join(if self.release { "release" } else { "debug" })
Expand Down
Loading
Loading