Skip to content

Commit

Permalink
Merge branch 'release/v1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrodan committed Sep 20, 2018
2 parents d24bb2e + 5939c15 commit 65b4812
Show file tree
Hide file tree
Showing 22 changed files with 267 additions and 120 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,5 @@ FakesAssemblies/
# LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
ModelManifest.xml
.vs/
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
## 1.5.0 (2018-09-20)

This is mainly a bug-fixing release.
KeePass 2.40 or newer is required now (was 2.35).

Noteworthy:
Default Storage Location for settings is now in User's Roaming AppData instead of User's Local AppData.

### Fixed

- \#90 Update OnHelpMeChooseAccountStorage uri
- \#96 default folder did not create automatically
- \#103 Caching database makes KeePass non-portable
- \#113 Adjust account storage location
- \#122 Fixes syntax in donation text
- \#138 Simple Spelling Correction
- \#141 Incompatible with KeePass 2.40

### Improved

- Updated Dependencies (AWS, Box, Dropbox, Google Drive, OneDrive)


## 1.4.1 (2017-06-02)

This is a bug-fixing release only
Expand Down
49 changes: 49 additions & 0 deletions KeeAnywhere/Configuration/ConfigurationInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using KeePass.App.Configuration;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace KeeAnywhere.Configuration
{
public static class ConfigurationInfo
{
private static string _settingsDirectory;
private static bool _isPortable;

static ConfigurationInfo()
{
_isPortable = !KeePass.Program.Config.Meta.PreferUserConfiguration;

if (_isPortable)
{
var asm = Assembly.GetEntryAssembly();
var filename = asm.Location;
_settingsDirectory = Path.GetDirectoryName(filename);
}
else
{
_settingsDirectory = AppConfigSerializer.AppDataDirectory;
}
}

public static string SettingsDirectory
{
get
{
return _settingsDirectory;
}
}

public static bool IsPortable
{
get
{
return _isPortable;
}
}
}
}
1 change: 0 additions & 1 deletion KeeAnywhere/Configuration/ConfigurationMigration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ public static string MigrateAccountTo130(this string configString)

return s;
}

}
}
3 changes: 1 addition & 2 deletions KeeAnywhere/Configuration/ConfigurationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Linq;
using System.Reflection;
using KeeAnywhere.StorageProviders;
using KeePass.App.Configuration;
using KeePass.Plugins;
using KeePassLib.Utility;
using Newtonsoft.Json;
Expand Down Expand Up @@ -155,7 +154,7 @@ private void LoadPluginConfiguration()

if (string.IsNullOrEmpty(this.PluginConfiguration.BackupToLocalFolder))
{
this.PluginConfiguration.BackupToLocalFolder = Path.Combine(AppConfigSerializer.LocalAppDataDirectory,
this.PluginConfiguration.BackupToLocalFolder = Path.Combine(ConfigurationInfo.SettingsDirectory,
"KeeAnywhereBackups");
}

Expand Down
24 changes: 22 additions & 2 deletions KeeAnywhere/Configuration/ConfigurationServiceLocalSecureStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ partial class ConfigurationService

private void LoadAccountsFromLocalSecureStore()
{
var path = AppConfigSerializer.LocalAppDataDirectory;
this.MigrateDataToRoamingAppData();

var path = ConfigurationInfo.SettingsDirectory;
var filename = Path.Combine(path, ConfigurationFile_Accounts);

if (!File.Exists(filename))
Expand Down Expand Up @@ -43,7 +45,7 @@ private void LoadAccountsFromLocalSecureStore()

private void SaveAccountsToLocalSecureStore()
{
var path = AppConfigSerializer.LocalAppDataDirectory;
var path = ConfigurationInfo.SettingsDirectory;
var filename = Path.Combine(path, "KeeAnywhere.Accounts.json");

var settings = new JsonSerializerSettings
Expand All @@ -56,5 +58,23 @@ private void SaveAccountsToLocalSecureStore()

File.WriteAllText(filename, configString);
}

// v1.5.0: #113 Adjust account storage location
public void MigrateDataToRoamingAppData()
{
if (ConfigurationInfo.IsPortable) { return; }

var filenameOld = Path.Combine(AppConfigSerializer.LocalAppDataDirectory, ConfigurationFile_Accounts);
var filenameNew = Path.Combine(ConfigurationInfo.SettingsDirectory, ConfigurationFile_Accounts);

if (!File.Exists(filenameOld)) { return; }

try
{
File.Move(filenameOld, filenameNew);
}
catch { }
}

}
}
3 changes: 1 addition & 2 deletions KeeAnywhere/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.ComponentModel;
using System.IO;
using System.Runtime.Serialization;
using KeePass.App.Configuration;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

Expand All @@ -20,7 +19,7 @@ public string OfflineCacheFolder
{
get
{
return Path.Combine(AppConfigSerializer.LocalAppDataDirectory, "KeeAnywhereOfflineCache");
return Path.Combine(ConfigurationInfo.SettingsDirectory, "KeeAnywhereOfflineCache");
}
}

Expand Down
33 changes: 20 additions & 13 deletions KeeAnywhere/Forms/DonationForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions KeeAnywhere/Forms/DonationForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="label1.Text" xml:space="preserve">
<value>If you like KeeAnywhere, why not spend me a beer? Or just drop me line and say "Thank you, I like your work"? This is something you might do if we meet in real life. In anonymous internet where everything is for free, it got uncommon to appreciate someones work in such a simple way.

I do not want to earn money with KeeAnywhere. And I continue to provide KeeAnywhere for free. But it would give me a great pleasure to welcome your tribute.
<value>If you like KeeAnywhere, why not buy me a beer? Or just drop me a line and say "Thank you, I like your work"? This is something you might do if we met in real life. With the internet, where everyone is anonymous and everything is for free, it became uncommon to appreciate someone's work in such a simple way.
I do not want to earn money with KeeAnywhere. And I continue to provide KeeAnywhere for free. But it would give me great pleasure to accept your donation.

Regards,
Daniel Bölts</value>
Expand Down
2 changes: 1 addition & 1 deletion KeeAnywhere/Forms/SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ private void OnDocumentation(object sender, EventArgs e)

private void OnHelpMeChooseAccountStorage(object sender, EventArgs e)
{
Process.Start("https://github.com/Kyrodan/KeeAnywhere/wiki/Getting-Started#which-account-storage-location-should-i-choose");
Process.Start("https://github.com/Kyrodan/KeeAnywhere/wiki/Advanced-Topics#which-account-storage-location-should-i-choose");
}

private void OnLicense(object sender, EventArgs e)
Expand Down
Loading

0 comments on commit 65b4812

Please sign in to comment.