✅ hosting services
Does anyone know of any good, free hosting services that I can publish my desktop apps to so that when I make updates to the GUI, or backend code, and a user gets the update, it won't erase their existing information?
60 Replies
$vps
Cheap recommendations
https://www.scaleway.com https://www.digitalocean.com
https://www.linode.com https://www.ovh.co.uk
https://www.time4vps.eu https://www.vultr.com
https://www.hetzner.com https://contabo.com
Always free options
https://cloud.google.com/free
https://www.oracle.com/cloud/free/#always-free
oh wow lol already ready to go with a command haha thanks
Or you can just use Github releases
Github also has an API that would let you check if a new release is up, and download the files
And releases can be created automatically with actions too
oh? that sounds nice, too lol
yeah github releases sounds like an excellent usecase for this
as for "it wont erase their current information" thats up to your program to solve
ie, if you go from version 2 to version 3 and that includes saving data in a new format, you need to provide a way to migrate the old data, preferably automatically
ok I like that option better. I've created a repo that holds all the executables and related files for each program and I push updates there. I would rather use github so how would I set this up?
tyvm
The repo should be holding the code, releases will have the binaries
so don't create a repo to hold the executables separate from the code itself?
correct
example: https://github.com/odin-lang/Odin/releases
so when you release a new version, you just create a zip and upload it there
Or let gh actions do that
ok I'm a bit confused. Users who aren't programmers i.e. friends of mine, my mom, etc are instructed to go to the builds folder and download the zip folder that follows their operating system i.e. Builds>Windows>x64 and download the Todo_Windows_x64.zip folder. From there, they extract it to wherever they want on their computer and then just pin the executable to their taskbar, or start menu. The data they store in the todo app is there in that executable, so if I update the GUI and then push an update to the repo, how will my mom get the update to the application that exists on her system from the downloaded zip folder?
Download a new zip and overwrite the files
and that will still save their currently stored information?
Well, depends how you store it
If it's not a file that's there by default, then it won't be overwritten
like the todo app stores the users inputs into the database.json file which is located bin/debug/net7.0 folder. If it overwrites the files, it'll overwrite that one too
For example,
which, when ran, creates a
todos.sqlite
file
When the files will be overwritten with new files
only those files will be ovewritten
If that todos.sqlite
is also included in the zip, then it will be overwritten as well
Unless the user just... doesn't extract itso just be sure that I remove the database.json file before creating the zip?
because my apps create the file if it doesn't exist on the first save. When I test my apps, that file gets created and it's pushed from my workspace.
Or create that file on runtime
So it's not packaged with your app
I don't know how to do that
Ah, well, so it already does that
oh wait
my apps create the file if it doesn't exist on the first saveYou're good then Just make sure to create a release of your files, and not copy them from
bin/debug
That will build the app, but not run it
So the file with data won't be there
And will appear only when someone runs your app on their PCyour program doesnt ship with a
database.json
file, your program creates it as neededwait
the bin folder isn't included in the github push is it
however, if this is supposed to be used by other people it might be a good idea to start storing stuff in the appdata, instead of in the program folder directly
if I'm reading the gitignore correctly, then it isn't
it isn't unless specified to be ignored
correct. that doesnt matter
https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
You can use this
your
bin
folder should not be pushed to github
a release is not something you push via git
so many messages and i can't get my mind right. one second while I try and piece this together please
the database.json file is stored in the bin folder.
the bin folder is ignored via the gitignore file
so therefore when I push to the repo, it does not push the json file since the bin folder is ignored.
that part I have figured out
so when it comes to creating versions or whatever for the updates. How do I need to do my workspace so that the json file doesn't get included
or whatever. idk I've done got lost
your
database.json
file is generated at runtime by your program. its not part of the actual program release itselfright
you'd do
dotnet clean
and then dotnet publish
and then zip up the result of the publish
not the actual bin/net7.0/Release/publish
stuff, just the stuff in the publish folderright, but I use visual studio for that. not cli so how would I do that in visual studio's publish selection?
Publish wizard
like this is what comes in the zip folders after I have published my application and create a zip folder with the contents
mhm
notice the lack of a database.json file
right
so I just publish it like I've been doing and then create a zip folder
with the zip folder, I do what
upload to github releases
should look like this on the right of your github mainpage for the repo
right. it does
so you click that link
fill out the info, drag the zip file in
ok cool.
does github have a way that I can notify users of when an update has been pushedmade?
no
you can however build that into your app yourself
oh?
so when it starts, it tries to check for the latest version on github
and compares it to its local version
where does it do that at?
?
ok so the app itself doesn't do that automatically. I have to write that in
yes
so would I put that in the app.axaml.cs file?
¯\_(ツ)_/¯
You'd put it... somewhere.
I don't know avalonia
ok i'll look into it. thanks ❤️
to make it really nice and easy, just have it download this json and deserialize it: https://api.github.com/repos/OWNER/REPO/releases/latest
replace OWNER and REPO ofc
😄
I'll likely figure another way that just involves a pop up with an ok button for it to do it's thing. It's just going to take me a while to figure out since I've never done this before and I'm still new to C# and avalonia altogether. I'll have to build a pop up user control that will pop up over the main window to display the information, and build the code-behind for when the ok button is clicked, it will do what it's supposed to do without erasing the users currently saved data
so I'll just close this thread and create a new one pertaining to that and see if I can get some help