Added Auto Updates using my dropbx

This commit is contained in:
jays2kings 2014-05-14 03:12:15 -04:00
parent a3ca56d8a6
commit 809bc119ca
5 changed files with 91 additions and 47 deletions

View File

@ -11,20 +11,25 @@
<AssemblyName>DS4Tool</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<IsWebBootstrapper>true</IsWebBootstrapper>
<PublishUrl>C:\Users\Jonathan\Dropbox\Public\DS4 Tool\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Background</UpdateMode>
<UpdateInterval>1</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdatePeriodically>true</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<InstallUrl>https://dl.dropboxusercontent.com/u/16364552/DS4%2520Tool/</InstallUrl>
<MinimumRequiredVersion>1.0.0.1</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.htm</WebPage>
<ApplicationRevision>4</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@ -53,6 +58,18 @@
<PropertyGroup>
<StartupObject>ScpServer.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>5F2A5A97E42A73158D79996F7F3BE738271F5047</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>DS4Tool_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -125,6 +142,7 @@
<EmbeddedResource Include="ScpForm.resx">
<DependentUpon>ScpForm.cs</DependentUpon>
</EmbeddedResource>
<None Include="DS4Tool_TemporaryKey.pfx" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

View File

@ -110,6 +110,8 @@ namespace ScpServer
if (control is Button)
if (!((Button)control).Name.Contains("btn"))
buttons.Add((Button)control);
foreach (Button b in buttons)
b.MouseHover += button_MouseHover;
if (filename != "" && filename != "New Profile")
Global.LoadProfile(device, buttons.ToArray());
ToolTip tp = new ToolTip();
@ -122,6 +124,44 @@ namespace ScpServer
UpdateLists();
}
private void button_MouseHover(object sender, EventArgs e)
{
switch (((Button)sender).Name)
{
#region
case ("bnCross"): lBControls.SelectedIndex = 0; break;
case ("bnCircle"): lBControls.SelectedIndex = 1; break;
case ("bnSquare"): lBControls.SelectedIndex = 2; break;
case ("bnTriangle"): lBControls.SelectedIndex = 3; break;
case ("bnOptions"): lBControls.SelectedIndex = 4; break;
case ("bnShare"): lBControls.SelectedIndex = 5; break;
case ("bnUp"): lBControls.SelectedIndex = 6; break;
case ("bnDown"): lBControls.SelectedIndex = 7; break;
case ("bnLeft"): lBControls.SelectedIndex = 8; break;
case ("bnRight"): lBControls.SelectedIndex = 9; break;
case ("bnPS"): lBControls.SelectedIndex = 10; break;
case ("bnL1"): lBControls.SelectedIndex = 11; break;
case ("bnR1"): lBControls.SelectedIndex = 12; break;
case ("bnL2"): lBControls.SelectedIndex = 13; break;
case ("bnR2"): lBControls.SelectedIndex = 14; break;
case ("bnL3"): lBControls.SelectedIndex = 15; break;
case ("bnR3"): lBControls.SelectedIndex = 16; break;
case ("bnTouchLeft"): lBControls.SelectedIndex = 17; break;
case ("bnTouchRight"): lBControls.SelectedIndex = 18; break;
case ("bnTouchMulti"): lBControls.SelectedIndex = 19; break;
case ("bnTouchUpper"): lBControls.SelectedIndex = 20; break;
case ("bnLSUp"): lBControls.SelectedIndex = 21; break;
case ("bnLSDown"): lBControls.SelectedIndex = 22; break;
case ("bnLSLeft"): lBControls.SelectedIndex = 23; break;
case ("bnLSRight"): lBControls.SelectedIndex = 24; break;
case ("bnRSUp"): lBControls.SelectedIndex = 25; break;
case ("bnRSDown"): lBControls.SelectedIndex = 26; break;
case ("bnRSLeft"): lBControls.SelectedIndex = 27; break;
case ("bnRSRight"): lBControls.SelectedIndex = 28; break;
#endregion
}
}
private void SetDynamicTrackBarValue(TrackBar trackBar, int value)
{
if (trackBar.Maximum < value)

View File

@ -132,9 +132,6 @@
<data name="_360_fades" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\360 fades.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Touch_states2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Touch states2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="mouse" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\mouse.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -159,12 +156,6 @@
<data name="sticks" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sticks.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sticks2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sticks2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Touch" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Touch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="UpperTouch" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UpperTouch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

View File

@ -169,16 +169,6 @@ namespace ScpServer.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap sticks2 {
get {
object obj = ResourceManager.GetObject("sticks2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized string similar to Stop.
/// </summary>
@ -188,26 +178,6 @@ namespace ScpServer.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Touch {
get {
object obj = ResourceManager.GetObject("Touch", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Touch_states2 {
get {
object obj = ResourceManager.GetObject("Touch_states2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@ -6,6 +6,7 @@ using System.Threading;
using System.IO;
using System.Reflection;
using System.Collections.Generic;
using System.Net;
namespace ScpServer
{
public partial class ScpForm : Form
@ -74,6 +75,7 @@ namespace ScpServer
protected Button[] dbns;
protected Label[] protexts;
protected ToolStripMenuItem[] shortcuts;
WebClient wc = new WebClient();
public ScpForm()
{
InitializeComponent();
@ -92,7 +94,30 @@ namespace ScpServer
(ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[3] };
foreach (ToolStripMenuItem t in shortcuts)
t.DropDownItemClicked += Profile_Changed_Menu;
Uri url = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/newest%20version.txt"); //Sorry other devs, gonna have to find your own server
wc.DownloadFileAsync(url, "version.txt");
wc.DownloadFileCompleted += Check_Version;
}
double version = 6.5;
private void Check_Version(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
double newversion;
if(double.TryParse(File.ReadAllText("version.txt"), out newversion))
{
if (newversion > version)
if (MessageBox.Show("Download now?", "New Version Available!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
{
System.Diagnostics.Process.Start("Updater.exe");
this.Close();
}
else
File.Delete("version.txt");
else
File.Delete("version.txt");
}
else
File.Delete("version.txt");
}
protected void Form_Load(object sender, EventArgs e)