Skip to content

Commit

Permalink
config file location changed to roaming folder/FoliConConfig.json.
Browse files Browse the repository at this point in the history
Assembly method replaced with native method to get app path.
  • Loading branch information
DineshSolanki committed Aug 31, 2021
1 parent 03789b2 commit ad94e26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion FoliCon/Modules/AppConfig.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using HandyControl.Tools;
using System;
using System.IO;
using System.Text.Json;

namespace FoliCon.Modules
Expand All @@ -10,7 +12,7 @@ public class AppConfig : GlobalDataHelper
public string TmdbKey { get; set; }
public string IgdbClientId { get; set; }
public string IgdbClientSecret { get; set; }
public override string FileName { get; set; }
public override string FileName { get; set; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),"FoliConConfig.json");
public override JsonSerializerOptions JsonSerializerOptions { get; set; }
public override int FileVersion { get; set; }
}
Expand Down
5 changes: 2 additions & 3 deletions FoliCon/Modules/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,7 @@ public static void IfNotAdminRestartAsAdmin()

public static void StartAppAsAdmin()
{
var elevated = new ProcessStartInfo(Path.ChangeExtension(
System.Reflection.Assembly.GetEntryAssembly()?.Location ?? AppPath,
var elevated = new ProcessStartInfo(Path.ChangeExtension(AppPath,
"exe")!)
{
UseShellExecute = true,
Expand Down Expand Up @@ -703,6 +702,6 @@ public static void RemoveFromContextMenu()

//Growl.InfoGlobal("Merge Subtitle option removed from context menu!");
}
public static string AppPath => System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase!;
public static string AppPath => ApplicationHelper.GetExecutablePathNative();
}
}

0 comments on commit ad94e26

Please sign in to comment.