fix #246 prompt restart wox after uninstall plugin

This commit is contained in:
qianlifeng
2015-02-07 21:40:25 +08:00
parent 2d05ecc81f
commit c24e216f26

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
@@ -234,7 +235,19 @@ namespace Wox.Plugin.PluginManagement
if (MessageBox.Show(content, "Wox", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
File.Create(Path.Combine(plugin.PluginDirectory, "NeedDelete.txt")).Close();
MessageBox.Show("This plugin has been removed, restart Wox to take effect");
if (MessageBox.Show(
"You have uninstalled plugin " + plugin.Name + " successfully.\r\n Restart Wox to take effect?",
"Install plugin",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
ProcessStartInfo Info = new ProcessStartInfo();
Info.Arguments = "/C ping 127.0.0.1 -n 1 && \"" + Application.ExecutablePath + "\"";
Info.WindowStyle = ProcessWindowStyle.Hidden;
Info.CreateNoWindow = true;
Info.FileName = "cmd.exe";
Process.Start(Info);
context.API.CloseApp();
}
}
}