Skip to content
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sc start Tenebra
However, Tenebra reads from a config file which must be populated before running Tenebra. If it is not populated, Tenebra will fail before copying the default config file to the config file directory.

* On **Linux** the config file is at `$XDG_CONFIG_HOME`/tenebra/config.toml or `$HOME`/.config/tenebra/config.toml (e.g. /home/alice/.config/tenebra/config.toml)
* On **Windows** the config file is at `{FOLDERID_RoamingAppData}` (e.g. C:\Users\Alice\AppData\Roaming)
* On **Windows** the config file is at `C:\tenebra\config.toml`
* On **macOS** the config file is at `$HOME`/Library/Application Support (e.g. /Users/Alice/Library/Application Support)

[See the default config file.](src/default.toml)
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ async fn entrypoint() -> Result<()> {
config_path.push("config.toml");

#[cfg(target_os = "windows")]
let mut config_path = std::path::Path::new("C:\\tenebra.toml");
let mut config_path = std::path::Path::new("C:\\tenebra\\config.toml");

#[cfg(not(target_os = "windows"))]
std::fs::create_dir_all(&config_path).context("Failed to create config directory")?;
Expand Down
6 changes: 4 additions & 2 deletions src/windows_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ use std::cell::Cell;
use std::time::Duration;
use std::ffi::{OsStr, OsString};
use std::os::windows::ffi::OsStrExt;
use std::io::Write;
use std::fs::{File, create_dir_all};

const SERVICE_NAME: &str = "Tenebra";
const SERVICE_TYPE: ServiceType = ServiceType::OWN_PROCESS;
Expand Down Expand Up @@ -57,8 +59,8 @@ pub fn run() -> Result<()> {
define_windows_service!(ffi_service_main, service_main);

pub fn service_main(_arguments: Vec<OsString>) {
use std::io::Write;
let mut file = std::fs::File::create("C:\\tenebra_log.txt").unwrap();
create_dir_all("C:\\tenebra").unwrap();
let mut file = File::create("C:\\tenebra\\tenebra_log.txt").unwrap();
unsafe { std::env::set_var("RUST_BACKTRACE", "1"); }
if let Err(e) = run_service() {
writeln!(&mut file, "Error: {:?}", e).unwrap();
Expand Down