Reputation: 44316
I have a setup project in Visual Studio 2010 that needs to be modified in the post-build event to change a registry value. I can create a MSI transform to do that, but when I run it through msitran after the build, it fails because the Registry table entry corresponding to that key has a different Registry field value. I need a way to modify a specific registry key.
Can I create a transform that searches for a specific key? What about creating a new entry that overwrites the registry key?
What is the correct approach?
Upvotes: 0
Views: 590
Reputation: 1639
You probably need to just run a specific SQL UPDATE command rather than using a static transform that I imagine does the update based on the primary key of the record to be modified, which varies from build to build.
There is a VBS tool in the platform SDK, wirunsql.vbs, which you can use to run arbitrary SQL commands. Sounds like you want to do something along the lines of
Update Registry
Set Value
='MyNewValue' Where Value
= 'MyUndesirableValueThatIsInvariantFromBuildToBuild'
Upvotes: 1