C
C#11mo ago
Mekasu0124

✅ 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
Buddy
Buddy11mo ago
$vps
Mekasu0124
Mekasu012411mo ago
oh wow lol already ready to go with a command haha thanks
Angius
Angius11mo ago
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
Mekasu0124
Mekasu012411mo ago
oh? that sounds nice, too lol
Pobiega
Pobiega11mo ago
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
Mekasu0124
Mekasu012411mo ago
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?
Mekasu0124
Mekasu012411mo ago
tyvm
Angius
Angius11mo ago
The repo should be holding the code, releases will have the binaries
Mekasu0124
Mekasu012411mo ago
so don't create a repo to hold the executables separate from the code itself?
Pobiega
Pobiega11mo ago
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
Angius
Angius11mo ago
Or let gh actions do that
Mekasu0124
Mekasu012411mo ago
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?
Angius
Angius11mo ago
Download a new zip and overwrite the files
Mekasu0124
Mekasu012411mo ago
and that will still save their currently stored information?
Angius
Angius11mo ago
Well, depends how you store it If it's not a file that's there by default, then it won't be overwritten
Mekasu0124
Mekasu012411mo ago
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
Angius
Angius11mo ago
For example,
\MyApp
|— MyApp.exe
|— README.md
\MyApp
|— MyApp.exe
|— README.md
which, when ran, creates a todos.sqlite file
\MyApp
|— MyApp.exe
|— README.md
|— todos.sqlite
\MyApp
|— MyApp.exe
|— README.md
|— todos.sqlite
When the files will be overwritten with new files
\MyApp-2.0
|— MyApp.exe
|— README.md
\MyApp-2.0
|— MyApp.exe
|— README.md
\MyApp
- |— MyApp.exe
- |— README.md
+ |— todos.sqlite
\MyApp
- |— MyApp.exe
- |— README.md
+ |— todos.sqlite
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 it
Mekasu0124
Mekasu012411mo ago
so 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.
Angius
Angius11mo ago
Or create that file on runtime So it's not packaged with your app
Mekasu0124
Mekasu012411mo ago
I don't know how to do that
Angius
Angius11mo ago
Ah, well, so it already does that
Mekasu0124
Mekasu012411mo ago
oh wait
Angius
Angius11mo ago
my apps create the file if it doesn't exist on the first save
You'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 PC
Pobiega
Pobiega11mo ago
your program doesnt ship with a database.json file, your program creates it as needed
Mekasu0124
Mekasu012411mo ago
wait the bin folder isn't included in the github push is it
Pobiega
Pobiega11mo ago
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
Mekasu0124
Mekasu012411mo ago
if I'm reading the gitignore correctly, then it isn't
Buddy
Buddy11mo ago
it isn't unless specified to be ignored
Pobiega
Pobiega11mo ago
correct. that doesnt matter
Pobiega
Pobiega11mo ago
your bin folder should not be pushed to github a release is not something you push via git
Mekasu0124
Mekasu012411mo ago
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
Pobiega
Pobiega11mo ago
your database.json file is generated at runtime by your program. its not part of the actual program release itself
Mekasu0124
Mekasu012411mo ago
right
Pobiega
Pobiega11mo ago
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 folder
Mekasu0124
Mekasu012411mo ago
right, but I use visual studio for that. not cli so how would I do that in visual studio's publish selection?
Angius
Angius11mo ago
Publish wizard
Mekasu0124
Mekasu012411mo ago
like this is what comes in the zip folders after I have published my application and create a zip folder with the contents
Pobiega
Pobiega11mo ago
mhm notice the lack of a database.json file
Mekasu0124
Mekasu012411mo ago
right so I just publish it like I've been doing and then create a zip folder with the zip folder, I do what
Pobiega
Pobiega11mo ago
upload to github releases
Pobiega
Pobiega11mo ago
Pobiega
Pobiega11mo ago
should look like this on the right of your github mainpage for the repo
Mekasu0124
Mekasu012411mo ago
right. it does
Pobiega
Pobiega11mo ago
so you click that link fill out the info, drag the zip file in
Mekasu0124
Mekasu012411mo ago
ok cool. does github have a way that I can notify users of when an update has been pushedmade?
Pobiega
Pobiega11mo ago
no you can however build that into your app yourself
Mekasu0124
Mekasu012411mo ago
oh?
Pobiega
Pobiega11mo ago
so when it starts, it tries to check for the latest version on github and compares it to its local version
Mekasu0124
Mekasu012411mo ago
where does it do that at?
Pobiega
Pobiega11mo ago
?
Mekasu0124
Mekasu012411mo ago
ok so the app itself doesn't do that automatically. I have to write that in
Pobiega
Pobiega11mo ago
yes
Mekasu0124
Mekasu012411mo ago
so would I put that in the app.axaml.cs file?
Pobiega
Pobiega11mo ago
¯\_(ツ)_/¯ You'd put it... somewhere. I don't know avalonia
Mekasu0124
Mekasu012411mo ago
ok i'll look into it. thanks ❤️
Pobiega
Pobiega11mo ago
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 😄
Mekasu0124
Mekasu012411mo ago
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
Want results from more Discord servers?
Add your server
More Posts