8

been looking around and I cannot seem to find a solution.

PROBLEM: I have a .reg file and I need to add it to the registry during my install. I am using WIX 3.5. I cannot add it manually using the Registrykey and so on as my customer may have changed its contents.

Any ideas?

Thanks

Natalie Carr
  • 3,707
  • 3
  • 34
  • 68

1 Answers1

12

You can try to use heat.exe and harvest the .reg file into the WiX fragment. It might look like this:

heat.exe reg myregistry.reg -out registry.wxs

Experiment with other options of heat.exe to get the output you need.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
  • 1
    Hi Yan, Thank you, have not used heat yet, whats your thought son this website to get started? http://blog.accentient.com/2010/06/03/AddHeatToWixProject.aspx – Natalie Carr Aug 16 '12 at 14:32
  • I've never come across that blog, so I can't neither recommend it. Although, I can't say it's not good, either. :) I would start from [here](http://wix.sourceforge.net/manual-wix3/heat.htm). It contains enough info to start playing and come up with the right command line – Yan Sklyarenko Aug 16 '12 at 14:43
  • I got it working through the command line although ive no idea how to incorporate it into my wix project to pick this up etc..:/ – Natalie Carr Aug 16 '12 at 14:57
  • If you use `-template:fragment` (most likely), then it generates the `Fragment` with `Component` elements inside. You can also play with the `-cg` switch to group those components into the `ComponentGroup`. Then, in the main `*.wxs` file you can reference that group with `ComponentGroupRef` element to include the generated components into the MSI package. – Yan Sklyarenko Aug 16 '12 at 15:02
  • Ive updated my answer, can you tell me what im doing wrong? Please – Natalie Carr Aug 17 '12 at 10:05
  • No, no, no! Not in a custom action! It can be a part of your build procedure, that is, it runs at build time. You should include the fragment heat generates for you into your WiX project. And you'd better generate it once, include into the WiX project, commit to the SVN and live with it as if it's your manually created authoring. – Yan Sklyarenko Aug 17 '12 at 10:13
  • Ha, I really am a WIX dummy, glad there's people out there to help. Hopefully i'l be fit to return the favour eventually..:) thanks so much..:) I think il delete the edit so not to confuse any more newbies..:) – Natalie Carr Aug 17 '12 at 10:16
  • :-) Great you decided to delete it! It was really, hmm, super crazy! :-) Good luck in your WiX journey! – Yan Sklyarenko Aug 17 '12 at 10:18
  • Yes that's me, Super crazy..:) Just to clarify my customers will be editing this file before installation, is post-build the correct place? – Natalie Carr Aug 17 '12 at 10:22
  • Which file do you mean? .reg or registry.wxs? If the .reg file changes each build, it might make sense to generate the registry.wxs each build as well, that is, making it a part of the build process. And "customers" (whoever you mean) are not intended to modify the *.wxs, IMHO. – Yan Sklyarenko Aug 17 '12 at 15:01
  • @YanSklyarenko, Thanks for the answer. I create a wxs file but do not know what should I copy from it to the RegEntries component of WIX. Can you please help me? – user3165438 Sep 22 '14 at 09:12
  • @user3165438, I don't think your comment contains enough info to understand the problem. I would suggest you creating a new question and providing all relevant information. – Yan Sklyarenko Sep 22 '14 at 09:24