Sunday, October 21, 2012

Tools: Change Windows Live Writer Save Location (and sync it with Dropbox)

also: using mklink, symbolic links for Windows and OS X

imageI seem to be doing this a lot of times now: manually changing Windows Live Writer save location so it points to my Dropbox folder. I’m a huge fan of this two programs/services. I don’t know about the future of Live Writer but i’d probably be using it still for a long time. And, to those who have been using it for sometime now, would know that one of its biggest limitation is that it doesn’t allow you to change the location where it saves your local drafts/posts.

You can always go the slightly hard way (see link for the how to, in the next section). Set the links manually to Dropbox. i guess it’s the normal way, which isn’t really difficult, only a hassle.

So, to save myself of the same hassle every time – i’ve created a simple tool to automate it. I’m posting this app for anyone who might need it as well.

 image

Here it is.
https://sites.google.com/site/mickeymicks/DropTo.Dropbox.zip?attredirects=0&d=1
Just download the zip and extract to your desired folder. Please extract everything – not just the EXE file. Then run the DropTo.Dropbox application.
There’s a README.txt file in there for some more details.

This app isn’t limited to Dropbox or to Live Writer for that matter, but for now this is what i use it for.

It requires Windows Vista, 7 or 8 and the dot Net framework if you don’t already have it.
http://www.microsoft.com/en-us/download/details.aspx?id=17851

If you just want to use the app, just go ahead and do so. If you want to know a little about the technical details, then by all means, read on..

Symbolic Links

The tool makes use of symbolic links to setup the link between Live Writer and my Dropbox folder. I got the idea and instructions here:
http://retrohack.com/dropbox-windows-live-writer/
http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

*i love howtogeek, btw.

Internally, the tool just calls mklink.exe. It’s a command line tool for creating symbolic links (a junction for our case). A symbolic link is like a high-powered shortcut. Lol.
It is essentially a shortcut but applications would treat it as if it’s an actual folder. Therefore, the app is actually tricking Live Writer into thinking it’s accessing its default folder.

Mklink.exe

This command line app is available only on Windows Vista or higher – which also gives the app that limitation. It won’t work on XP or lower. Also, i made the tool using Visual Studio 2010 C# – so, it needs the dotNet framework. Hopefully, most Windows users already have them on their computers. Wink. Wink.
The syntax of mklink is as follows:
mklink /J “path_of_symbolic_link” “path_of_the_real_folder”

image

Just a simple tip, when you’re using this command, don’t add the “.exe”. mklink would actually think that it’s is the Link parameter. I got errors of folder not being found or invalid link, etc.
Also, it’s better to always put quotes around the Link and Target paths.

Others

I’ve made the tool so anyone can add additional folders settings later using the “DropTo.xml” file inside the “Info” folder. I don’t know if i’d still be using this in the  future but i guess it’s good to have this feature available. 

Mac OS

To be honest, i made this tool so i can first use it on my Macbook Air. Hehe. I’m using Windows Live Writer on Parallels as i type this. Unfortunately, mklink doesn’t exactly work with Live Writer on Parallels. That’s because the default folder of Live Writer is in the Documents folder which if using Parallels, points to the host (Mac OS) Documents folder, which in turn is setup inside a ‘networked’ drive. mklink can’t create a symbolic link on a network drive, it can only point a link to one (you can’t specify a network location or mapped drive in the Link parameter).

So, after the 4-6 hours of making this app – i still ended up manually setting up my Mac. Darn. I would be using this app for my Windows PC though.

There’s a command line for Mac OS that creates symbolic links (btw, for Live Writer you can’t use “Alias” – you’re still stuck with symbolic links).
The command is:
         ln –s “path_to_real_folder” “path_to_symbolic_link”
*Please note that unlike the Windows (or DOS) counterpart, the link and targets are swapped. Also, i tried putting quotes around the paths but if that fails you can use the escaped space “\ “ for spaces.

Now, i would be glad if i could tell you to use the above Mac terminal command but it seems to fail on my Mountain Lion. So, i suggest you just use SymbolicLinker found here:
http://seiryu.home.comcast.net/~seiryu/symboliclinker.html

The tool is free. If Mountain Lion complains that this is from an unknown developer: press Control key, click on the SymbolicLinker.service and select “Open”.
This tool is installed as a service, but i think if you’re only going to use it once then you can just copy it somewhere and run the SymbolicLinker.service (by double-tapping it) directly. I think.

Oh, and one more thing: use the software at your own risk.
Just don’t forget to backup and you’ll be safe :)

For any comments, suggestions or questions – well, you know how to catch me.

Happy blogging! 

0 comments:

Post a Comment