Results 1 to 6 of 6
  1. #1

    Post Automating TUJ AddOn Updates with a Batch File

    I have been lurking around the forums for awhile, and have used a lot of things that have been posted. I wanted to give something back instead of just taking. So I decided to post this.

    I got the idea for this from Aeriwen's post on how to Automate the Downloading of TUJ Addon Updates, which I had used for awhile,. However, didn't like having to extract the file as I tend to forget. I built off this idea of using the Task Scheduler to keep the addon updated, but added more of automation to it using a batch file.

    1. Programs you will need to have.

    7Zip - file archiver
    WGet - file retriever from most widely-used Internet protocols

    Both programs are free to download and use. They work on both Windows and Linux. Sorry I don't use Mac so not sure if they have them for Macs.

    2. What this guide will show you to do.

    I am doing this in Windows 7 64bit.

    In short, what I have it set up to do is the Task Scheduler runs a *.bat file. The batch file will download the Update using WGet. Check to see if the new file was downloaded, delete the old zip file and rename the new one. It will then use 7zip to extract and override the old folder in the AddOns directory (similar idea to what the CurseClient does for other AddOns).

    This could probably be done a lot cleaner, but my (and my husband's) skill level and the time we did this in, this is what we have and it works.

    3. Setting up your batch file.

    This can be written in Notepad, so no need to get another software. You can name your batch file anything and place it anywhere, but you will want to put it in a place you won't be moving it around or deleting it. I saved mine as autoTUJ.bat and placed it in my AddOns folder.

    In a Notepad document you will want to copy and paste the following:

    @echo off
    set path="C:\World of Warcraft\Interface\AddOns"
    call "C:\Program Files (x86)\GnuWin32\bin\wget.exe" -N --no-check-certificate "http:\\" 
    if exist* (del else echo Error downloading data
    call "C:\Program Files (x86)\7-Zip\7z.exe" x -aoa "C:\World of Warcraft\Interface\AddOns\"
    Next, you will need to make some changes to the file to link to the pathings on your computer for the software.

    Replace the "http:\\" with the link provided to you from TUJ where it says "Download Your Addon Here." Paste the update link between the quotes. You can right click on the link and select Copy Link Location. Then ctrl + V in between the quotes.

    Save your batch file after you make the changes you need. You're batch file is complete!

    4. How to set up the scheduler.

    This set is a bit similar to what Aeriwen did. However, I did go about it a bit differently.

    Open Task Scheduler. For those who can't find it: Start > Accessories > System Tools > Task Scheduler

    You are going to want to Create Task... to start with. I prefer not using the wizard because I would have to go in and edit it anyways.

    Under the General tab you will want to name the Task. I named mine something like "The Undermine Journal Updater". You will also want to make sure you check Run with highest privileges. You can also set it to run if you aren't logged into your account (ie share your computer), but I don't so not messing with it.

    Under the Triggers tab, I have set it to happen daily starting at 12AM and to recur every day. I have also set the tasks to run every 6 hours Indefinitely. This allows for me to get updated information without hitting my 10 downloads a day limit. You can change this to better match your gaming time so it updates before you log in. As I sleep weird hours throughout the month it's just best to keep it as is for myself as I never really sure when I might be on.
    Next under the Action tab, you'll want to set your action to Start a program. Use the Browse... button in the Program/script to select your batch file. Mine is autoTUJ.bat and I had placed it in my AddOns folder for easy access and so I don't have to worry about if I deleted it or not. Then in the Start in (optional): put the path to the folder your batch file is located in. For example, mine is K:\World of Warcraft \Interface\AddOns\ .
    There rest of the tabs are default settings, which seem to work fine for me. You may want to look through them and make sure for yourself. When you are finished Save and you are done.

    As mentioned before probably not the cleanest way to go about it, but it does seem to get the job done. Hope this helps some of you guys out.

    Thank you Aeriwen, for the idea of using Task Scheduler for updating The Undermine Journal AddOn UpDates.

  2. #2
    Erorus's Avatar
    Tagged in
    680 Posts
    Add to this user's reputation
    Thanks for the writeup. I'd write the script a little differently, but I haven't written batch files in a while and I want to avoid any client-side code suggestions, so if yours works, that's cool with me.

    One thing I would suggest is to pick a random-ish time other than on the hour (12:00). A bunch of folks already schedule their updates on the hour, and the site chugs a bit from the simultaneous update hits all at once. When setting yours up, be weird and pick 12:37, or 12:14, or 12:52 or something. It won't matter much to you, but your download will be a bit quicker and it'll help lighten the load on the site. Thanks.

  3. #3
    Cool thanks. Will try the staggered times.

  4. #4
    Aeriwen's Avatar
    Tagged in
    11 Posts
    Add to this user's reputation
    The script I posted should have been extracting the file for you using the builtin windows shell functions.

    In any case, very nice post.

  5. #5
    Quote Originally Posted by Aeriwen View Post
    The script I posted should have been extracting the file for you using the builtin windows shell functions.

    In any case, very nice post.
    It wasn't extracting it for me. It just downloaded it to the folder, and left it in the zip. I thought it was suppose to as well. I cleared and retried it several times. Even starting with the TUJ addon folder being removed from the AddOns to make sure that it wasn't just pasting over the old one. Not sure why it wasn't working for me. Thanks anyways for your post... I have actually used aspects of it for other things as well .

  6. #6
    I've just gave this ago and I'm getting the same thine Paperclip is getting..=(
    Last edited by DrunkHammer; September 2nd, 2012 at 07:05 AM.



Similar Threads

  1. Replies: 35
    Last Post: June 23rd, 2014, 05:35 PM
  2. [fixed] alpha updates messed up TSM?
    By bankninja in forum General TradeSkillMaster Discussion
    Replies: 1
    Last Post: August 21st, 2011, 01:27 AM
  3. [ Addon/API] Suggestion for automatic data updates
    By Amandria in forum Official Forum of The Undermine Journal
    Replies: 2
    Last Post: February 24th, 2011, 08:55 AM