שתף באמצעות


Best way to auto-update your local EXE application

Question

Thursday, December 29, 2016 3:04 PM

Hi everyone,

I'd like to update my app and I need to know how do I switch over the new downloaded version with the old one whereas the current/old version is still open.

Because the update option of my app, is located to menu "Help", in sub-menu "Get updates", and all the downloading process must be displayed in "Get updates" Form in order for users to see what is going on, meaning that the old/current app will stay open.    

So How do I delete the old/current version while it's open?

I read here that there's something called "AppDomainSetup.ShadowCopyFiles" but I've never used it.

Just some GOOD ideas guys of How to do that, please !!!

PS : Please I don't need to know how to automatically download the app from Internet; I only need how to switch both apps once they are already in the local computer (hdd)

All replies (7)

Thursday, December 29, 2016 3:13 PM ✅Answered

Below links should help:

http://stackoverflow.com/questions/16636096/vb-net-program-should-auto-update

https://www.codeproject.com/articles/11542/application-auto-update-in-vb-net

https://autoupdaterdotnet.codeplex.com/

ClickOnce technology:

https://msdn.microsoft.com/en-us/library/t71a733d.aspx

Paul ~~~~ Microsoft MVP (Visual Basic)


Thursday, December 29, 2016 3:17 PM

Thanks but

I don't like and don't use ClickOnce deployment, I use InnoSetup & InstallShield.


Thursday, December 29, 2016 3:27 PM

Thanks but

I don't like and don't use ClickOnce deployment, I use InnoSetup & InstallShield.

ClickOnce was the last option on the list. I would see the others if this is not an option or you want to code your own method. You can't delete the app while it's running and that is why there is an updater which will kill the process first before performing the update.

Paul ~~~~ Microsoft MVP (Visual Basic)


Thursday, December 29, 2016 3:28 PM

Your question falls in the omnipotent paradox. 

The best know sentence for it is

Can the almighty create a stone so heavy that it cannot lift it?

That is the same with a running program, it cannot replace itself. 

Therefor you need always a different program to do this. 

Success
Cor


Thursday, December 29, 2016 3:50 PM

Thanks Paul and everyone.

wanna know, out of idle curiosity cause I also need to build an app like Task Manager of window that will remind people in a specific time in order to send message to his collegue.

the above link you provided, specially this one, the reminder option, it keeps the data into an xml file and after a specified time it's recall the updater; I just wanna know, how does it work?? I mean how to check the clock that is exaclty 30 min in order to do something.

does it use "Timer" control in order to check the clock??  and if the data (time to call) are saved into xml file, they must be open in order to be read to check the clock??

and what is the best way to build an app-reminder which the user will set a schedule (day/month/year and timer (hh:mm:ss) and then the app will have to do something when it's time. and where to keep those data. should I always keep it in a xml file and open that xml file and set a "Timer" control to go and check the time every second...  will it not consume memory???

just need some ideas of you guys, please !!!


Thursday, December 29, 2016 4:04 PM

Thanks but

I don't like and don't use ClickOnce deployment, I use InnoSetup & InstallShield.

**As already stated-

You can't delete the app while it's running and that is why there is an updater which will kill the process first before performing the update.**

**
I believe that both InstallShield and InnoSetup can perform updates, there are many references to that using a search. If not, it's fairly easy to create an updater that will kill your process and download a new version. It probably will need to run as admin, since the "Program Files" folder is protected.

**


Thursday, December 29, 2016 4:40 PM

Thanks Paul and everyone.

wanna know, out of idle curiosity cause I also need to build an app like Task Manager of window that will remind people in a specific time in order to send message to his collegue.

the above link you provided, specially this one, the reminder option, it keeps the data into an xml file and after a specified time it's recall the updater; I just wanna know, how does it work?? I mean how to check the clock that is exaclty 30 min in order to do something.

does it use "Timer" control in order to check the clock??  and if the data (time to call) are saved into xml file, they must be open in order to be read to check the clock??

and what is the best way to build an app-reminder which the user will set a schedule (day/month/year and timer (hh:mm:ss) and then the app will have to do something when it's time. and where to keep those data. should I always keep it in a xml file and open that xml file and set a "Timer" control to go and check the time every second...  will it not consume memory???

just need some ideas of you guys, please !!!

Yes, I glanced at the code and it appears to use a Timer. You can download the project and look at the code if you want to know how it works.

Paul ~~~~ Microsoft MVP (Visual Basic)