mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-27 00:51:48 +01:00
Should fix updater not getting invoked for version checker
Related to issue #751
This commit is contained in:
parent
7a2224f109
commit
1eac0f9dd5
@ -802,12 +802,14 @@ namespace DS4Windows.Forms
|
||||
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
|
||||
string version = fvi.FileVersion;
|
||||
string newversion = File.ReadAllText(appdatapath + "\\version.txt").Trim();
|
||||
bool launchUpdate = false;
|
||||
if (!string.IsNullOrWhiteSpace(newversion) && version.Replace(',', '.').CompareTo(newversion) != 0)
|
||||
{
|
||||
if ((DialogResult)this.Invoke(new Func<DialogResult>(() => {
|
||||
return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion),
|
||||
Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question); })) == DialogResult.Yes)
|
||||
{
|
||||
launchUpdate = true;
|
||||
if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe")
|
||||
&& (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo(UPDATER_VERSION) != 0)))
|
||||
{
|
||||
@ -816,21 +818,26 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
if (appdatapath == exepath)
|
||||
{
|
||||
wc2.DownloadFile(url2, exepath + "\\DS4Updater.exe");
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = exepath + "\\DS4Updater.exe";
|
||||
p.StartInfo.Arguments = "-autolaunch";
|
||||
if (AdminNeeded())
|
||||
p.StartInfo.Verb = "runas";
|
||||
|
||||
try { p.Start(); Close(); }
|
||||
catch { }
|
||||
}
|
||||
else
|
||||
{
|
||||
this.BeginInvoke((System.Action)(() => MessageBox.Show(Properties.Resources.PleaseDownloadUpdater)));
|
||||
Process.Start($"https://github.com/Ryochan7/DS4Updater/releases/download/v{UPDATER_VERSION}/{updaterExe}");
|
||||
launchUpdate = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (launchUpdate)
|
||||
{
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = exepath + "\\DS4Updater.exe";
|
||||
p.StartInfo.Arguments = "-autolaunch";
|
||||
if (AdminNeeded())
|
||||
p.StartInfo.Verb = "runas";
|
||||
|
||||
try { p.Start(); Close(); }
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
else
|
||||
File.Delete(appdatapath + "\\version.txt");
|
||||
|
Loading…
Reference in New Issue
Block a user