Skip to content

Commit

Permalink
Merge pull request #2 from sandeshgrangdan/feature/windows
Browse files Browse the repository at this point in the history
Update the path of frechclam conf
  • Loading branch information
sandeshgrangdan authored Sep 9, 2024
2 parents f179754 + 1f516aa commit 46b81c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "antivirus"
version = "0.1.5"
version = "0.1.6"
edition = "2021"

# Github Repo
Expand Down
6 changes: 2 additions & 4 deletions src/antivirus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ pub fn handle_freshclam_copy_windows(config_dir: &str) -> io::Result<()> {

// Path to the default freshclam.conf.example file
let freshclam_conf_source = r"C:\ProgramData\chocolatey\lib\clamav\tools\clamav-1.4.1.win.x64\conf_examples\freshclam.conf.sample";
let freshclam_conf_destination = r"C:\ProgramData\chocolatey\lib\clamav\tools\clamav-1.4.1.win.x64\conf_examples\freshclam.conf";
// let freshclam_conf_destination = format!("{}\\freshclam.conf", config_dir);

let freshclam_conf_destination = r"C:\ProgramData\chocolatey\lib\clamav\tools\clamav-1.4.1.win.x64\freshclam.conf";

// Copy and rename the freshclam.conf file to the configuration directory
fs::copy(freshclam_conf_source, &freshclam_conf_destination)?;
Expand All @@ -70,7 +68,7 @@ pub fn handle_freshclam_copy_windows(config_dir: &str) -> io::Result<()> {
let reader = io::BufReader::new(config_file);

// Use a Windows-compatible temp file path
let temp_config_path = r"C:\ProgramData\chocolatey\lib\clamav\tools\clamav-1.4.1.win.x64\conf_examples\freshclam_temp.conf"; // Ensure this directory exists
let temp_config_path = r"C:\ProgramData\chocolatey\lib\clamav\tools\clamav-1.4.1.win.x64\freshclam_temp.conf"; // Ensure this directory exists

// Create a temporary file for the updated config
let mut temp_file = fs::File::create(temp_config_path)?;
Expand Down

0 comments on commit 46b81c2

Please sign in to comment.