Commit 7d29227d authored by 潘栩锋's avatar 潘栩锋 🚴

添加 测厚仪客户端界面菜单 添加 "升级检测" 按钮,调用 客户端根目录下的 update/update.exe

parent d4c47c68
using MultiLayout.UiModule;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Navigation;
using FLY.Thick.Base.UI;
using Unity;
using MultiLayout;
using System.Diagnostics;
using System.IO;
namespace FLY.Thick.Base.UI.CustomMenu
{
public class UpdateMenu : IMenu
{
public string Title => "升级检测";
public Brush Brush { get; set; }
IUnityContainer container;
public UpdateMenu(IUnityContainer container)
{
this.container = container;
}
public void OnClick()
{
//path = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
//path = Path.GetDirectoryName(path);
string path = System.AppDomain.CurrentDomain.BaseDirectory;
string exePath = Path.Combine(path, @"update\Update.exe");
if (!File.Exists(exePath)) {
FLY.ControlLibrary.MyMessageBox.Show($"不能找到{exePath}");
return;
}
Process startProc = new Process();
startProc.StartInfo.FileName = exePath; //就是你要打开的文件的详细路径
startProc.StartInfo.UseShellExecute = true;
startProc.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(exePath); //就是如APGIS.Tools.exe 执行文件是在那个文件夹下。
startProc.Start();
}
}
}
......@@ -123,6 +123,7 @@
<Compile Include="CtMicroGage\CtMircoGageVmUt.cs" />
<Compile Include="CustomMenu\AdrMenu.cs" />
<Compile Include="CustomMenu\CustomMenu.cs" />
<Compile Include="CustomMenu\UpdateMenu.cs" />
<Compile Include="CustomMenu\WarningMenu.cs" />
<Compile Include="CustomMenu\PwMenu.cs" />
<Compile Include="CustomSection\UcSectionScanGraph.xaml.cs">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment