Search code examples
winformsvisual-studio-2010.net-3.5registrysetup-project

Visual Studio Setup Project - Include .reg file on installation


I'm creating an msi of a WinForms-app by using a setup-project. One last thing I'm struggling with is adding entries in the registry.

I have to make some changes ( or create) a few entries in the register for the embedding of SAP. The client will send me a reg-file that I have to use with the installation.

Can anyone help me out on how to achieve this? Is it possible by using the reg-file or do I have to do it by code (custom action)?

This is the first time I have to create a setup like this, so bear with me. I've tried to search for it, but haven't found a satisfying answer yet. Or at least, I don't think I have...

Thanks.


Solution

  • There's an entire Registry section to VS Setup projects. Just select the Registry button at the top of Solution Explorer. Then, right click on the "Registry on Target Machine" node, and select "Import...".

    This will open a File Open dialog, looking for .reg files. Select the file you've been provided and you're done.