Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [Windows/Linux] Dwarf Fortress Updater  (Read 2184 times)

Guardia

  • Escaped Lunatic
    • View Profile
[Windows/Linux] Dwarf Fortress Updater
« on: March 03, 2008, 09:54:00 pm »

Here's a link to my current working version: Download


For those of you that didn't notice I made an update script a while back for Linux that ended up with limited interest. Part of that I imagine is because it didn't work on Windows. Well guess what? Now it does. I've been able to run this (with some minor changes) on both my Windows and Linux computers.

It also now has a config file. Named init.txt and that follows very similar setting structure as Toady's. Will any luck that will make it more intuitive.

Also please don't put the script in you Dwarf Fortress install directory. I wrote I warning to that effect a moment ago, but it's not worth putting a new file up. Just make sure to put the files into their own folder somewhere unrelated to your install. Thanks.

What does it do?
======================
This programs goal is to make it easy to update Dwarf Fortress from one version to the next. As of v2.0 a variaty of files including object and speech files can be automatically transfered from your old version when you update. The program currently:
   - Can transfer over old save, graphics, art, init.txt, speech files, object files.
   - Can make a backup of your old installation if you want to keep a copy (incase the new version breaks something)
   - Can do a fresh install of the newest version.
   - All of these options can be turned on and off in init.txt so that you can transfer exactly the files you want.
   
You can also use this program the first time you install Dwarf Fortress to make a fresh install in the directory of your choice.


