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
720ab703
Commit
720ab703
authored
Jun 07, 2023
by
黄树航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
右下角加个版本号
parent
36ad5bcd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
14 deletions
+22
-14
ApiHelper.cs
Common/ApiHelper.cs
+1
-0
MainWindow.xaml
MainWindow.xaml
+6
-0
MainWindow.xaml.cs
MainWindow.xaml.cs
+3
-1
AssemblyInfo.cs
Properties/AssemblyInfo.cs
+2
-2
InstallCompleteView.xaml.cs
View/InstallCompleteView.xaml.cs
+4
-5
ProgressView.xaml.cs
View/ProgressView.xaml.cs
+6
-6
No files found.
Common/ApiHelper.cs
View file @
720ab703
...
...
@@ -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
()
...
...
MainWindow.xaml
View file @
720ab703
...
...
@@ -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
MainWindow.xaml.cs
View file @
720ab703
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
);
}
}
...
...
Properties/AssemblyInfo.cs
View file @
720ab703
...
...
@@ -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")]
View/InstallCompleteView.xaml.cs
View file @
720ab703
...
...
@@ -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
(
"启动异常,请尝试手动打开!"
,
"温馨提示"
);
}
}
}
}
View/ProgressView.xaml.cs
View file @
720ab703
...
...
@@ -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
();
...
...
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