Posted by: Vinu Baby | May 19, 2009

Find .NET framework versions installed using c#

This c# code shows the versions of the .NET framework installed on a PC.

 

private void button2_Click(object sender, EventArgs e) 
{
 
string key1 = "";
string key2 = "";
string key3 = "";
bool v10 = false;
bool v11 = false;
bool v20 = false; 

key1 = Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("Microsoft").OpenSubKey(".NETFramework").OpenSubKey("Policy").OpenSubKey("v1.0").GetValue("3705").ToString();

key2 = Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("Microsoft").OpenSubKey(".NETFramework").OpenSubKey("Policy").OpenSubKey("v1.1").GetValue("4322").ToString();

key3 = Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("Microsoft").OpenSubKey(".NETFramework").OpenSubKey("Policy").OpenSubKey("v2.0").GetValue("50727").ToString();

v10 = (key1 == "3321-3705"); 
v11 = (key2 == "3706-4322"); 
v20 = (key3 == "50727-50727");
MessageBox.Show(".Net Framework v1.0 – " + v10.ToString() + Environment.NewLine +
".Net Framework v1.1 – " + v11.ToString() + Environment.NewLine +
".Net Framework v2.0 – " + v20.ToString());
        }

Posted by: Vinu Baby | May 2, 2009

Tata Nano…

dsc00206 dsc00205 dsc00204

Microsoft Team Foundation Server is a very powerful and customizable tool user of version control. TFS 2005 is less stable when compared to TFS 2008

Now I just faced a legitimate requirement..

When someone checks-in any file to the TFS, i need to get the list of files checked-in and perform a custom action based on that file(s) list. How do I do that??  I just need to extend the Microsoft TFS services.

TFS is nothing but a SQL Server database(s) and a Share Point Web Service. All actions to the TFS are done by calling webservices at http://yourservername:8080/…asmx. So what you need to do is listen for a particular event and then catch it and execute your code.

Build Completion Event NodesDeletedEvent
BuildStatusChangedEvent ProjectCreatedEvent
BranchMovedEvent ProjectDeletedEvent
NodeCreatedEvent CheckinEvent
NodePropertiesChangedEvent WorkItemChanged
NodeRenamedEvent

 

You can find the BisSubscribe.exe at –> C:\Program Files\Microsoft Visual Studio 2005 Team Foundation Server\TF Setup\

TFS has a small interesting utility called BisSubscribe.exe, you can use this tool to subscribe to quite a few events in TFS. So, now i want to subscribe to the TFS Checkin-Event, and the command goes like this

BisSubscribe.exe /server tfsserver01 /eventType CheckinEvent /deliveryType Email /address vinubaby1@gmail.com

this will create a subscription on the tfsserver01 server for CheckIn event and a email will be sent to vinubaby1@gmail.com, but this does not serve my requirement. I need a list of files checked-in the moment it is checked in. So, i just tweak the command like this.

BisSubscribe.exe /server tfsserver01 /eventType CheckinEvent /deliveryType Soap /address http://myserver:81/service.asmx

This command will create a subscription on tfsserver01 server for Checkin event and will invoke the Notify() method in the service.asmx webservice which i developed and published in http://myserver:81/

The webservice will have the Notify command with the following signature;

