Automatically checking for a new version of my application

前端 未结 12 1202
天命终不由人
天命终不由人 2021-01-30 18:12

Trying to honor a feature request from our customers, I\'d like that my application, when Internet is available, check on our website if a new version is available.

The

12条回答
  •  隐瞒了意图╮
    2021-01-30 18:52

    in php, the thing is easy:

    
    

    if course you could extend this so the currently available version isn't hard-coded inside the script, but this is just about illustrating the point.

    In your application you would have this pseudo code:

    result = makeHTTPRequest("http://www.example.com/update?version=" + getExeVersion());
    if result != "no update" then
        updater = downloadUpdater(result);
        ShellExecute(updater);
        ExitApplication;
    end;
    

    Feel free to extend the "protocol" by specifying something the PHP script could return to tell the client whether it's an important, mandatory update or not.

    Or you can add some text to display to the user - maybe containing some information about what's changed.

    Your possibilities are quite limitless.

提交回复
热议问题