Author: gedmurphy
Date: Thu May 8 04:50:50 2008
New Revision: 33363
URL:
http://svn.reactos.org/svn/reactos?rev=33363&view=rev
Log:
Pass in the full xml path.
This should fix the crash when using the app when the 'run when windows starts'
option is selected.
Modified:
trunk/tools/Message Translator/GUI/App.config
trunk/tools/Message Translator/GUI/MainForm.cs
Modified: trunk/tools/Message Translator/GUI/App.config
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/Message%20Translator/GUI/App…
==============================================================================
--- trunk/tools/Message Translator/GUI/App.config [iso-8859-1] (original)
+++ trunk/tools/Message Translator/GUI/App.config [iso-8859-1] Thu May 8 04:50:50 2008
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
- <add key="NtstatusXml" value=".\Resources\ntstatus.xml" />
- <add key="WinerrorXml" value=".\Resources\winerror.xml" />
- <add key="HresultXml" value=".\Resources\hresult.xml" />
- <add key="WmXml" value=".\Resources\wm.xml" />
+ <add key="NtstatusXml" value="Resources\ntstatus.xml" />
+ <add key="WinerrorXml" value="Resources\winerror.xml" />
+ <add key="HresultXml" value="Resources\hresult.xml" />
+ <add key="WmXml" value="Resources\wm.xml" />
<add key="BugUrl"
value="http://www.reactos.org/bugzilla/show_bug.cgi?id={0}" />
<add key="BugHomepage"
value="http://www.reactos.org/bugzilla"/>
</appSettings>
Modified: trunk/tools/Message Translator/GUI/MainForm.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/Message%20Translator/GUI/Mai…
==============================================================================
--- trunk/tools/Message Translator/GUI/MainForm.cs [iso-8859-1] (original)
+++ trunk/tools/Message Translator/GUI/MainForm.cs [iso-8859-1] Thu May 8 04:50:50 2008
@@ -5,6 +5,7 @@
using MsgTrans.Library;
using System.Resources;
using System.Reflection;
+using System.IO;
using Microsoft.Win32;
namespace MsgTranslator
@@ -47,7 +48,22 @@
rk.SetValue(keyName, value);
}
}
-
+ private static string PrependWorkingDirectory(string file)
+ {
+ string full;
+ string workDir;
+
+ try
+ {
+ workDir =
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+ full = workDir + '\\' + file;
+ return full;
+ }
+ catch (Exception)
+ {
+ return file;
+ }
+ }
private static void VerifyRequiredOption(string optionName,
string optionValue)
{
@@ -65,6 +81,7 @@
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
+ s = PrependWorkingDirectory(s);
return s;
}
}
@@ -76,6 +93,7 @@
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
+ s = PrependWorkingDirectory(s);
return s;
}
}
@@ -87,6 +105,7 @@
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
+ s = PrependWorkingDirectory(s);
return s;
}
}
@@ -98,6 +117,7 @@
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
+ s = PrependWorkingDirectory(s);
return s;
}
}