Sep 29, 2011

Dealing with corrupted CD Drivers in Windows

This has happened to me a couple of times. I have spent a lot of time trying to fix issues caused by damaged CD drivers on windows. Since this wasted time eats at development productivity, this article is intended to assist developers (or administrators) to fix this issue if they have it. Bookmark this blog entry if you don’t have it, you never know when it will happen to you and this may save you time in the future.

Windows does not have a native means of mounting .ISO files or other CD images. I don’t think that prior sentence does justice to the full weight of the intended communication, so let me try again.

The primary, commercial, expensive, professional Operating System that is Microsoft Windows, includes no means to mount a CD image. After paying for your operating system, the consumer is expected to purchase and/or download third party software to be able to perform this mundane operation.

I cannot think of any other Operating System shipping a decade into the 21st century that is this archaic. I use Magic/Disk to mount my images, but now and again I lose all access to my CD drives, both physical or virtual, especially if I do something crazy with the OS image – like migrate it from physical to virtual, or change the underlying virtualization platform from one thing to another (e.g.: from VirtualBox to VMware or KVM). This also seems to happen from time to time after I upgrade something, anything – OS, Magic/ISO or Virtual Machine client utilities.  When this loss of CD Drives happens it is almost impossible to reset things. Uninstalling and reinstalling any manner of utilities and or drivers simply does not seem to help. Next you will be tempted to begin editing the registry – don’t do it.

I ran across a simple solution that I have used on at least three occasions successfully. Simply download and execute the attached .reg file. It contains registry settings that reset the CD Drivers to standard configurations. It has never failed to reset the sanity in my systems.

If you think this is all a bit risky you are correct. You were forced into this risky position when you were forced to begin adding third party software just to be able to mount media images on your ‘21st century’ operating system. Blaming the quality of the 3rd party drivers is putting the blame in the wrong place. OSX and Linux are both orders of magnitude cheaper than Windows, with far smaller numbers of users than Windows, and far smaller number of developers building the product. Yet, both Linux and OSX manage this without fuss. I certainly hope Windows 8 fixes this.

May this be useful to you.

Sep 16, 2011

Windows Git Environment


This article describes the installation and configuration of Git on Windows and its primary audience is intended to be Developers wanting to get a setup a local Git installation to get up and running quickly on Windows. The following is covered:
  • Installing Git on Windows (5 min)
  • Installing Visual Studio and Monodevelop integration into Git (5 min)
  • Installing Windows Explorer integration into Git (0 min)
  • Installing CLR Bindings for development against Git repositories (10 minutes)
The article does not compare and contrast different Git software tools, it simply records the results of my investigations into the available toolset. The article may change from time to time and will not be supplanted by a new post, instead this post will be edited to reflect my latest Stack and Environment choices for Git on Windows.

Installing Git on Windows with Explorer Integration

TortoiseGit is my choice for Windows Git integration. It provides Windows Explorer integration into Git commands. However, since I prefer to work with a CLI interface and am familiar with Git, I also install Gits own installation for windows. If you install both you should be careful to select whether you want Windows Explorer context menus for Git since TortoiseGit already provides these for you.
image
Being far more comfortable with Unix command line tools I welcome the option to expose some Unix style CLI commands ahead of Windows find.exe and sort.exe (which I never use – do you?)
image
The next option is very important if you are building cross-platform applications. Yes – absolutely check “keep my repositories as Unix style text delimiters and automatically convert to Windows style text delimiters when checking out to windows”. Please think carefully through whether this option is good for you. It is not suitable for you if you check in non-binary files, and may not be suitable for formatted text either. If you are unsure your option is Checkout as-is, commit as-is.
image
Complete the installation and we are set!
image

Installing Visual Studio Git Integration

There are several options here, all good work equally well. If like me you only use VS2010 by default, go Tools->Extension Manager->(search for: Git). Install. Done.
image

Installing Monodevelop Git Integration

Done. It’s the standard Source Code provider for Monodevelop. There is no action to take here!
image

Installing CLR / C# Bindings for development against Git Repositories

