From 1eac0f9dd5922a580e12f88a3a96a43102b7cbc6 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Mon, 8 Jul 2019 00:32:31 -0500 Subject: [PATCH 1/2] Should fix updater not getting invoked for version checker Related to issue #751 --- DS4Windows/DS4Forms/DS4Form.cs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index ec66be2..4890870 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -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(() => { 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"); From f00a42bedd3b987ab8ff468f04c626c997e7bd33 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sun, 14 Jul 2019 02:29:38 -0500 Subject: [PATCH 2/2] Slow down mouse wheel scrolling for analog stick --- DS4Windows/DS4Control/Mapping.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index 2d25560..bf1b989 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -2682,7 +2682,7 @@ namespace DS4Windows if (now >= oldnow + TimeSpan.FromMilliseconds(10) && !pressagain) { oldnow = now; - InputMethods.MouseWheel((int)(getByteMapping(device, control, cState, eState, tp) / 1.5f * (down ? -1 : 1)), 0); + InputMethods.MouseWheel((int)(getByteMapping(device, control, cState, eState, tp) / 8.0f * (down ? -1 : 1)), 0); } }