Fixed issue with attachment tokens. Changed how attachments are handled to be more modular. Added support for PNG files.
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
using PWAPPv2.Source.DataObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace PWAPPv2.Source.API
|
||||
{
|
||||
@@ -57,6 +59,45 @@ namespace PWAPPv2.Source.API
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Update(string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (CheckForUpdate() == true)
|
||||
{
|
||||
string message = "An update is available! Would you like to install it?";
|
||||
string title = "Update available!";
|
||||
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
|
||||
DialogResult result = System.Windows.Forms.MessageBox.Show(message, title, buttons);
|
||||
if (result == System.Windows.Forms.DialogResult.Yes)
|
||||
{
|
||||
//System.Windows.MessageBox.Show("HAHA NO UPDATE FOR YOU!");
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = "C:\\PWAPP\\Updater\\PWAppUpdaterForm.exe";
|
||||
p.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
p.StartInfo.RedirectStandardError = true;
|
||||
try
|
||||
{
|
||||
p.StartInfo.Arguments = args[0];
|
||||
}
|
||||
catch { }
|
||||
if (System.Environment.OSVersion.Version.Major >= 6)
|
||||
{
|
||||
p.StartInfo.Verb = "runas";
|
||||
}
|
||||
p.Start();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new UpdateException();
|
||||
}
|
||||
}
|
||||
|
||||
public string GetReferalTypes()
|
||||
{
|
||||
return ReferTypesConnection.SendPostWithCredsInHeader("", "");
|
||||
@@ -78,4 +119,6 @@ namespace PWAPPv2.Source.API
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class UpdateException : Exception { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user