I implemented one project, which is very like what you wanted, it can be download patch, new coming software from server, but automatically install them, in one words, like the windows update.
I can not reuse the code, but the software structure is in my mind, so believe me, I can help you do it.
BTW, what i made the system is in windows, so if yours is not in Windows, please ignore me.