Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Setup
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄树航
Setup
Commits
4b35f49e
Commit
4b35f49e
authored
Apr 27, 2023
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改http链接为https,安装完成后自动打开
parent
38ae9d22
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
98 additions
and
43 deletions
+98
-43
App.xaml
App.xaml
+9
-8
App.xaml.cs
App.xaml.cs
+2
-1
ApiHelper.cs
Common/ApiHelper.cs
+1
-1
ProcessHelper.cs
Common/ProcessHelper.cs
+2
-0
Dqkj.Setup.csproj
Dqkj.Setup.csproj
+1
-1
MainWindow.xaml
MainWindow.xaml
+59
-25
AssemblyInfo.cs
Properties/AssemblyInfo.cs
+2
-2
InstallCompleteView.xaml.cs
View/InstallCompleteView.xaml.cs
+3
-2
ProgressView.xaml.cs
View/ProgressView.xaml.cs
+19
-3
No files found.
App.xaml
View file @
4b35f49e
<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>
...
...
App.xaml.cs
View file @
4b35f49e
using
System.Windows
;
using
System.IO
;
using
System.Windows
;
namespace
Dqkj.Setup
{
...
...
Common/ApiHelper.cs
View file @
4b35f49e
...
...
@@ -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
=
"http
s://b.dqukj.com/api/client/product/list?productId=P00687
"
;
private
static
readonly
HttpClient
_httpClient
=
new
HttpClient
();
public
static
async
Task
<
string
>
CheckAsync
()
...
...
Common/ProcessHelper.cs
View file @
4b35f49e
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
;
}
}
...
...
Dqkj.Setup.csproj
View file @
4b35f49e
...
...
@@ -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>
...
...
MainWindow.xaml
View file @
4b35f49e
<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>
...
...
Properties/AssemblyInfo.cs
View file @
4b35f49e
...
...
@@ -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("")]
...
...
View/InstallCompleteView.xaml.cs
View file @
4b35f49e
...
...
@@ -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
(
"启动异常,请尝试手动打开!"
,
"温馨提示"
);
}
}
}
}
View/ProgressView.xaml.cs
View file @
4b35f49e
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment