[RESOLVED] App update system - better approach
Hi,
I am developing update system for my app, but I am facing issues.
My app will check every 6 hours if a newer version is available. If yes, it executes separate updater.exe which terminates the old version, downloads new version and executes it.
Problem is, my app will update silently in the background and if I will have deleted file (not in recycle bin) that I wanted to recover, new version logically overwrites the old one and also the file. Sure, its possible to embed updater.exe directly into my app, but nevertheless it must be extracted and executed.
What will be the best way to avoid that? Also, its possible to do that only with main app? i.e. without updater.exe
Re: App update system - better approach
Is there a reason that you cannot use ClickOnce? Automatic updates is probably the most important feature of ClickOnce.
Re: App update system - better approach
I'm not sure what the problem is. what does the updater do?
Should be using the bootstrap method... uses two apps... one to launch the other. The bootstrap app checks to see if there's an update, if there is, downloads it and installs it, then launches the app. If there is no update, then it simply launches the app. All shortcuts point to the bootstrap app. Nothing should point to the main app directly.
Now, if you want to check inside the app... have it look for an update, if there is one, launch the bootstrap app and then shut the main app down. The bootstrap then does it's thing, same as above... checks, downloads, installs, launches.
-tg
Re: App update system - better approach
From the description, this is more aggressive than ClickOnce. ClickOnce updates when the application starts, if there is a newer version. It sounds like what you are wanting to do is update even if the program is running. If that's not the case, then ClickOnce will be easier. If that is the case, then the bigger question I have is: How does the user feel about being interrupted for an update?
Re: App update system - better approach
Quote:
Originally Posted by
Shaggy Hiker
From the description, this is more aggressive than ClickOnce. ClickOnce updates when the application starts, if there is a newer version. It sounds like what you are wanting to do is update even if the program is running. If that's not the case, then ClickOnce will be easier. If that is the case, then the bigger question I have is: How does the user feel about being interrupted for an update?
ClickOnce also has a full API, there is no reason why a running application couldn't check for updates every 6 hours - https://docs.microsoft.com/en-us/vis...i?view=vs-2019 has a good example of how to do it.
Re: App update system - better approach
Quote:
Is there a reason that you cannot use ClickOnce? Automatic updates is probably the most important feature of ClickOnce.
I prefer solutions written by myself.
Quote:
I'm not sure what the problem is. what does the updater do?
Problem is, my app will update silently in the background and if I will have deleted file (not in recycle bin) that I wanted to recover, new version logically overwrites the old one and also the file. Sure, its possible to embed updater.exe directly into my app, but nevertheless it must be extracted and executed.
Quote:
Now, if you want to check inside the app... have it look for an update, if there is one, launch the bootstrap app and then shut the main app down. The bootstrap then does it's thing, same as above... checks, downloads, installs, launches.
I thought about that prior, but it seems that its impossible to avoid file overwriting.
Quote:
How does the user feel about being interrupted for an update?
The app will update silently, so user will notice nothing at all.
Re: App update system - better approach
What file is being deleted that is an issue? The app? the updater? Data? It's not clear what the problem is. What the file is that's being deleted, or why it's being deleted. OR why it's a problem.
-tg
Re: App update system - better approach
Quote:
What file is being deleted that is an issue? The app? the updater? Data? It's not clear what the problem is. What the file is that's being deleted, or why it's being deleted. OR why it's a problem.
Data.
My app will be for example in C:\users\user1\desktop\app.exe; updater - c:\users\user1\desktop\updater.exe; file that will be deleted by myself - c:\users\user1\desktop\file.pdf
Again, the problem is: I will have accidentally deleted file.pdf, then app.exe starts updater.exe+ updater.exe detects new version and downloads it silently and then executes updated version of my app. So file.pdf will be logically overwritten. I dont want to show notification - I need completely silent updating process.
Re: App update system - better approach
Quote:
Originally Posted by
VB.NET Developer
Data.
My app will be for example in C:\users\user1\desktop\app.exe; updater - c:\users\user1\desktop\updater.exe; file that will be deleted by myself - c:\users\user1\desktop\file.pdf
Again, the problem is: I will have accidentally deleted file.pdf, then app.exe starts updater.exe+ updater.exe detects new version and downloads it silently and then executes updated version of my app. So file.pdf will be logically overwritten. I dont want to show notification - I need completely silent updating process.
Again, your scenario makes no sense. If file.pdf is deleted as you say, then how is it "overwritten"??? Overwritten implies that a file exists and a different version of the file replaces it. If it has been deleted, it can't be overwritten.
And you say "accidentally" deleted. Wouldn't you want your updater to put the file back if it is accidentally deleted?
And in your scenario, you still haven't explained the actual problem or what you think your solution should be. What isn't silent in your scenario? If the user deletes the pdf file, how do you know if it was intentional or accidental?
Do you not want your updater to replace a missing (deleted) file? If not, then add logic to your updater that first checks if the file exists, and only replace it if it is there. If the file is missing, then don't do anything with that file.
Good luck.
Re: App update system - better approach
Quote:
Again, your scenario makes no sense. If file.pdf is deleted as you say, then how is it "overwritten"??? Overwritten implies that a file exists and a different version of the file replaces it. If it has been deleted, it can't be overwritten.
As an experienced computer user, sure, I know what is file overwriting etc. PDF file is deleted PRIOR new version is downloaded.
Quote:
And you say "accidentally" deleted. Wouldn't you want your updater to put the file back if it is accidentally deleted?
updater and file arent connected. For example, if user deletes file, then updater silently checks and downloads new version - that causes file overwriting. Updater will have a hardcoded timer WHEN.
Quote:
And in your scenario, you still haven't explained the actual problem or what you think your solution should be. What isn't silent in your scenario? If the user deletes the pdf file, how do you know if it was intentional or accidental?
again, that does not matter, updater and app will only updates my app.
Quote:
Do you not want your updater to replace a missing (deleted) file? If not, then add logic to your updater that first checks if the file exists, and only replace it if it is there. If the file is missing, then don't do anything with that file.
Absolutely no.
Re: App update system - better approach
Your responses make zero sense and I won't spend any additional time on this.
Good luck.
Re: App update system - better approach
The bottom line is, this is your updater that you wrote. If it isn't doing what you want, then you have no one to blame but yourself.
You've shared exactly zero lines of code in this thread, so I don't know what you expect to get as far as help.
If I were to ask you, what exactly, do you want to have happen in the case that the user "accidentally deletes this magic pdf file", what would your answer be?
In which case, then the response back to you is, "Ok, then write code that makes your updater do that."
No mas.
Re: App update system - better approach
Quote:
Originally Posted by
OptionBase1
Your responses make zero sense and I won't spend any additional time on this.
Good luck.
I don't think English is his first language. I read his posts multiple times and still didn't get what he was asking but I definitely think there is something there. He just doesn't know how to express it properly in English. Cut him a little slack.
Re: App update system - better approach
I'm sure their English is infinitely better than my (their native language). But that doesn't mean I'm obligated to spend additional time trying to ask more and more probing questions to try to ascertain what, exactly, the problem is with this system that they still haven't provided a single line of code for.
And so I was merely notifying them that I'm exercising my right to not spend any more of my time in their endeavor and wishing them good luck.
Re: App update system - better approach
I know how to code that system, I just needed advice how to avoid file overwriting. But I tested it today in my computer and I will be using two-app approach.