nhenrique
nhenrique

Reputation: 894

Wix - Get user input to create a registry entry

I need to create an installer that gets the user input to create a registry entry. I've looked into Wix tutorials and it's very clear how to install registry entries but I need the user to give some info(in this case it's an url) so that url can be used on the registry entry.

How can I do this?

Upvotes: 1

Views: 1083

Answers (1)

IlirB
IlirB

Reputation: 1430

Duplicate question!?

Please take a look at this answer if it helps: https://stackoverflow.com/a/20679626/1331719

Edit - slightly modifying the answer found in the link:

Start by adding this component, notice the property in Value [USERINPUT]

<DirectoryRef Id="INSTALLDIR">
  <Component Id="RegistryEntries" Guid="{YOURGUID}">
    <RegistryKey Root="HKLM" Key="Software\Company123\App123" Action="create">
      <RegistryValue Type="string" Name="UserInput" Value="[USERINPUT]" />
    </RegistryKey>
  </Component>
</DirectoryRef>

Reference the component in your feature:

<Feature>
    <ComponentRef Id="RegistryEntries" />
    ...
</Feature>

Get user input when you install using msiexec:

msiexec /i your.msi /qb+ USERINPUT="http://urlYouWantToStoreIn.Registry"

Check registry HKLM\Software\Company123\App123\UserInput, the url should be there.

Upvotes: 2

Related Questions