Thursday, August 27, 2009

Getting installed Windows components with C#

There is a good way to get the list of installed windows components using PowerShell here. So i just rewrote it on C#

private void GetListOfInstalledWinComponents()
{
string componentsList = string.Empty;
string componentsKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Oc Manager\Subcomponents";
using (RegistryKey regKey = Registry.LocalMachine.OpenSubKey(componentsKey))
{
try
{
// getting all names from this key
foreach (string componentName in regKey.GetValueNames())
{
//getting the key value
object val = regKey.GetValue(componentName);
int keyData;
// try to figure out if the value field is defined
// if not - go to the next
if (!int.TryParse(val.ToString(), out keyData))
{
continue;
}
//if the value for a given name is more than 0 it
// means that this component is installed
if (keyData >0)
{
componentsList += componentName + " - Installed" +Environment.NewLine;
}

}
}
catch (Exception ex)
{ }
}
}

Tuesday, August 25, 2009

Producing OSS translation continues

After a long vacation break I'm back to translation of "Producing Open Source Software" book from English to Russian. As i read the book more and more i'll become more and more interested in it. I'm not a manager, i'm a developer but many principles in this book are true for work inside the team. So thanks to Karl Fogel.