I have written a few basic programs in C++ and I would like to make them auto update over the internet or over my intranet (I have a website and an intranet).
I can upload files to my intranet and website fine but the problem is, I do not know how to write the code for an auto updater. Could someone please explain to me how to write an auto updater or provide a link to a website which explains how to make one. Any source code you could provide would be very useful. It can be in any language as long as it works with my C++ programs!
I am only just starting so please keep it simple! Thanks in advance.
Richard
P.S. I am using Windows Vista Home Premium and Visual Studio 2008 Professional Edition.
Can't keep it simple, this is an advance topic. I'll give the general overview of a method to accomplish this.
Things you'll need to understand
TCP/IP - C++ to communicate through sockets and ports
HTTP - C++ you'll need to send http encoded commands via http, so knowing how to construct an http message will be needed.
PHP - (web server side )This is required to accept your commands from the c++ program and return your update
Additional things:
You'll need to determine a method to tell if you program needs to be updated, either through filename or file version. ( If you don't know then none of this will work)
//General overview
A c++ program will create a connection to the web server and the web server will check to see if it should send the update file or not.
The web server side will receive an http encoded message, it will parse the string and determine the type of request.
c++ program side
---------------------------
1) - construct a c++ program to create a socket connection on port 80 ( internet port )
2) Construct your http header request to send to your php script
3) Read the response and store it, then execute it. ( Note the current program this will update will need to be turned of so you'll have to take that into consideration
web server side
----------------------
1) Grab and interpret the message
2) send file if the message is appropriate
or
send message that no update is needed.
Hope this gives you an overview, It's impossible to show you code because there is no simple method for this, too many scenarios and variables to consider and I don't know how much you know of the topics mentioned.
Most likely, you need a client/server application. You program keep running as a client, and connect to a server side support program over TCP/IP. Every loop, you can send a request to server, or just read of a new update through Socket.
Good luck,
peng
Running SiteMonitor update site status every minute at http://www.eptop.com:8080/SiteMonitor/Di...
Since you are using visual studio, you can use the deployment options to acheive this. The easiest way is to use the click once deployment method. Open the project, right click on the projects name in the solution explorer, Click on the publish tab in the window, then click the updates button and answer the questions. Now deploy the project and install it and it will check for updates in the location that you specified.
What's the right content management software for me?
I want to store a character(char variable) in a String matrix?
|