Apparently, libgit2sharp ‘has a lot of promise’ so I am keeping an eye on it. At time of this writing though, it is too immature and relies too heavily on knowledge of the Git API for documentation. Its simply not good enough for my needs at this time.
You can find it here. From your project directory, git it from https://github.com/libgit2/libgit2sharp.git.
‘git clone https://github.com/libgit2/libgit2sharp.git’
I recommend the use of GitSharp instead. It is feature complete, has comparatively better documentation and seems to be used in more projects. GitSharp is no longer in active development, the GitSharp team is likewise watching libgit2sharp, believing that it is a superior approach to implementing a set of CLR bindings.
GitSharp documentation is available.Git the source code via...
‘git clone https://github.com/henon/GitSharp.git’
Get the Demo Project here.

Windows Subversion Environment


This articles describes the installation and configuration of SubVersion on Windows and its primary audience is intended to be developers wanting to build a local SubVersion development environment and covers:
  1. Installing Subversion on a Windows Server (5 min)
  2. Installing Visual Studio and Monodevelop integration into Subversion (5 min)
  3. Installing Windows Explorer integration into Subversion (5 min)
  4. Installing CLR Bindings for development against Subversion (10 min)
The article does not compare and contrast the various tool choices available, but it does record the results of my analysis into the tool-set available. This blog post will not be deprecated if my choices change, instead it will be updated in place so you are safe in linking to it if you simply want to benefit from my efforts.

Subversion Installation on Windows

How to get a local developer Subversion installation, and configure bindings to begin integration of your code projects into Subversion.
There are many options for installing Subversion on Windows. Being a Unix application, subversion does not have a good Windows installation experience. But, being an Apache V2.0 license, third parties are welcome to integrate the product into their own products and some have done a wonderful job of it. On Windows I always use VisualSvnServer because it has everything I need and I can set it up in 5 minutes.
  • Install from here
  • I recommend enabling Windows Account integration unless you are setting up a server that you want to share with Linux and OSX machines.
image
The post installation result is satisfyingly familiar interface that will have you productive in no time.

Integration into Visual Studio

For Visual Studio integration I use AnkhSVN. There are other options including onefrom the makers of VisualSVNServer, but these are not free and my requirements include price and functionality. AnkhSVN works as well as any other Microsoft supplied Version Control client so I have never looked at the for-pay products largely because I never had the need.
After installation you will need to startup Visual Studio and select the Source Control Provider (Tools->Options…) …
image

Integrate into Monodevelop

I use Monodevelop for cross-platform CLR development. Its useful to have a Windows installation with Monodevelop. By default it installs with Git support, to add subversion to to Tools->Add-in Manager->Gallery.
image

Integration into Windows Shell

Windows Shell integration is required unless you enjoy command line interfaces. The broad consensus is that TortoiseSvn is the best client to use.
image

Integrate C# / CLR Applications into Subversion

SharpSvn by the makers of AnkhSvn is the library to use for CLR Subversion integration. There are a large number of well respected commercial and free projects using it which gives the library the credentials we want. As usual, it meets the price (free) and functional requirements.
You need to know the version of SubVersion you installed when you installed VisualSvnServer. The version installed circa 9-15-11 is 1.6.9. To make sure, open a command prompt and enter ‘svn –-version’.
Download and extract the SharpSvn libraries into your project folder. There are two downloads, be sure to get the correct libraries as the these contain both managed and unmanaged libraries which means you need to be architecture aware (x64 v.s. ia32).
Documentation is online and comprehensive and you can find it here...
image
But you will need more than that. The documentation is not entirely complete and the downloads lack useful examples, unit tests or sample projects. To get these items you will need to get the source hive and peruse through it.
This page gets you the latest command to check out SharpSvn.
‘svn checkout http://sharpsvn.open.collab.net/svn/sharpsvn/trunk SharpSvn-Source --username guest’
The folder SharpSvn-Source\src\SharpSvn.Tests contains our useful examples, easily referenced by operation type.

Sep 7, 2011

Its Alive! ~ Why I cant escape Windows…

Microsoft Windows! You just cant escape it! I run my computing life 85% on Linux and 10% on Mac OSX. Yes, you guessed correctly where the other 5% goes to. I am writing this entry on Windows Live Writer on a VM, because there is nothing better to post a quick blog entry with, no product even comes close in my opinion.

But what does this mean for my personal computing strategy? Nothing, actually. It re-enforces the fact that personal choice and pragmatism rule. I choose my eclectic mix to accomplish my goals, and others have different choices.

I reserve the right to switch platforms at the slightest change in personal preference. There is no Operating System Religion here. I am not technology agnostic, I am instead a technical atheist. In my choice of OS I am strictly a fit-for-purpose person, my purposes change and at the same time the OS’s change.