-
Nov 19th, 2020, 05:17 PM
#1
Thread Starter
Hyperactive Member
[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
Please dont forget to add good reputation if my advices were useful for you.
How? Under this post there is "RATE THIS POST" button. Click on it.
-
Nov 19th, 2020, 07:00 PM
#2
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.
-
Nov 20th, 2020, 01:30 PM
#3
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
-
Nov 20th, 2020, 02:49 PM
#4
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?
My usual boring signature: Nothing
-
Nov 20th, 2020, 04:49 PM
#5
Re: App update system - better approach
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.
-
Nov 23rd, 2020, 01:57 PM
#6
Thread Starter
Hyperactive Member
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.
I prefer solutions written by myself.
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.
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.
How does the user feel about being interrupted for an update?
The app will update silently, so user will notice nothing at all.
Please dont forget to add good reputation if my advices were useful for you.
How? Under this post there is "RATE THIS POST" button. Click on it.
-
Nov 23rd, 2020, 02:21 PM
#7
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
-
Nov 25th, 2020, 11:50 AM
#8
Thread Starter
Hyperactive Member
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.
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.
Last edited by VB.NET Developer; Nov 25th, 2020 at 11:53 AM.
Please dont forget to add good reputation if my advices were useful for you.
How? Under this post there is "RATE THIS POST" button. Click on it.
-
Nov 25th, 2020, 12:07 PM
#9
Re: App update system - better approach
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.
-
Nov 25th, 2020, 12:49 PM
#10
Thread Starter
Hyperactive Member
Re: App update system - better approach
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.
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.
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.
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.
Please dont forget to add good reputation if my advices were useful for you.
How? Under this post there is "RATE THIS POST" button. Click on it.
-
Nov 25th, 2020, 01:16 PM
#11
Re: App update system - better approach
Your responses make zero sense and I won't spend any additional time on this.
Good luck.
-
Nov 25th, 2020, 03:37 PM
#12
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.
-
Nov 25th, 2020, 05:30 PM
#13
Re: App update system - better approach
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.
-
Nov 25th, 2020, 05:45 PM
#14
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.
Last edited by OptionBase1; Nov 25th, 2020 at 06:14 PM.
-
Nov 30th, 2020, 03:00 PM
#15
Thread Starter
Hyperactive Member
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.
Please dont forget to add good reputation if my advices were useful for you.
How? Under this post there is "RATE THIS POST" button. Click on it.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|