mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-31 08:34:10 +02:00
Refactor Process.Start uses (missing using statement, use WindowsUtils for elevation)
This commit is contained in:
parent
66db0df45a
commit
802f1e3042
@ -28,7 +28,7 @@ public static string HeaderUserAgent{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void OpenExternalBrowser(string url){ // TODO implement mailto
|
public static void OpenExternalBrowser(string url){ // TODO implement mailto
|
||||||
Process.Start(url);
|
using(Process.Start(url)){}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetFileNameFromUrl(string url){
|
public static string GetFileNameFromUrl(string url){
|
||||||
|
@ -2,16 +2,13 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
using TweetDck.Core.Utils;
|
||||||
|
|
||||||
namespace TweetDck.Migration{
|
namespace TweetDck.Migration{
|
||||||
static class MigrationUtils{
|
static class MigrationUtils{
|
||||||
public static bool RunUninstaller(string guid, int timeout){
|
public static bool RunUninstaller(string guid, int timeout){
|
||||||
try{
|
try{
|
||||||
Process uninstaller = Process.Start(new ProcessStartInfo{
|
Process uninstaller = WindowsUtils.StartProcess("msiexec.exe", "/x "+guid+" /quiet /qn", true);
|
||||||
FileName = "msiexec.exe",
|
|
||||||
Arguments = "/x "+guid+" /quiet /qn",
|
|
||||||
Verb = "runas"
|
|
||||||
});
|
|
||||||
|
|
||||||
if (uninstaller != null){
|
if (uninstaller != null){
|
||||||
if (timeout > 0){
|
if (timeout > 0){
|
||||||
|
@ -50,7 +50,9 @@ public void HandleException(string caption, string message, bool canIgnore, Exce
|
|||||||
UseVisualStyleBackColor = true
|
UseVisualStyleBackColor = true
|
||||||
};
|
};
|
||||||
|
|
||||||
btnOpenLog.Click += (sender, args) => Process.Start(logFile);
|
btnOpenLog.Click += (sender, args) => {
|
||||||
|
using(Process.Start(logFile)){}
|
||||||
|
};
|
||||||
|
|
||||||
form.AddActionControl(btnOpenLog);
|
form.AddActionControl(btnOpenLog);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user