There is a good example in MSDN or at:
http://msdn.microsoft.com/en-us/libr...64(VS.71).aspx

Which shows how to do it but it does need the Custom Actions to install.