There are a number of feature improvements in SharePoint 2010. They have made many changes which allow you to do more with features when they are activated or upgraded. One of the new features it the ability to write to the property bag. To do this we just make use of the new PropertyBag element in your elements.xml file. Here is what a file might look like that writes to the property bag. As usual, I’ll point out that features or syntax could change.
<Property Name="MyCustomProperty1" Value="some value" />
<Property Name="MyCustomProperty2" Value="4" />
I will point out that whatever type you initialize the property with, it will become semi-permanent. Currently, this applies for integers and date/time. If you try to save another type in an existing property later, you will end up with a null value being stored. This will save me some time in the future as I have had to write code to do this in the past.