Hey guys, I hope this is alright to post to despite the OP being inactive and the last post being around five months ago, but I've been working my way through this as a little of a project to acquaint myself with how these tools are built, their installers configured, and etc. Unfortunately, I don't have much to show for it yet, as I've mostly been trying to decipher the OP's instructions here and there, as well crash course myself through all of the aforementioned stuff; however, I do think I could at least provide somewhat improved documentation for those interested in using this for whatever reason (different platform/dislike Java/just interested).
That being said, here we go, may have to split into multiple posts for this:
For Windows:
- Run the installer found here Bas' original link or rehosted here. (You do not need to install Python anymore.)
- Open up a command prompt (Start -> Run... -> "cmd" -> "OK")
- Navigate to the folder with the data.dat and resource.dat. E.g. C:\Program Files (x86)\FTL\resources; C:\Program Files (x86)\Steam\steamapps\common\FTL\resources; etc.
- To unpack, run ftldat unpack data.dat
- This will create a data.dat-unpacked folder in the resources folder.
- WARNING: Before packing/repacking with file alterations, make a backup of data.dat. To pack, run ftldat pack data.dat.
- To show the contents and fingerprints of a .dat, run ftldat info --hashes data.dat.
In case you don't want to be troubled with false-positives from the installer, you may also do the following, in the form of compiling it yourself:
- Download the repository from Github by clicking the 'Download ZIP' option on the righthand side of the page.
- Visit the instructions page and try to follow them. Otherwise continue on with my instructions.
- Download Python 2.7.6, NSIS, PyInstaller, and PyWin32. Make sure to get the appropriate PyWin32 version for your version of Python, in this case, Pywin32-218.win32-py2.7.exe.
- Once you've all that downloaded, open your terminal or command prompt and navigate to the win-installer folder wherever you downloaded the above repository/zip file. E.g. cd c:\users\download\ftldat-master\win-installer
- Then type in the following command: c:\python27\python.exe [filepath to downloaded PyInstaller]\PyInstaller-2.1\pyinstaller.py ftldat.spec
What your command line should look like:
What the output will be (click image for higher quality shot, if legibility is an issue): - After this, right click the ftldat NSIS script file and select 'Compile NSIS Script'. Look to the next image if you get mixed up as to where it's located. Hint: it's back in the main win-installer folder.
Which should produce this (click image for higher quality shot, if legibility is an issue): - The ftldat r7 file is the newly compiled installer file. Click it to install, then you should be able to run ftldat from the command line.*
*Ideally. I've gotten to this point but am completely jammed by NSIS script errors. The file produced above does install ftldat to a point, you'll get it in your programs folder and the like, but you won't be able to call it from a command window, which defeats the entire point of it.
I'm still not sure what the core issue at hand here is. I think it has something to do with modifying the environment variables in the installer scripts, but the modifications I've tried so far haven't resolved anything. If anything they've served to bug out the compiled installer further, but I'm still researching the code to see if I can figure it out.
For others interested in fixing it what I've tried so far:
Adding calls to the main ftldat.nsi file for the AddEnvVar and un.RemoveEnvVar functions, with no luck.
Adding an !include of the EnvVarUpdate.nsh to the ftldat.nsi file, still no luck. If memory serves it produces a strstr function call bug. Commenting these (strstr related things in EnvVarUpdate) out puts you back at square one with the aforementioned environment functions not being used.
Commenting out the strstr function in AddToPath completely breaks the installer. Produces an opcode error and generally produces useless clutter folders in the start menu and program files folder.
For Mac/Linux(?):
"On Mac it is a bit easier, because Python is already installed.
Open Terminal and go to the/path/to/ftldat/src. Then run, for instance:
Code: Select all
python main.py info /Applications/FTL.app/Contents/Resources/data.dat
Wherever you downloaded ftldat to. Navigate to that exact file path via the command 'cd' in the Terminal window. E.g. cd ~/Desktop/ftldat on Mac/Linux (last I checked they share similar Terminal commands); cd c:\users\[your username]\Desktop\ftldat on Windows.
More specifically within the Terminal:
Code: Select all
cd /Applications/FTL.app/Contents/Resources
Once there:
Code: Select all
bla@bla /Applications/FTL.app/Contents/Resources $ python ~/Downloads/ftldat/src/main.py unpack data.dat
Again, with the filepath after python being replaced by wherever you may have the ftldat folder located.
Command listing:
- ftldat [command] -h: For more help.
- ftldat pack -h: For more help.
- add: Adds a single file to the dat file. E.g. ftldat add data.dat my-ship.xml data/my_ship.xml
- append: Appends a file to an existing file in the dat file. E.g. ftldat append data.dat data/blueprints.xml my-extra-blueprints.txt
- replace: Replace a single file in a dat file. E.g. ftldat replace data.dat data/blueprints.xml fully-new-blueprints.xml
- extract: Extract a single file to the dat file. E.g. ftldat extract data.dat data/blueprints.xml out.xml
- remove: Remove a single file from the dat file. E.g. ftldat remove data.dat data/events_mantis.xml
- hashes: Prints an alphabetic list of filename and md5 hash. Useful for integrity checking. E.g. ftldat hashes data.dat
- list: Lists the files in the dat file.
- repack: Efficiently repacks a dat file. E.g. ftldat repack C:\...\FTL\resources.
- pack: Overwrites and loads in the contents of data.dat-unpacked folders all at once. Only use after backing up original .dat files. E.g. ftldat pack "[your filepath to...]\FTL\resources\data.dat" "[your filepath to...]\FTL\resources\data.dat-unpacked"
- unpack: Unloads the content of the specified dat file. E.g. ftldat unpack data.dat removes all .xml and .txt files.
- --hashes: This will show the MD5 fingerprint of each entry. For use with the info command. E.g. ftldat info --hashes data.dat
- --bytes: This displays sizes in bytes instead of rounding them to KB/KiB. For use with info command.
- --indexsize: For matching index sizes of LTF (for Mac, you would use --indexsize 2027 for data.dat and
- --indexsize 1918 for resource.dat). For use with the pack command. E.g. ftldat pack --indexsize 2027 data.dat
"These commands are all in-place and thus as fast as they can be. One could use ftldat.exe with these commands to create an installer of a patch. It would be as simple as writing a .bat.
If anyone is interested, I could also add support for patches like XDelta or Uniform Diff. If you script in Python, these commands are fairly easy to use by importing the "FTLPack" class."-Bas.
Noted issues:
Some users experience a strange mixup of functionality when attempting to run the unpack command on their dat files, resulting in a listing of its contents instead of extracting of them.
Currently no noted fix.
Some users' antivirus software detects the Windows installer as a virus. This is a confirmed false-positive as a result of the method used to compile ftldat into an easily dispersed installer.
Currently no noted intent on OP's part to recompile installer using an alternative method to bypass false-positive.
Translation attempts via saving .xml files using different character encodings (e.g. UTF-8, Big5, GBK) results in square blocks/boxes where text should be instead. Not a ftldat issue, but worth being aware of in case you wish to attempt translation.