Commit 720ab703 authored by 黄树航's avatar 黄树航

右下角加个版本号

parent 36ad5bcd
......@@ -13,6 +13,7 @@ namespace Setup.Common
//private const string _url = "https://b.dqukj.com/api/client/product/list?productId=P00687";
private static readonly string _ossRequestHost = "https://http-2023.oss-cn-shenzhen.aliyuncs.com/crm";
private static readonly HttpClient _httpClient = new HttpClient();
public static string AppLauncherName { get; private set; }
private static async Task<List<string>> GetOssIps()
......
......@@ -66,6 +66,12 @@
<Border x:Name="operate" Grid.Row="1">
<ContentControl x:Name="mian_content" />
</Border>
<TextBlock
x:Name="TextBlock_Version"
Grid.RowSpan="9"
Margin="0,0,2,0"
HorizontalAlignment="Right"
VerticalAlignment="Bottom" />
</Grid>
</Border>
</Window>
\ No newline at end of file
using System.Windows;
using System.Reflection;
using System.Windows;
using System.Windows.Input;
namespace Dqkj.Setup
......@@ -22,6 +23,7 @@ namespace Dqkj.Setup
private void Window_Loaded(object sender, RoutedEventArgs e)
{
this.TextBlock_Version.Text = Assembly.GetEntryAssembly().GetName().Version.ToString();
this.mian_content.Content = new InstallView(this);
}
}
......
......@@ -50,5 +50,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.5")]
[assembly: AssemblyFileVersion("1.0.0.5")]
[assembly: AssemblyVersion("2.0.0.5")]
[assembly: AssemblyFileVersion("2.0.0.5")]
......@@ -5,13 +5,11 @@ using System.Windows.Controls;
namespace Dqkj.Setup.View
{
/// <summary>
/// InstallCompleteView.xaml 的交互逻辑
/// </summary>
public partial class InstallCompleteView : UserControl
{
MainWindow _mainWindow { get; set; }
string _executionPath { get; set; }
public InstallCompleteView(string executionPath, MainWindow mainWindow)
{
InitializeComponent();
......@@ -20,7 +18,8 @@ namespace Dqkj.Setup.View
}
private void bttOpen_Click(object sender, RoutedEventArgs e)
{if (File.Exists(_executionPath))
{
if (File.Exists(_executionPath))
{
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo(_executionPath);
......@@ -34,7 +33,7 @@ namespace Dqkj.Setup.View
{
MessageBox.Show("启动异常,请尝试手动打开!", "温馨提示");
}
}
}
}
......@@ -23,7 +23,7 @@ namespace Dqkj.Setup
{
private MainWindow _mainWindow { get; set; }
private string defaultUpdateXmlUrl { get; set; }
private static string executeName { get; set; }
private static string _executeName { get; set; }
private string formTitle { get; set; }
private static string zip_temp { get; set; }
private static string _installPath { get; set; }
......@@ -46,7 +46,7 @@ namespace Dqkj.Setup
//#endif
defaultUpdateXmlUrl = await ApiHelper.CheckAsync();
executeName = ApiHelper.AppLauncherName ?? "DqBox.exe";
_executeName = ApiHelper.AppLauncherName ?? "DqBox.exe";
formTitle = $"电趣助手-自动更新";
}
......@@ -69,14 +69,14 @@ namespace Dqkj.Setup
//var serverVersion = await GetUpdateInfo();
//if (serverVersion == null) { throw new Exception("获取安装配置异常!"); }
if (ProcessHelper.CheckProcess(executeName.Replace(".exe", "")))
if (ProcessHelper.CheckProcess(_executeName.Replace(".exe", "")))
{
var reply = System.Windows.MessageBox.Show("程序正在运行,是否自动关闭程序并开始更新升级", formTitle, MessageBoxButton.YesNo, MessageBoxImage.Information);
if (reply != MessageBoxResult.Yes)
{
return;
}
ProcessHelper.KillProcess(executeName.Replace(".exe", ""));
ProcessHelper.KillProcess(_executeName.Replace(".exe", ""));
DirectoryHelper.DeleteTemp(new List<string> { zip_temp, _installPath + "_" });
}
//开始下载文件
......@@ -142,9 +142,9 @@ namespace Dqkj.Setup
{
_mainWindow.txtBlockTitle.Text = "安装完成";
_mainWindow.imageLogo.Source = new BitmapImage(new Uri("/Img/Vector.png", UriKind.Relative));
RegeditHelper.UninstallDelete(Path.GetFileNameWithoutExtension(executeName));
RegeditHelper.UninstallDelete(Path.GetFileNameWithoutExtension(_executeName));
//_mainWindow.mian_content.Content = new InstallCompleteView(Path.Combine(_installPath, executeName), _mainWindow);
var exePath = Path.Combine(_installPath, executeName);
var exePath = Path.Combine(_installPath, _executeName);
if (File.Exists(exePath))
{
Process process = new Process();
......
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