mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
working on windows service install/uninstall
This commit is contained in:
@@ -38,7 +38,7 @@ impl BinaryData {
|
||||
let cursor = Cursor::new(self.raw);
|
||||
let mut decoder = brotli::Decompressor::new(cursor, BUF_SIZE);
|
||||
let mut buf = Vec::new();
|
||||
decoder.read_to_end(&mut buf).unwrap();
|
||||
decoder.read_to_end(&mut buf).ok();
|
||||
buf
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ impl BinaryData {
|
||||
}
|
||||
if p.exists() {
|
||||
// check md5
|
||||
let f = fs::read(p.clone()).unwrap();
|
||||
let f = fs::read(p.clone()).unwrap_or_default();
|
||||
let digest = format!("{:x}", md5::compute(&f));
|
||||
let md5_record = String::from_utf8_lossy(self.md5_code);
|
||||
if digest == md5_record {
|
||||
@@ -127,11 +127,13 @@ impl BinaryReader {
|
||||
|
||||
let exe_path = prefix.join(&self.exe);
|
||||
if exe_path.exists() {
|
||||
let f = File::open(exe_path).unwrap();
|
||||
let meta = f.metadata().unwrap();
|
||||
let mut permissions = meta.permissions();
|
||||
permissions.set_mode(0o755);
|
||||
f.set_permissions(permissions).unwrap();
|
||||
if let Ok(f) = File::open(exe_path) {
|
||||
if let Ok(meta) = f.metadata() {
|
||||
let mut permissions = meta.permissions();
|
||||
permissions.set_mode(0o755);
|
||||
f.set_permissions(permissions).ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user