So, I got an itch. I wanted to make Windows 7 fetch The Undermine Journal Addon for my account. A simple thought really and the logical choice was using task scheduler to automate the process. I knew that I wanted something simple and that could preferably be used by anyone without installing additional software. Later I saw a method to do this with perl, but I decided to go ahead and release this for people who couldn't get that method to work or couldn't install perl or whatever.
This will only work with newer versions of window like Windows 7, but it may work on Vista, I have no way to verify. It utilizes Powershell and Task Scheduler, both of which are integrated into the newer MS operating systems.
For those that are interested in more information:
Windows PowerShell - Wikipedia, the free encyclopedia
Windows Task Scheduler - Wikipedia, the free encyclopedia
Now to the meat.
You'll need to create a text file and input this:
Edit the addon with the link provided on your account control addon feed at TUJ. It says "Download Your Addon Here." Just copy and paste it between the quotes where it says "http:\\your.addon.link.goes.here". Save the file as TUJ.ps1. Be sure that you are saving the file as ps1, and not ps1.txt. You may need to show file extentions to do that. And its good practice to always show those any way to avoid clicking deviously named executables. On Win7, click Organize > Folder and search options > View > Advanced settings and then uncheck "Hide extensions for known file types".
#This should be set your your base addon directory in wow
$directory = "C:\Users\Public\Games\World of Warcraft\Interface\addons\"
#fix powershell's idiotic notion working directory
# Download the file
$object = New-Object Net.WebClient
#your undermine addon link
$url = 'http://your.addon.link.goes.here'
$local = $directory + "\TheUndermineJournal.zip"
# Extract the file
$shell_app = new-object -com shell.application
$filename = "TheUndermineJournal.zip"
$zip_file = $shell_app.namespace((Get-Location).Path + "\$filename")
$destination = $shell_app.namespace((Get-Location).Path)
I would just share the file and let you edit, but windows protects the user from downloaded scripts pretty aggressively.
Place that file in your addon directory.
Now we need to schedule its execution via task scheduler. Just search for task scheduler on the start menu if you don't know where it is. Heck, that's what I do, and I know where it is.
Create a new task, name it whatever you like and add a description if you'd like. Schedule how often you'd like it to update. I do once a day at 12 am, repeating every 6 hours. But you can do whatever you like. On the settings tab you may want to ensure that you stop existing instances on the bottom of that tab as an extra safeguard. But really all that will happen if you set it up wrong is that it pulls the data too much. You can only pull TUJ addons 10 times a day.
Under actions, chose start a program and copy and paste this and accept its interpretation. (Some of the command will show in different boxes.)
Save all that and you just need to do one final thing.
powershell.exe -windowStyle Hidden -Command "& 'C:\Users\Public\Games\World of Warcraft\Interface\addons\TUJ.ps1'"
Windows is pretty aggressive about blocking unsigned scripts and that is a good thing. You need to modify your script permissions in order to run even your own scripts.
WARNING! SCARY COMMAND PROMPT AHEAD! WARNING! :P
Type in powershell on the start menu, right click Windows Powershell and choose run as administrator. Copy this;
And right click in the window to paste. Hit Enter and then type "y" and Enter again to accept the policy change. You can close the window.
Ok, now we should be set to run the script.
You can manually run it to make sure its working on the task scheduler. Just click run and there should be new files in your addon folder. The TUP addon .zip file and the extracted addon. (And ofcourse the script.)
Ok, thats the down and dirty, and boy do I know its dirty. I may write up a more detailed guide with flashy photos or a video but I just wanted to get this out there as soon as possible.
Let me know what you think, and if there is enough interest, I'll continue development.