44 lines
1.1 KiB
Rust
44 lines
1.1 KiB
Rust
/*
|
|
* advotracker - Hotline tackingtool for Advocats
|
|
*
|
|
* Copyright 2021 Ralf Zerres <ralf.zerres@networkx.de>
|
|
* SPDX-License-Identifier: (0BSD or MIT)
|
|
*/
|
|
|
|
use std::error::Error;
|
|
use twine::build_translations;
|
|
|
|
fn set_winres() -> Result<(), Box<dyn Error>> {
|
|
use winres::WindowsResource;
|
|
//use winapi::{shared::windef::MAKELANGID, um::winuser::LANG_GERMAN};
|
|
|
|
if cfg!(target_os="windows") {
|
|
println!("cargo: build windows resources");
|
|
cfg!(target_env="gnu");
|
|
let mut res = WindowsResource::new();
|
|
res.set_icon("assets/icons/advotracker/advotracker.ico");
|
|
// .set_language(MAKELANGID(LANG_GERMAN));
|
|
// winapi::um::winnt::MAKELANGID(
|
|
// winapi::um::winnt::LANG_ENGLISH,
|
|
// winapi::um::winnt::SUBLANG_ENGLISH_US);
|
|
|
|
//res.set("InternalName", "ADVOTRACKER.EXE")
|
|
// manually set version 0.1.8.0
|
|
//.set_version_info(VersionInfo::PRODUCTVERSION, 0x0000000100080000);
|
|
res.compile()?;
|
|
}
|
|
|
|
Ok(())
|
|
}
|
|
|
|
fn main() -> Result<(), Box<dyn Error>> {
|
|
println!("cargo: rerun-if-changed=build.rs");
|
|
build_translations(&["./src/i18n/localization.ini"], "i18n.rs").unwrap();
|
|
|
|
if cfg!(target_os="windows") {
|
|
set_winres()?;
|
|
}
|
|
|
|
Ok(())
|
|
}
|