madsciencecoder / shticker-book-rewritten

Custom launcher and tool for the Toontown Rewritten MMORPG
GNU General Public License v3.0
33 stars 9 forks source link

Windows #1

Closed Virnios-zz closed 8 years ago

Virnios-zz commented 8 years ago

Can you PLEASE make a Windows version? I'd LOVE to use this, this sounds awesome with all the built in stuff, it will be very efficient. Please :D

madsciencecoder commented 8 years ago

Hey, glad you like it.

I've been working on getting it to work on Windows and have a working version. It however needed more changes than I expected so need to make sure they won't break Linux support. Once I add them in you could compile it yourself for Windows.

I'll unlikely provide a binary for a while because there's still quite a bit I need to add or change and recompiling it every time will just slow me down, also why I haven't yet added Linux packages yet.

Plus I can't figure out a good way to ship it for Windows. Due to LGPL licensing for Qt I can't statically link the library and there are a LOT of .dll's it requires. Linux, however, handles that extremely well with their package managers and global libraries.

Virnios-zz commented 8 years ago

Alright, let me know how it goes. I absolutely love this idea and can't wait to use it. I would use it as Linux but the game doesn't even work by itself

On Fri, Jan 8, 2016 at 12:18 PM, Madsciencecoder notifications@github.com wrote:

Hey, glad you like it.

I've been working on getting it to work on Windows and have a working version. It however needed more changes that I expected so need to make sure they won't break Linux support. Once I add them in you could compile it yourself for Windows.

I'll unlikely provide a binary for a while because there's still quite a bit I need to add or change and recompiling it every time will just slow me down, also why I haven't yet added Linux packages yet.

Plus I can't figure out a good way to ship it for Windows. Due to LGPL licensing for Qt I can't statically link the library and there are a LOT of .dll's it requires. Linux, however, handles that extremely well with their package managers and global libraries.

— Reply to this email directly or view it on GitHub https://github.com/madsciencecoder/Shticker-Book-Rewritten/issues/1#issuecomment-170062715 .

madsciencecoder commented 8 years ago

It should now compile for Windows provided you supply it with the necessary DLLs and libraries. I updated the readme with some details on what is necessary.

I'd recommend just using Qt Creator to compile it, just set it to release mode and compile it. If you start it within Qt Creator assuming it can find the openssl and bzip2 DLLs it should work just fine.

It is set to download and update the game files to its current directory so unless you want to download a new copy you should move the executable to your Toontown Rewritten install folder. You then need to copy over all the DLLs it requires to the same folder or modify the PATH environement variable in Windows to include them or it won't know where to find them.

Virnios-zz commented 8 years ago

Alright, thank you! I'll try this tomorrow and if I have any issues I'll let you know.

Virnios-zz commented 8 years ago

Alright so I got Qt Creator installed and should I open the .pro in Qt Creator? another question, for http://sourceforge.net/projects/mingw/files/MinGW/Extension/bzip2/bzip2-1.0.6-4/ Which one do I download from there?

Sorry, I am kinda new to this whole thing lol.

madsciencecoder commented 8 years ago

Yeah, the .pro file is the main project file. It contains everything needed for Qt Creator or qmake to piece everything together. If you open it in creator it will ask to configure build directories and then automatically open the other files for the program.

For bzip2 you want the ones that end with dll-2.tar.lzma and the other dev.tar.lzma. Extract them with 7-zip and copy the dll file to Qt's bin folder and the dev file has 2 sub folders that need to merge with Qt's include and lib folders. The openssl dlls also need to be put in Qt's bin folder.

That took me forever to figure out. I'm too used to being spoiled with package managers on Linux dealing with it. I don't remember the exact file structure but the folders you want to move them to are in something like Qt/5.5/mingw*

Virnios-zz commented 8 years ago

There is no "include" folder, should I just create one and merge? lol

madsciencecoder commented 8 years ago

Include folder in which, the Qt folder or the bzip2? In either case you either didn't install all the necessary Qt components (I just used default but you could have removed some things) or didn't download the right bzip2 archive or extract it fully. It's a .tar.lmza and some programs only extract the tar from the lmza and then have to be extracted again to extract from the tar.

