Thursday, June 14, 2007

Using SharpDevelop as a Portable App

Lately I’ve been messing around with SharpDevelop.  Mainly because I think I’m going to pick Boo as my one new programming language each year.  As part of my research I’ve discovered that it can be used as a Portable App.  That is, it can be run directly from a USB thumb drive without an install.  In it’s simplest form all that is needed is to copy the files from the install directory to the thumb drive and away you go.  However if you are using the PortableApps Suite and want SharpDevelop to show up in you menu it’s a little harder.

 

First the PortableApss Suite expects all its applications to exist in folders that end in “portable”.  This isn’t hard to do just create a ShpapDevelopPortable folder under the PortableApps directory and copy the files there.  Now, the second hurtle is that the Suite menu expects the executable to be in that root folder; SharpDevlop is not, it’s in a bin folder.  You could probably move the assemblies to the root directory but it would probable create problems with some of the resource dependences.  So, I decided to create a proxy exe that would call the real one.  Here is the entire source code.

 

/*

 * Created by SharpDevelop.

 * User: Trevor Michealson

 * Date: 6/13/2007

 * Time: 11:17 PM

 *

 * To change this template use Tools | Options | Coding | Edit Standard Headers.

 */

using System;

using System.Collections.Generic;

using System.Diagnostics;

 

 

namespace SharpDevelop

{

       class MainClass

       {

             

              public static void Main(string[] args)

              {

                        string apploc = @"/bin/SharpDevelop.exe";

                            Process SharpDev = new Process();

 

                if (System.IO.File.Exists(apploc))

                    SharpDev.StartInfo.FileName = apploc;

                else

                    SharpDev.StartInfo.FileName =

                    @"/PortableApps/SharpDevelopPortable/" + apploc;

                SharpDev.Start();

               

              }

       }

}

 

 

The if statement determines if you are running from the menu or if you’ve run the exe directly, it gets a different working directory in both.

 

Note: when I brought it to work it ran in completely different working directory.  I’m not sure if this is Windows 2000 or a profile setting but this code did work on both my Home PC (running XP) and my Laptop(running Server 2003).

Wednesday, June 06, 2007

Programmer Personality Type

 

Your programmer personality type is:

   
DHTB

You're a Doer.
You are very quick at getting tasks done. You believe the outcome is the most important part of a task and the faster you can reach that outcome the better. After all, time is money.


You like coding at a
High level.
The world is made up of objects and components, you should create your programs in the same way.


You work best in a
Team.
A good group is better than the sum of it's parts. The only thing better than a genius programmer is a cohesive group of genius programmers.


You are a li
Beral programmer.
Programming is a complex task and you should use white space and comments as freely as possible to help simplify the task. We're not writing on paper anymore so we can take up as much room as we need.

 

Get your programmer personality type at

http://www.doolwind.com/index.php?page=11