Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RegistryValues to the same registries cause LGHT0001 #6271

Closed
ElectricErger opened this issue Nov 11, 2020 · 4 comments
Closed

RegistryValues to the same registries cause LGHT0001 #6271

ElectricErger opened this issue Nov 11, 2020 · 4 comments

Comments

@ElectricErger
Copy link

Environment

Version of WiX: 3.11.2.4516
Visual Studio version: Pro 2019 16.7.7
Visual Studio WiX version: 1.0.0.4
.NET version: Framework 4.8.04084

Context

Creating an installer following the "Getting Started" tutorial on FireGiant https://www.firegiant.com/wix/tutorial/getting-started/beyond-files/. Copy and pasted the following from the site verbatim and linked it into my project.

Symptoms

Error message:
Light failure LGHT0001 : Item has already been added. Key in dictionary: <hash> Key being added: <same hash>
Stack trace:

Exception Type: System.ArgumentException

Stack Trace:
   at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
   at System.Collections.Hashtable.Add(Object key, Object value)
   at Microsoft.Tools.WindowsInstallerXml.Binder.SetComponentGuids(Output output)
   at Microsoft.Tools.WindowsInstallerXml.Binder.BindDatabase(Output output, String databaseFile)
   at Microsoft.Tools.WindowsInstallerXml.Binder.Bind(Output output, String file)
   at Microsoft.Tools.WindowsInstallerXml.Tools.Light.Run(String[] args)

Turning on Verbose (-v) does not yield any additional details.

Reproduction Steps

When running with the following I get the afforementioned Light error.

<RegistryKey Id='FoobarRegInstallDir' Root='HKLM' Key='Software\Acme\Foobar 1.0' Action='createAndRemoveOnUninstall'>
    <RegistryValue Type='multiString' Name='InstallDir' Value='[TARGETDIR]'/>
    <RegistryValue Type='multiString' Name='InstallDir' Value='[INSTALLDIR]' Action='append'/>
    <RegistryValue Type='multiString' Name='InstallDir' Value='[ProgramFilesFolder]' Action='append'/>
</RegistryKey>

When I changed it up so the RegistryValue used a MultiStringValue the error disappeared and built successfully.

<RegistryValue Type='multiString' Name='myStrings'>
	<MultiStringValue Type='multiString' Name='myStrings' Value='[TARGETDIR]' Action='append' />
	<MultiStringValue Type='multiString' Name='myStrings' Value='[INSTALLDIR]' Action='append'/>
	<MultiStringValue Type='multiString' Name='myStrings' Value='[ProgramFilesFolder]' Action='append'/>
</RegistryValue>
@ElectricErger
Copy link
Author

Sorry if this seems benign. I just got caught up with this error for an hour or two and just started renaming symbols until I could track down the hash's component.

@barnson barnson self-assigned this Nov 12, 2020
@barnson barnson added this to the v4.0 milestone Nov 12, 2020
@rseanhall rseanhall added this to To do in wix.4.0-preview.0 Nov 16, 2020
@barnson
Copy link
Member

barnson commented Feb 7, 2021

Triage: multisz authoring is weird. Can we simplify it to syntactically eliminate this particular error? Rough proposal:

  • Eliminate Action
  • Add values to Type:
    • multiStringPrepend
    • multiStringAppend
    • Leave multiString to continue to mean overwrite.
    • --or-- add multiStringOverwrite?
  • When any multiString type is chosen, Value cannot be used; instead, child MultiString element(s) must be used, even for one value.
  • Eliminate MultiStringValue.

Not married or otherwise attached to this design.

@barnson barnson added the wip required This issue is complex enough that it requires a WiX Improvement Proposal to be accepted first label Feb 18, 2021
@barnson
Copy link
Member

barnson commented Feb 27, 2021

Crash is now an actionable error message and tutorial is fixed.

@barnson barnson closed this as completed Feb 27, 2021
wix.4.0-preview.0 automation moved this from To do to Done Feb 27, 2021
@barnson barnson removed wip required This issue is complex enough that it requires a WiX Improvement Proposal to be accepted first triage labels Feb 27, 2021
@ElectricErger
Copy link
Author

Wow, thanks team!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants