mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 19:14:20 +01:00
7d7d5d7391
Extended range needed for touchpad swipes actions to register UI adjustments in profile settings, such as a color box for flashing color, alignment adjustments, and the Sixaxis reading dot staying in bounds of the box Recording a macro for special actions now open up in a new window, allowing for ctrl+tab to be used When controller's latency passes 10ms, the log will show and the controller will flash red until the latency is under 10ms Hovering over the mac address shows the latency of said controller, if it's connected via bluetooth Option to choose when at low battery for the light to flash or pulse Much cleaner/neater hotkeys/about window Option to download language packs if your PC is not set to an english language Finished Italian Translations (Thanks again Giulio) Finished German Translations (Thanks Ammonjak) Updated Italian & Russian Translations Reorganized the the code so all cs files are under the same project
121 lines
4.3 KiB
C#
121 lines
4.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using System.Net;
|
|
|
|
using System.IO;
|
|
using System.IO.Compression;
|
|
using System.Diagnostics;
|
|
using System.Runtime.InteropServices;
|
|
using System.Security.Principal;
|
|
using System.Security.Permissions;
|
|
using System.Reflection;
|
|
|
|
namespace DS4Windows
|
|
{
|
|
public partial class WelcomeDialog : Form
|
|
{
|
|
public WelcomeDialog()
|
|
{
|
|
InitializeComponent();
|
|
Icon = Properties.Resources.DS4;
|
|
|
|
}
|
|
|
|
private void bnFinish_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
|
|
private void linkBluetoothSettings_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
|
{
|
|
Process.Start("control", "bthprops.cpl");
|
|
}
|
|
bool driverinstalling = false;
|
|
private void bnStep1_Click(object sender, EventArgs e)
|
|
{
|
|
WebClient wb = new WebClient();
|
|
if (!driverinstalling)
|
|
{
|
|
wb.DownloadFileAsync(new Uri("http://ds4windows.com/Files/Virtual Bus Driver.zip"), exepath + "\\VBus.zip");
|
|
wb.DownloadProgressChanged += wb_DownloadProgressChanged;
|
|
wb.DownloadFileCompleted += wb_DownloadFileCompleted;
|
|
driverinstalling = true;
|
|
}
|
|
}
|
|
|
|
private void wb_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
|
|
{
|
|
bnStep1.Text = Properties.Resources.Downloading.Replace("*number*", e.ProgressPercentage.ToString());
|
|
}
|
|
|
|
string exepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName;
|
|
private void wb_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
|
|
{
|
|
bnStep1.Text = Properties.Resources.OpeningInstaller;
|
|
try
|
|
{
|
|
File.Delete(exepath + "\\ScpDriver.exe");
|
|
File.Delete(exepath + "\\ScpDriver.log");
|
|
Directory.Delete(exepath + "\\System", true);
|
|
Directory.Delete(exepath + "\\DIFxAPI", true);
|
|
}
|
|
catch { }
|
|
Directory.CreateDirectory(exepath + "\\Virtual Bus Driver");
|
|
try { ZipFile.ExtractToDirectory(exepath + "\\VBus.zip", exepath + "\\Virtual Bus Driver"); } //Saved so the user can uninstall later
|
|
catch { }
|
|
try { ZipFile.ExtractToDirectory(exepath + "\\VBus.zip", exepath); }
|
|
//Made here as starting the scpdriver.exe via process.start, the program looks for file from where it was called, not where the exe is
|
|
catch { }
|
|
if (File.Exists(exepath + "\\ScpDriver.exe"))
|
|
try
|
|
{
|
|
Process.Start(exepath + "\\ScpDriver.exe", "si");
|
|
bnStep1.Text = Properties.Resources.Installing;
|
|
}
|
|
catch { Process.Start(exepath + "\\Virtual Bus Driver"); }
|
|
|
|
Timer timer = new Timer();
|
|
timer.Start();
|
|
timer.Tick += timer_Tick;
|
|
}
|
|
|
|
private void timer_Tick(object sender, EventArgs e)
|
|
{
|
|
Process[] processes = Process.GetProcessesByName("ScpDriver");
|
|
if (processes.Length < 1)
|
|
{
|
|
string log = File.ReadAllText(exepath + "\\ScpDriver.log");
|
|
if (log.Contains("Install Succeeded"))
|
|
bnStep1.Text = Properties.Resources.InstallComplete;
|
|
else
|
|
{
|
|
bnStep1.Text = Properties.Resources.InstallFailed;
|
|
Process.Start(exepath + "\\Virtual Bus Driver");
|
|
}
|
|
try
|
|
{
|
|
File.Delete(exepath + "\\ScpDriver.exe");
|
|
File.Delete(exepath + "\\ScpDriver.log");
|
|
Directory.Delete(exepath + "\\System", true);
|
|
Directory.Delete(exepath + "\\DIFxAPI", true);
|
|
}
|
|
catch { }
|
|
File.Delete(exepath + "\\VBus.zip");
|
|
((Timer)sender).Stop();
|
|
}
|
|
}
|
|
|
|
|
|
private void button2_Click(object sender, EventArgs e)
|
|
{
|
|
Process.Start("http://www.microsoft.com/hardware/en-us/d/xbox-360-controller-for-windows");
|
|
}
|
|
}
|
|
}
|