Results 1 to 15 of 15

Thread: [RESOLVED] App update system - better approach

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2018
    Posts
    276

    Resolved [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.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    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.

  3. #3
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    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

  5. #5
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: App update system - better approach

    Quote Originally Posted by Shaggy Hiker View Post
    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.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2018
    Posts
    276

    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.

  7. #7
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2018
    Posts
    276

    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.

  9. #9
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: App update system - better approach

    Quote Originally Posted by VB.NET Developer View Post
    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.

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2018
    Posts
    276

    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.

  11. #11
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: App update system - better approach

    Your responses make zero sense and I won't spend any additional time on this.

    Good luck.

  12. #12
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    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.

  13. #13
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: App update system - better approach

    Quote Originally Posted by OptionBase1 View Post
    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.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  14. #14
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    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.

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2018
    Posts
    276

    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
  •  



Click Here to Expand Forum to Full Width