diff --git a/README.md b/README.md index 796f14c..8586e6b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ You can now start Polaris from the start menu or from your desktop, Polaris will ## Basic Configuration -All configuration is done by editing the file located at `C:\ProgramData\Polaris\polaris.toml`. Note that Polaris needs to be restarted for configuration changes to be taken into account. +All configuration is done by editing the file located at `%appdata%\Roaming\Permafrost\Polaris\polaris.toml`. Note that Polaris needs to be restarted for configuration changes to be taken into account. ### Locating Your Music diff --git a/build_release_windows.ps1 b/build_release_windows.ps1 index 50bd455..52fe8cf 100644 --- a/build_release_windows.ps1 +++ b/build_release_windows.ps1 @@ -24,8 +24,8 @@ Copy-Item .\web\ .\release\tmp\ -recurse "" "Creating installer" -candle -wx -ext WixUtilExtension -arch x64 -out .\release\tmp\installer.wixobj .\res\windows\installer\installer.wxs -light -wx -ext WixUtilExtension -ext WixUIExtension -spdb -out .\release\Polaris_0.5.0.msi .\release\tmp\installer.wixobj +candle -wx -ext WixUtilExtension -arch x64 -out .\release\tmp\installer.wixobj .\res\windows\installer\installer.wxs +light -wx -ext WixUtilExtension -ext WixUIExtension -spdb -sw1076 -out .\release\Polaris_0.5.0.msi .\release\tmp\installer.wixobj "Cleaning up" Remove-Item -Recurse .\release\tmp diff --git a/res/windows/installer/installer.wxs b/res/windows/installer/installer.wxs index 2ee0fd5..415f4bf 100644 --- a/res/windows/installer/installer.wxs +++ b/res/windows/installer/installer.wxs @@ -1,8 +1,8 @@ - + - + @@ -11,121 +11,127 @@ - + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - + + - - - - - - - - + + - - - + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + - + @@ -134,11 +140,11 @@ - + - - + + diff --git a/src/config.rs b/src/config.rs index f987d0e..7203f5c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -72,7 +72,7 @@ impl Config { if let Some(duration) = user_config.reindex_every_n_seconds { index_config.sleep_duration = duration; } - let mut index_path = utils::get_cache_root()?; + let mut index_path = utils::get_data_root()?; index_path.push(INDEX_FILE_NAME); index_config.path = index_path; diff --git a/src/thumbnails.rs b/src/thumbnails.rs index 30ac515..cab92d6 100644 --- a/src/thumbnails.rs +++ b/src/thumbnails.rs @@ -24,7 +24,7 @@ fn hash(path: &Path, dimension: u32) -> u64 { pub fn get_thumbnail(real_path: &Path, max_dimension: u32) -> Result { - let mut out_path = utils::get_cache_root()?; + let mut out_path = utils::get_data_root()?; out_path.push(THUMBNAILS_PATH); let mut dir_builder = DirBuilder::new(); diff --git a/src/utils.rs b/src/utils.rs index 4367f78..f0dbbff 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,12 +1,13 @@ -use app_dirs::{AppDataType, data_root}; +use app_dirs::{AppDataType, AppInfo, app_root}; use std::path::{Path, PathBuf}; use std::fs; use errors::*; +const APP_INFO: AppInfo = AppInfo{name: "Polaris", author: "Permafrost"}; + pub fn get_config_root() -> Result { - if let Ok(mut root) = data_root(AppDataType::SharedConfig) { - root.push("Polaris"); + if let Ok(root) = app_root(AppDataType::UserConfig, &APP_INFO) { fs::create_dir_all(&root) .chain_err(|| format!("opening shared config: {}", root.display()))?; return Ok(root); @@ -14,14 +15,13 @@ pub fn get_config_root() -> Result { bail!("Could not retrieve config directory root"); } -pub fn get_cache_root() -> Result { - if let Ok(mut root) = data_root(AppDataType::SharedData) { - root.push("Polaris"); +pub fn get_data_root() -> Result { + if let Ok(root) = app_root(AppDataType::UserData, &APP_INFO) { fs::create_dir_all(&root) .chain_err(|| format!("opening shared data: {}", root.display()))?; return Ok(root); } - bail!("Could not retrieve cache directory root"); + bail!("Could not retrieve data directory root"); } #[derive(Debug, PartialEq)]