Skip to content

Commit 812166d

Browse files
committed
Update Obsidian icon, fix installer and bump version
1 parent 9a5656e commit 812166d

12 files changed

Lines changed: 77 additions & 25 deletions

File tree

Installer/ObsidianShell.aip

Lines changed: 48 additions & 10 deletions
Large diffs are not rendered by default.

Installer/Settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

ObsidianShell.CLI/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.4.0.0")]
36-
[assembly: AssemblyFileVersion("0.4.0.0")]
35+
[assembly: AssemblyVersion("0.5.0.0")]
36+
[assembly: AssemblyFileVersion("0.5.0.0")]

ObsidianShell.ContextMenu/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.4.0.0")]
36-
[assembly: AssemblyFileVersion("0.4.0.0")]
35+
[assembly: AssemblyVersion("0.5.0.0")]
36+
[assembly: AssemblyFileVersion("0.5.0.0")]
-29 Bytes
Loading

ObsidianShell.GUI/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("0.4.0.0")]
55-
[assembly: AssemblyFileVersion("0.4.0.0")]
54+
[assembly: AssemblyVersion("0.5.0.0")]
55+
[assembly: AssemblyFileVersion("0.5.0.0")]

ObsidianShell/Settings.cs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO;
44
using System.Reflection;
55
using System.ComponentModel;
6+
using System.Windows.Forms;
67

78
namespace ObsidianShell
89
{
@@ -44,16 +45,28 @@ public class Settings : INotifyPropertyChanged
4445

4546
private static string GetPath()
4647
{
47-
string path = Path.Combine(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName, "Settings.json");
48-
if (File.Exists(path))
49-
return path;
48+
string portablePath = Path.Combine(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName, "Settings.json");
49+
if (File.Exists(portablePath))
50+
return portablePath;
5051

51-
path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Chaoses Ib", "ObsidianShell", "Settings.json");
52-
if (!File.Exists(path))
52+
string installedPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Chaoses Ib", "ObsidianShell", "Settings.json");
53+
if (File.Exists(installedPath))
54+
return installedPath;
55+
56+
// Portable version is not released with an empty settings file, because users may overwrite existing settings during upgrade.
57+
// So we need to try to create at the portable path first.
58+
try
59+
{
60+
File.WriteAllText(portablePath, "{}");
61+
return portablePath;
62+
}
63+
catch (Exception e)
5364
{
54-
File.WriteAllText(path, "{}");
65+
MessageBox.Show($"Failed to create settings file at {portablePath}:\n{e}", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
5566
}
56-
return path;
67+
68+
File.WriteAllText(installedPath, "{}");
69+
return installedPath;
5770
}
5871

5972
public static Settings Load()

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
- `ObsidianShell.ContextMenu/Properties/AssemblyInfo.cs`
55
- `ObsidianShell.GUI/Properties/AssemblyInfo.cs`
66
2. Build the solution
7-
3. Copy files from `bin\Release` to `Installer\bin` (without PDB and XML files) and make a `Settings.json`
7+
3. Copy files from `bin\Release` to `Installer\bin` (without PDB and XML files)
88
4. Build the installer by Advanced Installer
9-
5. Pack files in `Installer\bin` as the protable version (in a directory named `ObsidianShell`)
9+
5. Pack files in `Installer\bin` as the protable version (in a directory named `ObsidianShell`)

images/ContextMenu.png

181 Bytes
Loading

images/File list.png

-118 Bytes
Loading

0 commit comments

Comments
 (0)