Commit 4b35f49e authored by Damon's avatar Damon

修改http链接为https,安装完成后自动打开

parent 38ae9d22
<Application x:Class="Dqkj.Setup.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Dqkj.Setup"
xmlns:prism="http://prismlibrary.com/"
StartupUri="MainWindow.xaml" >
<Application
x:Class="Dqkj.Setup.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Dqkj.Setup"
xmlns:prism="http://prismlibrary.com/"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>-->
<ResourceDictionary Source="pack://application:,,,/电趣百宝箱Setup;component/Style/ControlStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="pack://application:,,,/电趣助手Setup;component/Style/ControlStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
......
using System.Windows;
using System.IO;
using System.Windows;
namespace Dqkj.Setup
{
......
......@@ -8,7 +8,7 @@ namespace Setup.Common
{
internal class ApiHelper
{
private const string _url = "http://crm.yilongex.cn/api/client/product/list?productId=P15615";
private const string _url = "https://b.dqukj.com/api/client/product/list?productId=P00687";
private static readonly HttpClient _httpClient = new HttpClient();
public static async Task<string> CheckAsync()
......
using System.Diagnostics;
using System.Windows;
namespace Dqkj.Setup.Common
{
......@@ -27,6 +28,7 @@ namespace Dqkj.Setup.Common
{
if (process.ProcessName.ToLower() == name.ToLower())
{
MessageBox.Show(process.ProcessName);
return true;
}
}
......
......@@ -7,7 +7,7 @@
<ProjectGuid>{743C17E3-641B-429C-A271-2ED6BEAA6B63}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Setup</RootNamespace>
<AssemblyName>电趣百宝箱Setup</AssemblyName>
<AssemblyName>电趣助手Setup</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
......
<Window x:Class="Dqkj.Setup.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Dqkj.Setup"
mc:Ignorable="d"
Title="安装包"
Height="300"
Width="560"
WindowStyle="None" Background="Transparent" AllowsTransparency="True" WindowStartupLocation="CenterScreen"
Loaded="Window_Loaded" >
<Border CornerRadius="5" Background="White" BorderThickness="2"
BorderBrush="#EB6618" >
<Window
x:Class="Dqkj.Setup.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Dqkj.Setup"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="安装包"
Width="560"
Height="300"
AllowsTransparency="True"
Background="Transparent"
Loaded="Window_Loaded"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
mc:Ignorable="d">
<Border
Background="White"
BorderBrush="#EB6618"
BorderThickness="2"
CornerRadius="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="45*" ></RowDefinition>
<RowDefinition Height="55*"></RowDefinition>
<RowDefinition Height="45*" />
<RowDefinition Height="55*" />
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="{StaticResource gd_color}" CornerRadius="3,3,0,0" MouseDown="Border_MouseDown" ></Border>
<Border
Grid.Row="0"
Background="{StaticResource gd_color}"
CornerRadius="3,3,0,0"
MouseDown="Border_MouseDown" />
<Button x:Name="buttClose" Content="×" Style="{StaticResource ButtonDashedBaseStyle}" Click="buttClose_Click" />
<Button
x:Name="buttClose"
Click="buttClose_Click"
Content="×"
Style="{StaticResource ButtonDashedBaseStyle}" />
<StackPanel Grid.Row="0" Orientation="Horizontal" Style="{StaticResource stackPanel_setup}">
<Image x:Name="imageLogo" Source="/Img/Subtract.png" Width="40" Height="40" />
<TextBlock x:Name="txtBlockTitle" Text="电趣百宝箱" FontSize="25" Foreground="White" VerticalAlignment="Center" Margin="10 0" ></TextBlock>
<StackPanel
Grid.Row="0"
Orientation="Horizontal"
Style="{StaticResource stackPanel_setup}">
<Image
x:Name="imageLogo"
Width="40"
Height="40"
Source="/Img/Subtract.png" />
<TextBlock
x:Name="txtBlockTitle"
Margin="10,0"
VerticalAlignment="Center"
FontSize="25"
Foreground="White"
Text="电趣助手" />
</StackPanel>
<Image Source="/Img/Rectangle 310-1.png" HorizontalAlignment="Left" IsHitTestVisible="False" />
<Image Source="/Img/Rectangle 310.png" HorizontalAlignment="Right" IsHitTestVisible="False" />
<Border Grid.Row="1" x:Name="operate">
<ContentControl x:Name="mian_content"/>
<Image
HorizontalAlignment="Left"
IsHitTestVisible="False"
Source="/Img/Rectangle 310-1.png" />
<Image
HorizontalAlignment="Right"
IsHitTestVisible="False"
Source="/Img/Rectangle 310.png" />
<Border x:Name="operate" Grid.Row="1">
<ContentControl x:Name="mian_content" />
</Border>
</Grid>
</Border>
......
......@@ -8,11 +8,11 @@ using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("电趣百宝箱 - 安装程序")]
[assembly: AssemblyTitle("电趣助手 - 安装程序")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Organization")]
[assembly: AssemblyProduct("电趣百宝箱 - 安装程序")]
[assembly: AssemblyProduct("电趣助手 - 安装程序")]
[assembly: AssemblyCopyright("Copyright © Organization 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
......
......@@ -20,11 +20,11 @@ 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);
startInfo.WorkingDirectory = Path.GetDirectoryName(_executionPath);
process.StartInfo = startInfo;
process.Start();
......@@ -34,6 +34,7 @@ namespace Dqkj.Setup.View
{
MessageBox.Show("启动异常,请尝试手动打开!", "温馨提示");
}
}
}
}
......@@ -4,6 +4,7 @@ using Dqkj.Setup.View;
using Setup.Common;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Net;
......@@ -45,8 +46,8 @@ namespace Dqkj.Setup
//#endif
defaultUpdateXmlUrl = await ApiHelper.CheckAsync();
executeName = "电趣百宝箱.exe";
formTitle = $"电趣百宝箱-自动更新";
executeName = "电趣助手.exe";
formTitle = $"电趣助手-自动更新";
}
......@@ -142,7 +143,22 @@ namespace Dqkj.Setup
_mainWindow.txtBlockTitle.Text = "安装完成";
_mainWindow.imageLogo.Source = new BitmapImage(new Uri("/Img/Vector.png", UriKind.Relative));
RegeditHelper.UninstallDelete(Path.GetFileNameWithoutExtension(executeName));
_mainWindow.mian_content.Content = new InstallCompleteView(Path.Combine(_installPath, executeName), _mainWindow);
//_mainWindow.mian_content.Content = new InstallCompleteView(Path.Combine(_installPath, executeName), _mainWindow);
var exePath = Path.Combine(_installPath, executeName);
if (File.Exists(exePath))
{
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo(exePath);
startInfo.WorkingDirectory = Path.GetDirectoryName(exePath);
process.StartInfo = startInfo;
process.Start();
Environment.Exit(-1);
}
else
{
MessageBox.Show("启动异常,请尝试手动打开!", "温馨提示");
}
}
public async Task<UpdateInfo> GetUpdateInfo()
......
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