Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 67735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:18:23+00:00 2026-05-10T19:18:23+00:00

Is there a tool to generate WiX XML given a .reg file? In 2.0,

  • 0

Is there a tool to generate WiX XML given a .reg file?


In 2.0, you were supposed to be able to run tallow to generate registry XML:

tallow -r my.reg  

For what it’s worth, the version of tallow I have is producing empty XML.

In 3.0, tallow has been replaced with heat, but I can’t figure out how to get it to produce output from a .reg file.

Is there a way to do this in 3.0?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:18:24+00:00Added an answer on May 10, 2026 at 7:18 pm

    I couldn’t find a tool, so I made one.

    The source code may not be elegant, but it seems to work:

    using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Xml; using System.Text.RegularExpressions;  namespace Reg2Wix {     class Program     {         static void PrintUsage()         {             Console.WriteLine('reg2wix <input file> <output file>');         }          /// <summary>         /// Parse the hive out of a registry key         /// </summary>         /// <param name='keyWithHive'></param>         /// <param name='hive'></param>         /// <param name='key'></param>         static void ParseKey(string keyWithHive, out string hive, out string key)         {             if (keyWithHive == null)             {                 throw new ArgumentNullException('keyWithHive');             }             if (keyWithHive.StartsWith('HKEY_LOCAL_MACHINE\\'))             {                 hive = 'HKLM';                 key = keyWithHive.Substring(19);             }             else if (keyWithHive.StartsWith('HKEY_CLASSES_ROOT\\'))             {                 hive = 'HKCR';                 key = keyWithHive.Substring(18);             }             else if (keyWithHive.StartsWith('HKEY_USERS\\'))             {                 hive = 'HKU';                 key = keyWithHive.Substring(11);             }             else if (keyWithHive.StartsWith('HKEY_CURRENT_USER\\'))             {                 hive = 'HKCU';                 key = keyWithHive.Substring(18);             }             else             {                 throw new ArgumentException();             }                 }          /// <summary>         /// Write a WiX RegistryValue element for the specified key, name, and value         /// </summary>         /// <param name='writer'></param>         /// <param name='key'></param>         /// <param name='name'></param>         /// <param name='value'></param>         static void WriteRegistryValue(XmlWriter writer, string key, string name, string value)         {             if (writer == null)             {                 throw new ArgumentNullException('writer');             }             if (key == null)             {                 throw new ArgumentNullException('key');             }             if (value == null)             {                 throw new ArgumentNullException('value');             }              string hive;             string keyPart;             ParseKey(key, out hive, out keyPart);              writer.WriteStartElement('RegistryValue');              writer.WriteAttributeString('Root', hive);             writer.WriteAttributeString('Key', keyPart);             if (!String.IsNullOrEmpty(name))             {                 writer.WriteAttributeString('Name', name);             }             writer.WriteAttributeString('Value', value);             writer.WriteAttributeString('Type', 'string');             writer.WriteAttributeString('Action', 'write');              writer.WriteEndElement();         }          /// <summary>         /// Convert a .reg file into an XML document         /// </summary>         /// <param name='inputReader'></param>         /// <param name='xml'></param>         static void RegistryFileToWix(TextReader inputReader, XmlWriter xml)         {             Regex regexKey = new Regex('^\\[([^\\]]+)\\]$');             Regex regexValue = new Regex('^\'([^\']+)\'=\'([^\']*)\'$');             Regex regexDefaultValue = new Regex('@=\'([^\']+)\'$');              string currentKey = null;              string line;             while ((line = inputReader.ReadLine()) != null)             {                 line = line.Trim();                 Match match = regexKey.Match(line);                                 if (match.Success)                 {                     //key track of the current key                     currentKey = match.Groups[1].Value;                 }                 else                  {                     //if we have a current key                     if (currentKey != null)                     {                         //see if this is an acceptable name=value pair                         match = regexValue.Match(line);                         if (match.Success)                         {                             WriteRegistryValue(xml, currentKey, match.Groups[1].Value, match.Groups[2].Value);                         }                         else                         {                             //see if this is an acceptable default value (starts with @)                             match = regexDefaultValue.Match(line);                             if (match.Success)                             {                                 WriteRegistryValue(xml, currentKey, (string)null, match.Groups[1].Value);                             }                         }                     }                 }             }         }          /// <summary>         /// Convert a .reg file into a .wsx file         /// </summary>         /// <param name='inputPath'></param>         /// <param name='outputPath'></param>         static void RegistryFileToWix(string inputPath, string outputPath)         {             using (StreamReader reader = new StreamReader(inputPath))             {                 using (XmlTextWriter writer = new XmlTextWriter(outputPath, Encoding.UTF8))                 {                     writer.Formatting = Formatting.Indented;                     writer.Indentation = 3;                     writer.IndentChar = ' ';                     writer.WriteStartDocument();                     writer.WriteStartElement('Component');                     RegistryFileToWix(reader, writer);                     writer.WriteEndElement();                     writer.WriteEndDocument();                 }             }         }          static void Main(string[] args)         {             if (args.Length != 2)             {                 PrintUsage();                 return;             }             RegistryFileToWix(args[0], args[1]);         }     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 145k
  • Answers 145k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I have one sort of crusty answer. You can create… May 12, 2026 at 8:46 am
  • Editorial Team
    Editorial Team added an answer Flash Player 10 supports this via a method and a… May 12, 2026 at 8:46 am
  • Editorial Team
    Editorial Team added an answer I've found the answer to this now. It was all… May 12, 2026 at 8:46 am

Related Questions

I found that Wix v3 uses a tool (heat.exe) to harvest information into WiX
Is there a tool to generate stubs for me, or a library to interact
Is there a good tool to generate unit test cases given say a .NET
How to keep the source code well documented/commented? Is there a tool to generate

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.