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
1ec84764
Commit
1ec84764
authored
Mar 16, 2023
by
黄树航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理代码
parent
92a69bdc
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
17 additions
and
104 deletions
+17
-104
App.xaml.cs
App.xaml.cs
+1
-13
DirectoryHelper.cs
Common/DirectoryHelper.cs
+1
-4
Encrypt.cs
Common/Encrypt.cs
+1
-3
ProcessHelper.cs
Common/ProcessHelper.cs
+1
-6
RegeditHelper.cs
Common/RegeditHelper.cs
+0
-5
Utils.cs
Common/Utils.cs
+1
-3
XmlHelper.cs
Common/XmlHelper.cs
+1
-5
MainWindow.xaml.cs
MainWindow.xaml.cs
+2
-17
UpdateInfo.cs
Model/UpdateInfo.cs
+0
-3
VersionInfo.cs
Model/VersionInfo.cs
+1
-4
InstallCompleteView.xaml.cs
View/InstallCompleteView.xaml.cs
+1
-13
InstallView.xaml.cs
View/InstallView.xaml.cs
+2
-13
ProgressView.xaml.cs
View/ProgressView.xaml.cs
+5
-15
No files found.
App.xaml.cs
View file @
1ec84764
using
System
;
using
System.Collections.Generic
;
using
System.Configuration
;
using
System.Data
;
using
System.Diagnostics
;
using
System.IO
;
using
System.Linq
;
using
System.Reflection
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows
;
namespace
Dqkj.Setup
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public
partial
class
App
:
Application
{
public
App
()
...
...
Common/DirectoryHelper.cs
View file @
1ec84764
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Dqkj.Setup.Common
{
...
...
@@ -38,7 +35,7 @@ namespace Dqkj.Setup.Common
}
public
static
void
DeleteTemp
(
List
<
string
>
lisDelete
)
public
static
void
DeleteTemp
(
List
<
string
>
lisDelete
)
{
foreach
(
var
ss
in
lisDelete
)
{
...
...
Common/Encrypt.cs
View file @
1ec84764
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Security.Cryptography
;
using
System.Text
;
...
...
@@ -14,7 +12,7 @@ namespace Dqkj.Setup
static
string
key
=
"GZCZKJABCDEFG001"
;
public
static
string
DesEncrypt
(
string
normalTxt
)
{
{
return
des
.
DesEncrypt
(
normalTxt
,
key
);
}
...
...
Common/ProcessHelper.cs
View file @
1ec84764
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Diagnostics
;
namespace
Dqkj.Setup.Common
{
...
...
Common/RegeditHelper.cs
View file @
1ec84764
using
Microsoft.Win32
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
namespace
Dqkj.Setup.Common
{
...
...
Common/Utils.cs
View file @
1ec84764
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
namespace
Dqkj.Setup
...
...
@@ -32,7 +30,7 @@ namespace Dqkj.Setup
FileStream
file
=
new
FileStream
(
fileName
,
FileMode
.
Open
);
System
.
Security
.
Cryptography
.
MD5
md5
=
new
System
.
Security
.
Cryptography
.
MD5CryptoServiceProvider
();
byte
[]
retVal
=
md5
.
ComputeHash
(
file
);
file
.
Close
();
file
.
Close
();
StringBuilder
sb
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
retVal
.
Length
;
i
++)
{
...
...
Common/XmlHelper.cs
View file @
1ec84764
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.IO
;
using
System.Xml.Serialization
;
namespace
Dqkj.Setup
...
...
MainWindow.xaml.cs
View file @
1ec84764
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Navigation
;
using
System.Windows.Shapes
;
namespace
Dqkj.Setup
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public
partial
class
MainWindow
:
Window
{
public
MainWindow
()
...
...
@@ -37,7 +22,7 @@ namespace Dqkj.Setup
private
void
Window_Loaded
(
object
sender
,
RoutedEventArgs
e
)
{
this
.
mian_content
.
Content
=
new
InstallView
(
this
);
this
.
mian_content
.
Content
=
new
InstallView
(
this
);
}
}
}
Model/UpdateInfo.cs
View file @
1ec84764
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Dqkj.Setup
{
...
...
Model/VersionInfo.cs
View file @
1ec84764
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Dqkj.Setup
{
...
...
@@ -17,6 +14,6 @@ namespace Dqkj.Setup
{
return
System
.
Version
.
Parse
(
this
.
Version
);
}
}
}
}
}
View/InstallCompleteView.xaml.cs
View file @
1ec84764
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Diagnostics
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Navigation
;
using
System.Windows.Shapes
;
namespace
Dqkj.Setup.View
{
...
...
View/InstallView.xaml.cs
View file @
1ec84764
using
Microsoft.Win32
;
using
System
;
using
System.Collections.Generic
;
using
System
;
using
System.IO
;
using
System.Linq
;
using
System.Reflection
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Shapes
;
namespace
Dqkj.Setup
{
...
...
@@ -61,7 +50,7 @@ namespace Dqkj.Setup
}
if
(!
Directory
.
Exists
(
txtPath
.
Text
))
{
MessageBox
.
Show
(
"选择的路径不存在!"
,
"温馨提示"
);
MessageBox
.
Show
(
"选择的路径不存在!"
,
"温馨提示"
);
return
;
}
_mainWindow
.
mian_content
.
Content
=
new
ProgressView
(
txtPath
.
Text
,
_mainWindow
);
...
...
View/ProgressView.xaml.cs
View file @
1ec84764
...
...
@@ -5,23 +5,13 @@ using Dqkj.Setup.Common;
using
Dqkj.Setup.View
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.IO
;
using
System.IO.Compression
;
using
System.Linq
;
using
System.Net
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Forms
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Shapes
;
using
Path
=
System
.
IO
.
Path
;
namespace
Dqkj.Setup
...
...
@@ -74,12 +64,12 @@ namespace Dqkj.Setup
public
async
void
Download
()
{
var
serverVersion
=
await
GetUpdateInfo
();
var
serverVersion
=
await
GetUpdateInfo
();
if
(
serverVersion
==
null
)
{
throw
new
Exception
(
"获取安装配置异常!"
);
}
if
(
ProcessHelper
.
CheckProcess
(
executeName
.
Replace
(
".exe"
,
""
)))
{
var
reply
=
System
.
Windows
.
MessageBox
.
Show
(
"程序正在运行,是否自动关闭程序并开始更新升级"
,
formTitle
,
MessageBoxButton
.
YesNo
,
MessageBoxImage
.
Information
);
var
reply
=
System
.
Windows
.
MessageBox
.
Show
(
"程序正在运行,是否自动关闭程序并开始更新升级"
,
formTitle
,
MessageBoxButton
.
YesNo
,
MessageBoxImage
.
Information
);
if
(
reply
!=
MessageBoxResult
.
Yes
)
{
return
;
...
...
@@ -104,7 +94,7 @@ namespace Dqkj.Setup
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private
void
Client_DownloadFileCompleted
(
object
sender
,
System
.
ComponentModel
.
AsyncCompletedEventArgs
e
)
private
void
Client_DownloadFileCompleted
(
object
sender
,
System
.
ComponentModel
.
AsyncCompletedEventArgs
e
)
{
try
{
...
...
@@ -140,7 +130,7 @@ namespace Dqkj.Setup
}
finally
{
DirectoryHelper
.
DeleteTemp
(
new
List
<
string
>{
zip_temp
,
_installPath
+
"_"
});
DirectoryHelper
.
DeleteTemp
(
new
List
<
string
>
{
zip_temp
,
_installPath
+
"_"
});
}
}
...
...
@@ -159,7 +149,7 @@ namespace Dqkj.Setup
{
WebClient
client
=
new
WebClient
();
client
.
Encoding
=
Encoding
.
UTF8
;
var
serverXml
=
await
client
.
DownloadStringTaskAsync
(
new
Uri
(
defaultUpdateXmlUrl
));
var
serverXml
=
await
client
.
DownloadStringTaskAsync
(
new
Uri
(
defaultUpdateXmlUrl
));
if
(!
string
.
IsNullOrEmpty
(
serverXml
))
{
info
=
XmlHelper
.
Deserialize
<
UpdateInfo
>(
serverXml
);
...
...
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