mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 21:43:24 -07:00
Small fixes that make it possible to run the not installed Greenshot from a network share.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1616 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
23e9843d07
commit
fddeb05d67
4 changed files with 25 additions and 10 deletions
|
@ -81,10 +81,10 @@ namespace IniFile {
|
|||
/// Default init
|
||||
/// </summary>
|
||||
public static void Init() {
|
||||
AssemblyProductAttribute[] assemblyProductAttributes = Assembly.GetCallingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false) as AssemblyProductAttribute[];
|
||||
AssemblyProductAttribute[] assemblyProductAttributes = Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false) as AssemblyProductAttribute[];
|
||||
if (assemblyProductAttributes.Length > 0) {
|
||||
string productName = assemblyProductAttributes[0].Product;
|
||||
LOG.DebugFormat("Using ProductName {0}", productName);
|
||||
LOG.InfoFormat("Using ProductName {0}", productName);
|
||||
Init(productName, productName);
|
||||
} else {
|
||||
throw new InvalidOperationException("Assembly ProductName not set.");
|
||||
|
@ -160,7 +160,13 @@ namespace IniFile {
|
|||
throw new InvalidOperationException("IniConfig.Init not called!");
|
||||
}
|
||||
string iniFilePath = null;
|
||||
string applicationStartupPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
string applicationStartupPath = "";
|
||||
try {
|
||||
applicationStartupPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
} catch (Exception exception) {
|
||||
LOG.WarnFormat("Problem retrieving the AssemblyLocation: {0}", exception.Message);
|
||||
applicationStartupPath = @".";
|
||||
}
|
||||
string pafPath = Path.Combine(applicationStartupPath, @"App\" + applicationName);
|
||||
|
||||
if (portable || !portableCheckMade) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue