Fix for automatic update. Versionhelper has loaded the application dll :/
This commit is contained in:
parent
219f4601cd
commit
3bbe5e72c5
|
@ -35,7 +35,7 @@ namespace Discord_Media_Loader
|
||||||
downloadManager.ShowDialog();
|
downloadManager.ShowDialog();
|
||||||
|
|
||||||
var tmpFolder = Path.GetTempFileName();
|
var tmpFolder = Path.GetTempFileName();
|
||||||
tmpFolder = Path.Combine(Path.GetFullPath(tmpFolder).Replace(Path.GetFileName(tmpFolder),""), Path.GetFileNameWithoutExtension(tmpFolder));
|
tmpFolder = Path.Combine(Path.GetFullPath(tmpFolder).Replace(Path.GetFileName(tmpFolder), ""), Path.GetFileNameWithoutExtension(tmpFolder));
|
||||||
|
|
||||||
var di = Directory.CreateDirectory(tmpFolder);
|
var di = Directory.CreateDirectory(tmpFolder);
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ namespace Discord_Media_Loader
|
||||||
}
|
}
|
||||||
|
|
||||||
File.Delete(tmpFile);
|
File.Delete(tmpFile);
|
||||||
|
DialogResult = DialogResult.Cancel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -59,7 +60,7 @@ namespace Discord_Media_Loader
|
||||||
UseWaitCursor = false;
|
UseWaitCursor = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Close();
|
DialogResult = DialogResult.OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,8 @@ namespace Discord_Media_Loader.Helper
|
||||||
internal class VersionHelper
|
internal class VersionHelper
|
||||||
{
|
{
|
||||||
internal static Version CurrentVersion => Assembly.GetExecutingAssembly().GetName().Version;
|
internal static Version CurrentVersion => Assembly.GetExecutingAssembly().GetName().Version;
|
||||||
internal static Version AppVersion => typeof(Core).Assembly.GetName().Version;
|
|
||||||
|
internal static Version AppVersion => AssemblyName.GetAssemblyName("Discord Media Loader.Application.dll").Version;
|
||||||
|
|
||||||
internal static async Task<Version> GetReleaseVersion()
|
internal static async Task<Version> GetReleaseVersion()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Runtime;
|
using System.Runtime;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
@ -20,10 +21,19 @@ namespace Discord_Media_Loader
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
|
||||||
var splashScreen = new FrmSplash();
|
var splashScreen = new FrmSplash();
|
||||||
splashScreen.ShowDialog();
|
if (splashScreen.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
DoLaunch(paramStrings);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Application.Restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void DoLaunch(string[] paramStrings)
|
||||||
|
{
|
||||||
AsyncContext.Run(() => Core.Run(paramStrings));
|
AsyncContext.Run(() => Core.Run(paramStrings));
|
||||||
Console.WriteLine("Ende");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue