Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the path of frechclam conf #2

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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