Here's my folder heirarchy if it helps. Qt folders on the left and bzip2 on the right and the paths are on the top https://i.imgur.com/Hj8V3ud.png https://i.imgur.com/xFuxuEV.png. You need to have the bzlib.h file in Qt's include folder and libbz2.a + libbz2.dll.a in Qt's lib folder. The libbz2.a file is for static linking I think so might not be neccessary.

Virnios-zz commented 8 years ago

I installed Qt Creator as you said above and it http://i.imgur.com/JdblxS8.png , I assume I should put it in anyway?

madsciencecoder commented 8 years ago

You need to download all of Qt's libraries, Qt creator is just their IDE (like visual studio). The link I provided in the readme is what you want https://www.qt.io/download-open-source/ which should default to their online installer.

That will download Qt creator and setup a base build environment. By default it selects Qt 5.4 and 5.5 but you should only need 5.5 if you wanted to save on some space. It is rather large since Qt is a huge framework and it needs all the supporting MinGW and other stuff for it to build with. (6.3 GB for me but I did include 5.4 which is about 1.6 GB)

Most of that is unecessary to actually run the program, it's just to build it. It is really complicated on Windows so I'd suggest either trying it again on Linux since it is very easy or waiting for a release.

Virnios-zz commented 8 years ago

alright, I'll try Linux for a bit. and hopefully I can get the game to actually run.

madsciencecoder commented 8 years ago

The whole reason I even made this was because their launcher doesn't work on my system. They do something weird with openssl which doesn't work with the version I have installed. It does work with most distros' openssl versions though. They also use Qt for their launcher and the version they compiled with conflicted with my version that was more up to date than theirs.

The 2nd problem on Linux with their launcher is the downloaded TTREngine executable's permissions are not set to allow it to execute causing it to fail and you have to manually give it the permissions.

The first issues should be solved completely especially by building it yourself. That way it will just link to whatever versions you have. The 2nd issue is also solved by automatically checking the permissions and adding the executable permission if needed.

To compile on linux should be just a few simple commands in the terminal or you can still use Qt Creator. You just need to install the dependencies, but this time you can use your package manager to do it for you. On Ubuntu and probably Debian also if it's in their repositories you can install all of Qt and Qt creator with sudo apt-get install qt-sdk that should pull in g++ and anything else it needs but adding build-essential should add anything else if it won't work with just qt-sdk. To install bzip2 libbz2-dev should be what you need. Once that is done git clone --recursive this repo, cd to the folder, and run qmake and make and it should just spit out the executable in the same folder. Or you can use Qt Creator instead of qmake and make.

Virnios-zz commented 8 years ago

Sorry, I am still slightly new to ubuntu, how do I clone this specific repo? keeps saying stuff like http://i.imgur.com/QcNhrbU.png

madsciencecoder commented 8 years ago

No worries, it's git clone --recursive https://github.com/madsciencecoder/Shticker-Book-Rewritten.git You need to add the whole github URL with the https://. The .git is optional I think.

Virnios-zz commented 8 years ago

I have ran into another issue, http://i.imgur.com/ZnRedWV.png I really appreciate you helping me :P

madsciencecoder commented 8 years ago

Hmm, it seems to be using Qt 4 instead of Qt 5 and the module it can't find isn't in Qt 4, it was added in 5.

I haven't used Ubuntu in a while but I fired up a virtual machine to make sure it works, I tested on 15.10 Wily. You need to add two more packages with sudo apt-get install libqt5webkit5-dev libqt5svg5. To tell Qt to use Qt 5 you can use export QT_SELECT=qt5 which will set an environment variable for qmake to know which version you want since it seems to default to 4. Then run make clean to remove anything it tried to build with Qt 4, rerun qmake and then make.

Do note that in the future if you want to recompile it you need to re-export the QT_SELECT variable as it will disappear after a reboot and default back to Qt 4.

Virnios-zz commented 8 years ago

Seems to keep trying to use qt4 after i set the variable, should i set the variable in the folder? or in a base terminal, also would it be easier if I used a different version of Linux?

madsciencecoder commented 8 years ago

qtchooser -qt=qt5 -run-tool=qmake should also work. That will do both the job of the export and qmake commands. Are you using a different Ubuntu version? It shouldn't matter what you use but an older version could have different packaging.

Virnios-zz commented 8 years ago

I went ahead and tried the variable thing inside the shticker folder and it seemed to work, the launcher is really nifty. I like it! Thank you for the help :) Truly appreciate it.