Setup
======================
There are a few things that have to be setup on your machine before you will be able to run this script:

   1. You need Python installed
      Windows: If you are running windows you likely don't have python installed. You can download the installer for it at http://www.python.org/download/
      
      Linux: You likely already have python installed, but if not simply 'sudo apt-get install python' should do the trick.
   
   2. Setup init.txt
      Before running the script you need to change the settings in init.txt to your liking. One important setting that must be changed before running the script (even if you don't want to change what is copied) is the installation directory of Dwarf Fortress on your computer. Examples are provided for both Windows and Linux in the init.txt file itself. If you haven't installed the game yet feel free to put where you would like it to go. The script supports fresh installs as well.
   
   3. Running the script
      Windows: After installing python double clicking on the dfUpdate.py file should automatically run it. You can also create a shortcut to it like any other program.
      Linux: It is probably easiest in Linux to set up an alias to the script (there are examples below). You can also run it from terminal with a command like 'python dfUpdate.py' while in the updater directory.


Here's a link to my current working version:
Download

[ March 11, 2008: Message edited by: Guardia ]

Logged

Greiger

  • Bay Watcher
  • Reptilian Illuminati member. Keep it secret.
    • View Profile
Re: [Windows/Linux] Dwarf Fortress Updater
« Reply #1 on: March 03, 2008, 10:23:00 pm »

Pardon my ignorance but can you be more specific on what this does?  Does it take init files from old versions and update them with the current settings intact? Or does it check for DF version updates online? Update old raw files with updated vanilla entries while keeping modded stuff intact?

I haven't heard of this before(Being a windows user I may have skipped over it it it had Linux only in the title) but it sounds like it may be handy.  

Unfortunately, I don't have python on this computer and my main is waiting for a part or else I would just try it out and see.

Logged
Disclaimer: Not responsible for dwarven deaths from the use or misuse of this post.
Quote
I don't need friends!! I've got knives!!!

Guardia

  • Escaped Lunatic
    • View Profile
Re: [Windows/Linux] Dwarf Fortress Updater
« Reply #2 on: March 03, 2008, 10:31:00 pm »

Sorry about that was just trying to get this out the door since I've been working on it for the last few days, but wanted it to be online so that you guys could at least break it to pieces.

The script:

Checks the website (by downloading the dwarf fortress index.html) for the most recent version.

It then compares it to the version on your computer and (if it isn't up to date) asks you if you want to update.

When updating it takes the old graphics, init and art folders and puts them in the new version. It also takes your old save folder over.

It then makes a backup of the old version to a Backup folder in the updater directory and puts the new version in it's place. You shouldn't need to change any shortcuts. It should just work.

There are some issues with this of course. Since you are always taking your old init file you won't have any of the new stuff if Toady updates it. So at some point every once in a while you'll need to do a fresh install (the script can do that as well). Keep in mind that it doesn't copy over the init folder at this point, only init.txt, so if you need that other file because of your mode you'll have to change the script of move it over yourself.

A lot of this will be optional and changeable in the future, but for now I've kept it simple to make sure it's working.

Logged

Greiger

  • Bay Watcher
  • Reptilian Illuminati member. Keep it secret.
    • View Profile
Re: [Windows/Linux] Dwarf Fortress Updater
« Reply #3 on: March 03, 2008, 11:05:00 pm »

Ok, that I like. I won't get it now because I don't want python on this computer(it sorta kinda technically isn't mineish. Not using the companion either) but when my computer is working again this will be one of the first things I get.

Good work.

[ March 03, 2008: Message edited by: Greiger ]

Logged
Disclaimer: Not responsible for dwarven deaths from the use or misuse of this post.
Quote
I don't need friends!! I've got knives!!!

Guardia

  • Escaped Lunatic
    • View Profile
Re: [Windows/Linux] Dwarf Fortress Updater
« Reply #4 on: March 09, 2008, 08:25:00 am »

Updated to Version 2.0

Notable changes are that I basically rewrote the whole thing and it now works off of a config file. See the first post for more information.

Logged

Wiles

  • Bay Watcher
    • View Profile
Re: [Windows/Linux] Dwarf Fortress Updater
« Reply #5 on: March 09, 2008, 08:34:00 am »

Thanks for putting the time into this!
Logged

Dedas

  • Bay Watcher
  • The dwarf next door
    • View Profile
Re: [Windows/Linux] Dwarf Fortress Updater
« Reply #6 on: March 09, 2008, 11:32:00 am »

Very good work! I use it with Fedora 8.
Logged

Stregone

  • Bay Watcher
    • View Profile
Re: [Windows/Linux] Dwarf Fortress Updater
« Reply #7 on: March 09, 2008, 11:51:00 am »

Does this just copy the init.txt over or does it copy the lines that are different? I ask this because some versions add new init options, and just copying the whole fine will mess with that.

EDIT: I read the thread more carefuly and got my answer  :p

[ March 09, 2008: Message edited by: Stregone ]

Logged

Guardia

  • Escaped Lunatic
    • View Profile
Re: [Windows/Linux] Dwarf Fortress Updater
« Reply #8 on: March 09, 2008, 12:14:00 pm »

quote:
Originally posted by Stregone:
<STRONG>Does this just copy the init.txt over or does it copy the lines that are different? I ask this because some versions add new init options, and just copying the whole fine will mess with that.

EDIT: I read the thread more carefuly and got my answer    :p

[ March 09, 2008: Message edited by: Stregone ]</STRONG>


I don't think using an old init file will break new version (though it might) you just won't be able to change the new options.

At some point I'll work out a solution to that. As it also relates to changing existing objects or speech files that also happen to get updated on Toady's end. For now if you notice that a new version adds things to the init file just don't copy it over in that update (Change CUSTOM_COPY to YES and COPY_INIT to NO) and update it yourself. He doesn't update it all that often so you'll still get some use out of having COPY_INIT set to ON.

Edit: I'll add this for both init.txt and object/speech files that exist in the new version. Expect it near the end of the week maybe I little earlier.

[ March 09, 2008: Message edited by: Guardia ]

Logged

Guardia

  • Escaped Lunatic
    • View Profile
Re: [Windows/Linux] Dwarf Fortress Updater
« Reply #9 on: March 11, 2008, 12:13:00 pm »

March 11, 2008
v2.2

- There is now an option on the download list to updater with a file you've already downloaded to your computer.
  Note: To use this feature put the path to where the zip was downloaded in [DOWNLOAD_PATH=pathname] in the init file.
- Changed how init.txt and object files (but currently not speech files) are updated. They are both now integrated into
  their respective files if they already exist in the newer version.
- Caught a few expections.


Got some more work done on it. Most notably the Dwarf Fortress init is not integrated with the new one instead of just transfered over. If I can find my way into a Mac lab to do some testing I will likely make this Mac compatible as well. In fact it probably works right now (since it works on linux), but I want to test it a little before turning it on.

Logged

Shades

  • Bay Watcher
    • View Profile
Re: [Windows/Linux] Dwarf Fortress Updater
« Reply #10 on: July 15, 2008, 09:53:28 am »

Genius, just want I needed.

Other than forgetting to finish my paths off in the init with a / it worked perfectly.

My only complaint is that it altered my init file to using windows line endings, but df doesn't seem to care so no big deal.
Logged
Its like playing god with sentient legos. - They Got Leader
[Dwarf Fortress] plays like a dizzyingly complex hybrid of Dungeon Keeper and The Sims, if all your little people were manic-depressive alcoholics. - tv tropes
You don't use science to show that you're right, you use science to become right. - xkcd

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: [Windows/Linux] Dwarf Fortress Updater
« Reply #11 on: July 15, 2008, 10:44:35 am »

Modbase does this too, though it's not automatic and doesn't work on Linux - so you've got an edge there. :)
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Shades

  • Bay Watcher
    • View Profile
Re: [Windows/Linux] Dwarf Fortress Updater
« Reply #12 on: July 15, 2008, 04:34:53 pm »

Modbase does this too, though it's not automatic and doesn't work on Linux - so you've got an edge there. :)

The fact it doesn't work on linux is a problem for me :( otherwise I liked the sound of modbase, especially as lots of mods support it. Likewise with all of the dwarf management utilities since they went .net :(
Logged
Its like playing god with sentient legos. - They Got Leader
[Dwarf Fortress] plays like a dizzyingly complex hybrid of Dungeon Keeper and The Sims, if all your little people were manic-depressive alcoholics. - tv tropes
You don't use science to show that you're right, you use science to become right. - xkcd