[SoapDocumentMethod(Action = "http://Microsoft.VisualStudio.Bis/Notify", RequestNamespace = http://Microsoft.VisualStudio.Bis)]
[WebMethod
]
public void Notify(string eventXml)
{
     //Write your custom code here
     //Use eventXml to extract event related fields and their values
}

The signature of the Notify function should be same as above.

Happy programming….. enjoy..

Posted by: Vinu Baby | April 16, 2009

Cannot switch between TFS servers in Team Explorer 2005

I just installed and configured a new TFS, but when I switch from my earlier TFS to the new server from the Team Explorer in VS2005, the reference is still to the old TFS

To be more clear, I have two TFS installed, configured and running namely VSTFS1 and VSTFS2.

Now from my Visual Studio 2005 IDE (Team Explorer) i just connected to VSTFS1 and then i just disconnect and connect to VSTFS2, although the connection was successful, the Source Control window refers to the VSTFS1 source files.

Then after long goooooogling, i found its a bug within the TFS 2005, related to the cache.

So, i just deleted the files in c:\users\@username@\appdata\local\microsoft\team foundation\2.0

This solved my problem…. (the above path is for Vista….you figure out the path for XP) :-)

Posted by: Vinu Baby | April 6, 2009

Rose

The first day of school our professor introduced himself and challenged us to get to know someone we didn’t already know. I stood up to look around when a gentle hand touched my shoulder. I turned around to find a wrinkled, little old lady beaming up at me with a smile that lit up her entire being.

She said, “Hi handsome. My name is Rose. I’m eighty-seven years old. Can I give you a hug?” I laughed and enthusiastically responded, “Of course you may!” and she gave me a giant squeeze.

“Why are you in college at such a young, innocent age?” I asked.

She jokingly replied, “I’m here to meet a rich husband, get married, have a couple of children, and then retire and travel.”

“No seriously,” I asked. I was curious what may have motivated her to be taking on this challenge at her age. “I always dreamed of having a college education and now I’m getting one!” she told me.

After class we walked to the student union building and shared a chocolate milkshake. We became instant friends. Every day for the next three months we would leave class together and talk non-stop. I was always mesmerized listening to this “time machine” as she shared her wisdom and experience with me.

Over the course of the year, Rose became a campus icon and she made friends wherever she went. She loved to dress up and she revelled in the attention bestowed upon her from the other students. She was living it up.

At the end of the semester we invited Rose to speak at our football banquet. I’ll never forget what she taught us. She was introduced and stepped up to the podium. As she began to deliver her prepared speech, she dropped her three by five cards on the floor. Frustrated and a little embarrassed she leaned into the microphone and simply said “I’m sorry I’m so jittery. I gave up beer for Lent and this whiskey is killing me! I’ll never get my speech back in order so let me just tell you what I know.” As we laughed she cleared her throat and began:

“We do not stop playing because we are old; we grow old because we stop playing. There are only four secrets to staying young, being happy, and achieving success.

“You have to laugh and find humor every day.

“You’ve got to have a dream. When you lose your dreams, you die. We have so many people walking around who are dead and don’t even know it!”

“There is a huge difference between growing older and growing up. If you are nineteen years old and lie in bed for one full year and don’t do one productive thing, you will turn twenty years old. If I am eighty-seven years old and stay in bed for a year and never do anything I will turn eighty-eight. Anybody can grow older. That doesn’t take any talent or ability. The idea is to grow up by always finding the opportunity in change.”

“Have no regrets. The elderly usually don’t have regrets for what we did, but rather for things we did not do. The only people who fear death are those with regrets.”

She concluded her speech by courageously singing “The Rose.” She challenged each of us to study the lyrics and live them out in our daily lives.

At the years end Rose finished the college degree she had begun all those years ago. One week after graduation Rose died peacefully in her sleep.

Over two thousand college students attended her funeral in tribute to the wonderful woman who taught by example that it’s never too late to be all you can possibly be.

If you read this, please send this peaceful word of advice to your friends and family, they’ll really enjoy it!

We send these words in loving memory of ROSE.

Remember, GROWING OLDER IS MANDATORY, GROWING UP IS OPTIONAL.

“All I’ve learned about life I can sum up in three words. It goes on.”

– Robert Frost

Posted by: Vinu Baby | March 14, 2009

Incredibuild……. incredible indeed

I just happened to use the trail version of Incredibuild from Xoreaz software.

Its really an incredible piece of tool…

The installation was smooth, and the settings were easy enough for a naive user to set it up.

I had used it to for a batch process of getting some 200MB files from the Microsoft TFS 2005, on a Windows 2003 server with quad-core AMD processor and a ram of 2 GB.

The user interface of Incredibuild shows the currently executing sub-processes and that too on which cpu/core it is executed on.

The performance was impressive.

Am yet to analyse and review the tool in depth but for want of time….

Will update this blog with my findings soon.

Links:
http://www.xoreax.com/

Do you have the extra core and wondering how to use it?

Well, if you have a multi-core pc and would like to use the sheer power while building complex and exhaustive VC++/C++ projects, you can use the MPCL or Incredibuild tools.

MPCL integrates with Visual Studio, and can be used only to compile/build the solution. It provides compiler level directives and enables parallel compilation/building. However, this is limited to VC++ projects/solutions only due to technical limitations.

I am presently reviewing Incredibuild, and will update this blog soon with my review.

More info on MPCL can be found at

http://todobits.es/mpcl.html

http://todobits.es/downloadmpcl.html

Posted by: Vinu Baby | February 10, 2009

A story with a Moral

A Small Story…

A boy and a girl were playing together. The boy had a collection of marbles. The girl had some sweets with her. The boy told the girl that he will give her all his marbles in exchange for her sweets. The girl agreed.

The boy kept the biggest and the most beautiful marble aside and gave the rest to the girl. The girl gave him all her sweets as she had promised.

That night, the girl slept peacefully. But the boy couldn’t sleep as he kept wondering if the girl had hidden some sweets from him the way he had hidden his best marble.

Moral of the story: If you don’t give your hundred percent in a relationship, you’ll always keep doubting if the other person has given his/her hundred percent.. This is applicable for any relationship like love, friendship, employer-employee relationship etc., Give your hundred percent to everything you do and sleep peacefully.

Posted by: Vinu Baby | February 9, 2009

Five Installer Best Practices

1. Include an Uninstall: Make sure that you include an uninstaller with your software. Installers must include the ability to uninstall applications to meet Windows Logo requirements and is just a friendly thing to do. Making an uninstaller with Setup Factory is easy. Just select Uninstall > Settings from the menu and check the "Create uninstall" option. There are a lot of ways to customize and present your uninstall. See the User’s Guide and Help file for more details.

2. Write Out Your Application Information: It is a good idea to have your installer write out important paths and locations such as the application folder to the Registry or a settings file during installation. Doing this allows future installers, updaters and patches to quickly and easily determine where your application is installed without asking the user or searching the system. Here is a sample script that could be used to write out the application’s installation folder.  Usually you would put this in the "On Post Install" installation event (replace the Registry sub-key with your sepecific location):
Registry.SetValue(HKEY_CURRENT_USER,"Software\\Your Company Name\\Your Product Name","InstallFolder",SessionVar.Expand("%AppFolder%"),REG_SZ);
You can store any information you want, such as the shortcut folder used, the product version or anything else that might be important to your software.

3. Use Log Files: It is a good idea to have your installer create a log file during installation. This can be very helpful if a customer has trouble installing the software and you need to find out why. You can turn on and configure the installer’s log file by selecting Project > Log Files… from the menu. Setup Factory automatically writes out all of the detail that it can to the log file.  If you want to include your own custom information, use the SetupData.WriteToLogFile action.

4. Set Minimum System Requirements: If the software that you are installing has specific minimum system requirements to run properly, it is a good idea to check those requirements before starting to install files and modify the user’s system. You can configure most common system minimum checks by selecting Project > System Requirements from the menu. At the very least it is a good idea to leave the "User must have administrative priviledges" checked in most cases. If you need to do more in-depth system checking than the options allow, you can use actions and scripts to do so.

5. Marking Shared Files: If you are installing files that may be shared by other applications on the user’s system (such as ActiveX, DLL and OCX files) it is important to turn on file usage counts for those files. To do this, double click the filename on Setup Factory’s main screen. Go to the Advanced tab and turn on the "Shared/System File" option. This will ensure that the file’s usage count is incremented in the Registry and protects the file from being deleted by the uninstall if it is still being used by other applications.

Posted by: Vinu Baby | February 8, 2009

Windows Live Writer and Windows Live Mail are cool

I just installed Windows Live Writer…

The installation was one of the best i have seen for Microsoft products. It went on smooth, and importantly, it did not ask me any questions etall… :-)

Just started to use..lets see how many Send—Do Not Send  error screens appear on the run… :-)

Windows Live Mail is rocking too…. its light… its easy.

so far great…

 

LiveJournal Tags: ,

Older Posts »

Categories