Monday, January 31, 2011

An easy launcher for redcar on Windows

I just (re)discovered Redcar, and have been playing with it. I love it so far (especially the seamless git integration, and the tree-document-view concepts) but I find unnecessary windows irritating, so I obviously didn't like that Redcar needed a command window open in addition to its own SWT one. Here's how I made launching Redcar a 1-click affair.
  1. Install redcar and make sure it works on its own. ie, typing redcar on any command window should start it up.
  2. Convert the redcar icon from png to ico using imagemagick. You obviously need a unix box for this, or have imagemagick installed on windows. Online tools are also available, but this seems the most programmable and quick - especially if you have a unix box around :)
     [user@box]$ convert -resize x16 -gravity center -crop 16x16+0+0 redcar-icon-beta.png -transparent white -colors 256 redcar-icon-beta.ico
  3. Create a windows shell script (redcar.vbs) that loads up redcar without a command window
        Set WshShell = CreateObject("WScript.Shell")
        WshShell.Run chr(34) & "redcar" & Chr(34), 0
        Set WshShell = Nothing
  4. Open up a launch folder of your choice. Mine is the Quick Launch bar.
  5. Rt click on the folder, New -> shortcut, and in the wizard that shows up, enter the following:
    1. Location: drive:\path\to\redcar.vbs
    2. Name: redcar
  6. Rt click on the shortcut -> Properties. Then change the following:
    1. Change Icon -> Look for icons in file: drive:\path\to\redcar.ico
  7. In the folder (or in my case, on the Quick Launch bar), Click on the Redcar icon. Redcar should now load up straight to the splash screen.
    Notes:
    • The one drawback with this is that you no longer see the debug information that the command window provides. I could not have know that Redcar looks for git during its launch without that output. So there's still reason to launch redcar from the command line. This method doesn't prevent such launches.
    • I noticed that there's a github project creating a windows launcher for redcar, but it seems to me like the steps above could be easily automated and the artifacts added to the redcar core distribution for a simpler launcher.Maybe I'll fork redcar and add them :)
    • If you're using Portable Git on Windows like me, the key to having redcar find git outside MinGW is to add the following to your path:
    drive:\path\to\PortableGit-xxx\cmd

    3 comments:

    Pauli Price said...

    You no longer need to use imagemagick (or other image editing software) to create an ico from the png file. It's not included in the assets\redcar-icons directory.

    Pauli Price said...
    This comment has been removed by the author.
    Pauli Price said...

    s/not/now/

    (not should read now in the previous comment.)