locked
How to Create an Updater for an Asp.Net Core Razor Pages App? RRS feed

  • Question

  • User-1237764778 posted

    I've been developing an Asp.Net Core Razor Pages app,and now that it's almost finished,I'd like to add functionality to the app so that users can update the app without the admin having to log into the server and deleting old published files,and uploading new ones! I wonder if someone can help me accomplish that?

    Wednesday, September 11, 2019 12:24 PM

All replies

  • User-821857111 posted

    Your question is quite confusing/lacking detail. Are you proposing to deploy the application on customer servers? How do you plan to deliver updates? What will be the trigger for the user to update the app?

    Wednesday, September 11, 2019 1:32 PM
  • User-1237764778 posted

    I've developed an app for language schools,and so many schools will be using this app on their own servers to manage their classes,students and all that.

    So,I'm planning to have a server specific to the app,where the updates are saved in a folder in zip format.Also,The app versions will be saved in a table.

    There's also a table in the app where the id of the running version is saved,so each time the schools who have bought the app log in,the app will check the latest version they're running(in the table on their database compared with the the database on app's official's website)  and if there's a newer version available,it'll prompt the user to update the app.I'd like to put a button on the app where the user can click and have the app updated with the latest version on their server without me having to log in their servers(supposing there are many of them) and doing it manually for them.I hope I made it clear.

    Wednesday, September 11, 2019 2:38 PM
  • User-821857111 posted

    Normally, you develop an application as a web app specifically to avoid all this updating nonsense. You host it yourself and apply updates yourself. 

    As far as I know, there are no tools for managing what you want, so you will have to develop your own. However you implement them, the admin will have to know about administering .NET Core applications on a web server.

    How you develop the tools depends on how much of the deployment workflow you want to cover. I guess you will generate the published output that forms the update. How will the user get it? What do you want them to be able to do/not do?

    I guess I am saying that (apart from this is the wrong approach), you really need to think the process through and decide what you want.

    Wednesday, September 11, 2019 4:12 PM
  • User-474980206 posted

    typically app updater work the following.

    1) check for update
    2) start update program
    3) exit
    4) update program downloads new files
    5) update program restarts the program
    6) update program exits.

    you can do this for a website. your update program will be command line utility, which should be in another folder rather than the app. your website can check for update than runs this application. you may have some issues here:

    1) the firewall may block outbound requests, your users will need to open the firewall
    2) often the files are in use. if you are using the asp.net core module, at the start of the update you should put a file named app_offline.htm in the root folder (which will shutdown the site - you may need to a short delay waiting for this). after copying all the files, delete this file and the site will start up.

    Wednesday, September 11, 2019 4:53 PM
  • User-1237764778 posted

    Simply put,What if you've developed a web app that is supposed to be used by many customers? How do you provide updates to them?

    Wednesday, September 11, 2019 7:36 PM
  • User-821857111 posted

    I would host the application, and depending on the type of application, either have one tenanted database to serve all users, or provide a separate database per user. Either way, I have total control over updates.

    If you let your users choose when to update, some might decide not to. Over time, you will end up supporting multiple versions of the application. You will end up with support issues concerning bugs that have long been fixed, but the customer is still using an old version.

    Thursday, September 12, 2019 7:01 AM
  • User-1237764778 posted

    Look,the app is supposed be uploaded to a school's web server and used by their students.My problem is how I can provide update to schools that are running my app on their servers? I don't want to send them the published files so that their web admins upload them to their servers since they could simply deploy the published app in other school's servers without paying for it.

    Friday, September 13, 2019 1:43 PM
  • User-474980206 posted

    the complexity of updating web application is one of the reasons hosted applications are so popular. 

    You will find that your customers are unwilling to apply updates, and will often break the site trying to. You will need to make this a very smooth process. You may need to support multiple install / update methods (ftp, file copy, usb stick, dvd, etc). The hosting web server should be secured behind a firewall and should not have internet access. 

    Friday, September 13, 2019 2:30 PM
  • User475983607 posted

    Look,the app is supposed be uploaded to a school's web server and used by their students.My problem is how I can provide update to schools that are running my app on their servers? I don't want to send them the published files so that their web admins upload them to their servers since they could simply deploy the published app in other school's servers without paying for it.

    For what it's worth...

    I'm currently dealing with an older application designed similar to yours.  It is an absolute nightmare.   The application was build by vendors who thought it was a good idea for schools to host the vendor application which communicates with a service at my company.  Well several years later, my company cannot implement the latest TLS 1.2 ( or 1.1)  because many of the applications have not been updated for years.  There are even 2003 server are out there.  I've been dealing with this for over a year now and simply cannot get the remote locations on board.  We can't cut then off due to the nature of the service.  My company has to pay extra each month for monitoring services due to the actions of a third party.

    To answer your question, you'll need to coordinate with the schools admin and come up with a solution.  IMHO, this is not a good question for an web support forum as web sites solve this exact problem.  IMHO, you should look into installation software packages.

    https://docs.microsoft.com/en-us/windows/win32/msi/windows-installer-portal

    However, you'll still end up with different version of software.

    Friday, September 13, 2019 3:03 PM
  • User-821857111 posted

    I don't want to send them the published files so that their web admins upload them to their servers since they could simply deploy the published app in other school's servers without paying for it.
    But you have already done that, haven't you? How else does the application get installed on their server? As soon as you performed the initial installation, you provided them with the published files.

    Friday, September 13, 2019 7:36 PM