1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-25 09:15:50 +02:00

Make sure ScriptLoader uses correct root path

This commit is contained in:
chylex 2016-04-16 02:02:10 +02:00
parent ee87841ec2
commit 3c43211b25

View File

@ -7,7 +7,7 @@ namespace TweetDck.Resources{
static class ScriptLoader{
public static string LoadResource(string name){
try{
return File.ReadAllText(name,Encoding.UTF8);
return File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory,name),Encoding.UTF8);
}catch(Exception ex){
MessageBox.Show("Unfortunately, "+Program.BrandName+" could not load the "+name+" file. The program will continue running with limited functionality.\r\n\r\n"+ex.Message,Program.BrandName+" Has Failed :(",MessageBoxButtons.OK,MessageBoxIcon.Error);
return null;