File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " tauri-build " : patch
3+ ---
4+
5+ Properly set file version information for the Windows executable.
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ serde_json = "1"
2626
2727[target ."cfg(windows)" .dependencies ]
2828winres = " 0.1"
29+ semver = " 1"
2930
3031[features ]
3132codegen = [ " tauri-codegen" , " quote" ]
Original file line number Diff line number Diff line change @@ -256,7 +256,8 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
256256 #[ cfg( windows) ]
257257 {
258258 use anyhow:: Context ;
259- use winres:: WindowsResource ;
259+ use semver:: Version ;
260+ use winres:: { VersionInfo , WindowsResource } ;
260261
261262 let icon_path_string = attributes
262263 . windows_attributes
@@ -276,6 +277,11 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
276277 }
277278 }
278279 if let Some ( version) = & config. package . version {
280+ if let Ok ( v) = Version :: parse ( version) {
281+ let version = v. major << 48 | v. minor << 32 | v. patch << 16 ;
282+ res. set_version_info ( VersionInfo :: FILEVERSION , version) ;
283+ res. set_version_info ( VersionInfo :: PRODUCTVERSION , version) ;
284+ }
279285 res. set ( "FileVersion" , version) ;
280286 res. set ( "ProductVersion" , version) ;
281287 }
You can’t perform that action at this time.
0 commit comments