Simple server Updater for Windows

Discussion in 'Bukkit Help' started by davispuh, Jan 16, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    davispuh

    As we can see Bukkit is in high development and it's updating very often, so I made batch file which will update your server ;)

    Download: <Edit by Moderator: Redacted multiupload url>


    Just extract archive to your minecraft server dir
    to update run "<your_minecraft_server_dir>\Updater\update.cmd"


    also you can edit update.cmd and remove last "pause" line then edit your run script so that it runs "Update\update.cmd"
    this way you can ensure that server are most up-to-date


    archive contains: update.cmd and GNU wget utility

    update.cmd:

    Code:
    @echo off
    "wget\wget" "http://artifacts.lukegb.com/artifactory/plugins-snapshot/org/bukkit/craftbukkit/0.0.1-SNAPSHOT/craftbukkit-0.0.1-SNAPSHOT.jar"
    del "craftbukkit.jar.old" 2>NUL
    copy "..\craftbukkit.jar" "craftbukkit.jar.old"
    del "..\craftbukkit.jar"
    copy "craftbukkit-0.0.1-SNAPSHOT.jar" "..\craftbukkit.jar"
    del "craftbukkit-0.0.1-SNAPSHOT.jar"
    pause
    
    it will download "craftbukkit-0.0.1-SNAPSHOT.jar"
    backup previous "craftbukkit.jar" to "craftbukkit.jar.old"
    rename "craftbukkit-0.0.1-SNAPSHOT.jar" to "craftbukkit.jar" and copy it to parent dir (your server location)

    Enjoy :)
     
    Last edited by a moderator: Apr 2, 2019
  2. One remark - why are you using copy followed by del instead of using the "move" command?
    It doesn't matter too much in the context of such a small script but I like efficiency and am a scripting freak. ;-)
     
  3. Offline

    davispuh

    Actually don't know :D I write batch files very rarely and just didn't think about it... (it was easier write copy/del than remember that there are move, LOL)
     
  4. Fair enough. I still took the liberty of "optimizing" your script and adding "error checking" (read: not performing commands for files that don't exist, especially on the first run).

    Code:
    @echo off
    "wget\wget" "http://artifacts.lukegb.com/artifactory/plugins-snapshot/org/bukkit/craftbukkit/0.0.1-SNAPSHOT/craftbukkit-0.0.1-SNAPSHOT.jar"
    IF EXIST "craftbukkit.jar.old" del "craftbukkit.jar.old"
    IF EXIST "..\craftbukkit.jar" move "..\craftbukkit.jar" "craftbukkit.jar.old"
    move "craftbukkit-0.0.1-SNAPSHOT.jar" "..\craftbukkit.jar"
    pause
     
Thread Status:
Not open for further replies.

Share This Page