portable .net development
I’ve had to setup my dev environment on a few different machines recently. Quite a simple, but repetitive exercise, so I decided to see if I could make it completely portable. The TL;DR of it is that you can’t completely - but you can to a certain extent.
Here’s what I’ve managed to do so far:
a) File sync
I’m using SpiderOak currently. DropBox only lets you backup a single folder, and Ubuntu One’s conflict resolution leaves a lot to be desired on Windows (at the moment) - appending .u1.conflict to filenames all over the place. The SpiderOak client is not perfect either - but it seems to be a workable solution so far.
b) Dotfiles
I’ve added some of my dotfiles to their own directory (.bashrc, .bash_history, .ssh/, .gitconfig etc), and got them syncing to the “cloud”. You can then use mklink to make a Windows version of a symlink, thus:
mklink /H ..\.bashrc dotfiles\.bashrc
c) Portable apps
Most of the tools I use have a portable version (obviously with the exception of Visual Studio & Resharper), so get these sync’d up as well
- Git (make sure you set GITDIR in your environment)
- Console2 (delete the config in your %APPDATA%)
- Sublime (this is a great little text editor I’ve just discovered, so long Notepad++!)
- WinSplit Revolution
- Unlocker
d) The extras
Next thing I did was to create batch files to set your symlinks and path. The symlinks work a treat, but the ENV/PATH stuff is a bit of a pain (more on this below).
As a nice to have, there are some registry files to add stuff to your context menu as thus:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\Open with Sublime\command] @="C:\\Users\\matt.jackson\\dev\\Sublime Text 2 Build 2139\\sublime_text.exe %1"
d) What I haven’t done yet
Git Extensions. There is a portable version I believe, but the Explorer menu is the main reason I use it. The GitExtensions project sets these via a MSI, which is less than ideal - I’m open to suggestions.
p4merge. Probably the best thing to come out of Perforce, and its free! Doesn’t appear to be portable though.
Resharper license/settings. I know settings are stored in %AppData%, so this is on my TODO list. License information is probably in the registry but to be confirmed. Work in progress.
Autorun scripts on logon. Maybe add something to my .bashrc or similar that ensures everything is set correctly. Need to think on this more.
Add directories to your user PATH permanently. I could have sworn there was a way do this via SET but I still can’t find it. For now, its a case of copy/pasting into a dialog box.
I’d love to hear about people’s experiences with this. How far have you got and have you solved anything on the TODO list above?