winepak / applications

A collection of flatpak manifest for building Microsoft Windows applications with Wine via flatpak
https://www.winepak.org
416 stars 39 forks source link

Add Growtopia game #136

Open lionirdeadman opened 5 years ago

lionirdeadman commented 5 years ago

Everything should be working except a pop-up because (I assumed) touch emulation is not a thing in WINE, once that's dismissed, everything works.

Things to note :

lionirdeadman commented 5 years ago

Actually, I noticed two more issues. Really unsure how I can fix either...

Any ideas would be appreciated.

user5145 commented 5 years ago

you can install it into /var/data that's the only possible way i can think of.

lionirdeadman commented 5 years ago

I already install it there, the problem is the game requires you to install new .exes for updates.

user5145 commented 5 years ago

I've never played this game, don't know how it updates and maybe it's a very stupid idea but can't you put something like this into /app/bin/growtopia?

... if [[ /app/bin/updater.exe -nt /var/data/some/file/that/always/updates ]]; then wine /app/bin/updater.exe fi

wine /var/data/...

and add the updater's url to sources or extra-data. Someone should change that url every update and /app/bin/growtopia would check it at startup.

edit: nvm, i get it, you have to reinstall the game every update edit2: I think that the only way is to use the real url (http://ubistatic-a.akamaihd.net/0098/20180921/GrowtopiaInstaller.exe) and constantly update that url and check if the url changed or maybe if the game returns something different than 0 (echo "$?") when it has to be updated but doesn't do it normally than it is possible to use that number, but only if it does.

lionirdeadman commented 5 years ago

From my understanding, the game only knows there's an update when it connects to the servers so that wouldn't work :(

I'm almost thinking about checking the hashes of https://growtopiagame.com/Growtopia-Installer.exe each time you want to start the game and comparing it to the last known hash but that's 90MB each time.. Idk how else it could be done :/

user5145 commented 5 years ago

:( i thought rather to download only the headers wget --server-response --spider http://ubistatic-a.akamaihd.net/0098/20180921/GrowtopiaInstaller.exe 2>&1 | grep -i Last-Modified

it's from (https://superuser.com/questions/619592/get-modification-time-of-remote-file-over-http-in-bash-script)

but Last-Modified isn't reliable and it doesn't work if it was redirected so (https://growtopiagame.com/Growtopia-Installer.exe) doesn't work. it's for sure possible to make it to work but who knows how.

I found out that curl -L -v https://growtopiagame.com/Growtopia-Installer.exe does it well in a terminal (it's possible to get the date from this line "Issue another request to this URL: http://ubistatic-a.akamaihd.net/0098/20180921/GrowtopiaInstaller.exe" it's that 20180921 number ) but it's because it's failing so probably it shouldn't be used

edit: I think /dosdevices/c:/Program Files (x86)/Growtopia should be changed to something like /dosdevices/c:/users/$USER/Local Settings/Application Data/Growtopia and i'm not able to force it to install an old version so i can't really try anything funny is that http://ubistatic-a.akamaihd.net/0098/20180909/GrowtopiaInstaller.exe and ubistatic-a.akamaihd.net/0098/20180921/GrowtopiaInstaller.exe are the same file and there is nothing before 20180909

lionirdeadman commented 5 years ago

I didn't know how to do $USER because I'm a big noob but yes, that'd be much better than telling users to put it somewhere else than the default location.

That curl command could be used although I don't know how to implement that in the script. Even if the file is the same, if the date changed, it might be a new executable so it's worth trying.

user5145 commented 5 years ago

don't worry about being noob. Everybody is like that We have to destroy something to learn how it works. And my English is noobish so no one is perfect :). Maybe i'm not too helpful to you but i don't want to leave you with this problem alone.

I've been thinking about it for a while and It seems that the best way to do it is to add it as a source file as i said in my second comment. Most projects work in this way and it seems that people don't care to automate it. When there is an update then someone updates the url to keep it working. You can see it in flathub's repositories. They are on github (though you probably know it).

I've had the same problem with homm3 and that's how i resolved it (I still have to manually force it to update though). No one has reviewed it so I don't know if it's the way it's supposed to be done, but that's the way I think is the best.

you can see it at user5145/applications in this file /com.gog.HeroesofMightandMagic/com.gog.HeroesofMightandMagic.hd.yml

I hope it's at least a bit helpful to you.

Edit: If you don't want to do it that way then maybe try to create 2 icons (i'm not sure if that's possible, but libreoffice somehow does it) one for the game and one for the updates and then let users download the latest installer and use zenity to get it. FILE="$(zenity --file-selection --title='Select a File')" echo $FILE