Skip to content

Commit b805e8b

Browse files
author
Hello-Mango
authoredMar 12, 2018
Create README.md
1 parent e4bc860 commit b805e8b

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
 

‎README.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
3+
# MAutoUpdate
4+
## 配置说明
5+
Server.xml
6+
```xml
7+
<?xml version="1.0" encoding="utf-8" ?>
8+
<ServerUpdate>
9+
<item>
10+
<ApplicationStart>demo.exe</ApplicationStart>//更新后启动的程序
11+
<AppName>Print</AppName>//程序名称(暂时没用)
12+
<MinVersion>1.0.0.0</MinVersion>//最小版本号(暂时没用)
13+
<ReleaseDate>2017/9/28 9:25:24</ReleaseDate>//发布时间
14+
<ReleaseUrl>http://localhost/WebApp/update/1.1.0.0.zip</ReleaseUrl>//下载地址
15+
<ReleaseVersion>1.1.0.0</ReleaseVersion>//发布版本号
16+
<VersionDesc>1、Increment$2、hello$3、123456</VersionDesc>//更新界面提示信息($会替换成换行符)
17+
<UpdateMode>Increment</UpdateMode>//Cover表示覆盖更新,Increment表示增量更新
18+
</item>
19+
</ServerUpdate>
20+
```
21+
Local.xml
22+
```xml
23+
<LocalUpdate>
24+
<LocalVersion>1.0.0.0</LocalVersion>//本地版本号
25+
<LastUdpate>2016/9/28 9:25:24</LastUdpate>//最后更新时间
26+
<ServerUpdateUrl>http://localhost/TestWeb/Server.xml</ServerUpdateUrl>//server.xml文件地址
27+
</LocalUpdate>
28+
```
29+
## 使用方法
30+
启动更新程序方法
31+
```C#
32+
[STAThread]
33+
static void Main()
34+
{
35+
String path = AppDomain.CurrentDomain.BaseDirectory + "MAutoUpdate.exe";//程序路径
36+
//同时启动自动更新程序
37+
if (File.Exists(path))//判断是否存在更新程序
38+
{
39+
ProcessStartInfo processStartInfo = new ProcessStartInfo()
40+
{
41+
FileName = "MAutoUpdate.exe",
42+
Arguments = " MAutoUpdate.Test 1"//参数信息,程序名称 0:弹窗更新 1:静默更新
43+
};
44+
Process proc = Process.Start(processStartInfo);
45+
if (proc != null)
46+
{
47+
proc.WaitForExit();
48+
}
49+
}
50+
Application.EnableVisualStyles();
51+
Application.SetCompatibleTextRenderingDefault(false);
52+
Application.Run(new Form1());
53+
}
54+
```

0 commit comments

Comments
 (0)
Please sign in to comment.