mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-08 20:34:05 +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
|
||||
Process.Start(url);
|
||||
using(Process.Start(url)){}
|
||||
}
|
||||
|
||||
public static string GetFileNameFromUrl(string url){
|
||||
|
@ -2,16 +2,13 @@
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Microsoft.Win32;
|
||||
using TweetDck.Core.Utils;
|
||||
|
||||
namespace TweetDck.Migration{
|
||||
static class MigrationUtils{
|
||||
public static bool RunUninstaller(string guid, int timeout){
|
||||
try{
|
||||
Process uninstaller = Process.Start(new ProcessStartInfo{
|
||||
FileName = "msiexec.exe",
|
||||
Arguments = "/x "+guid+" /quiet /qn",
|
||||
Verb = "runas"
|
||||
});
|
||||
Process uninstaller = WindowsUtils.StartProcess("msiexec.exe", "/x "+guid+" /quiet /qn", true);
|
||||
|
||||
if (uninstaller != null){
|
||||
if (timeout > 0){
|
||||
|
@ -50,7 +50,9 @@ public void HandleException(string caption, string message, bool canIgnore, Exce
|
||||
UseVisualStyleBackColor = true
|
||||
};
|
||||
|
||||
btnOpenLog.Click += (sender, args) => Process.Start(logFile);
|
||||
btnOpenLog.Click += (sender, args) => {
|
||||
using(Process.Start(logFile)){}
|
||||
};
|
||||
|
||||
form.AddActionControl(btnOpenLog);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user