mirror of
https://github.com/beerpiss/saekawa.git
synced 2024-11-23 23:00:58 +01:00
figure out how to programmatically make .rtext writable
This commit is contained in:
parent
cd3c1a9fcd
commit
2296f79908
10
build.rs
10
build.rs
@ -8,5 +8,15 @@ pub fn main() -> Result<(), Whatever> {
|
|||||||
.git_branch()
|
.git_branch()
|
||||||
.emit()
|
.emit()
|
||||||
.with_whatever_context(|_| "Could not emit version information")?;
|
.with_whatever_context(|_| "Could not emit version information")?;
|
||||||
|
|
||||||
|
// This makes it possible to write function pointers to the .rtext section.
|
||||||
|
// Otherwise, the hook crashes. This is obviously MSVC specific, but who uses
|
||||||
|
// i686-pc-windows-gnu anyways.
|
||||||
|
if std::env::var("TARGET").unwrap().ends_with("msvc") {
|
||||||
|
println!("cargo::rustc-link-arg=/SECTION:.rtext,RW");
|
||||||
|
} else {
|
||||||
|
println!("cargo::warning=You're not using MSVC. The hook's .rtext section will not be writable, which will cause a crash when performing a self-update.");
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -12,5 +12,4 @@ if (!(Test-Path ./saekawa.pfx)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
signtool sign -f saekawa.pfx -p "saekawa" -fd SHA256 -t http://timestamp.comodoca.com/authenticode -v target/i686-pc-windows-msvc/release/saekawa.dll
|
signtool sign -f saekawa.pfx -p "saekawa" -fd SHA256 -t http://timestamp.comodoca.com/authenticode -v target/i686-pc-windows-msvc/release/saekawa.dll
|
||||||
|
sha256sum target/i686-pc-windows-msvc/release/saekawa.dll
|
||||||
Write-Output "Remember to make the .rtext section writable for auto-updates! I have fuck all idea how to do it in Rust itself, so it's manual from here. The DLL has already been signed."
|
|
||||||
|
Loading…
Reference in New Issue
Block a user