Code Monkey home page Code Monkey logo

mautoupdate's Introduction

MAutoUpdate

配置说明

Server.xml

<?xml version="1.0" encoding="utf-8" ?>
<ServerUpdate>
  <item>
    <ApplicationStart>demo.exe</ApplicationStart>//更新后启动的程序
    <AppName>Print</AppName>//程序名称(暂时没用)
    <MinVersion>1.0.0.0</MinVersion>//最小版本号(暂时没用)
    <ReleaseDate>2017/9/28 9:25:24</ReleaseDate>//发布时间
    <ReleaseUrl>http://localhost/WebApp/update/1.1.0.0.zip</ReleaseUrl>//下载地址
    <ReleaseVersion>1.1.0.0</ReleaseVersion>//发布版本号
    <VersionDesc>更新说明文件的链接地址信息,rtf的格式</VersionDesc>//更新界面提示信息
    <UpdateMode>Increment</UpdateMode>//Cover表示覆盖更新,Increment表示增量更新
  </item>
</ServerUpdate>

Local.xml

<LocalUpdate>
  <LocalVersion>1.0.0.0</LocalVersion>//本地版本号
  <LastUdpate>2016/9/28 9:25:24</LastUdpate>//最后更新时间
  <ServerUpdateUrl>http://localhost/TestWeb/Server.xml</ServerUpdateUrl>//server.xml文件地址
</LocalUpdate>

使用方法

启动更新程序方法

 [STAThread]
        static void Main()
        {
            String path = AppDomain.CurrentDomain.BaseDirectory + "MAutoUpdate.exe";//程序路径
            //同时启动自动更新程序
            if (File.Exists(path))//判断是否存在更新程序
            {
                ProcessStartInfo processStartInfo = new ProcessStartInfo()
                {
                    FileName = "MAutoUpdate.exe",
                    Arguments = " MAutoUpdate.Test 1"//参数信息,程序名称 0:弹窗更新 1:静默更新
                };
                Process proc = Process.Start(processStartInfo);
                if (proc != null)
                {
                    proc.WaitForExit();
                }
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }

mautoupdate's People

Contributors

wangsuiche avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.