WiX 2716 error: Couldn't create a random subcomponent name for component - wix

I'm trying to make a Wix installer for a project containing approximately 9k files. It's building fine but when running the installer I get an error during the 'Computing space requirements' step:
…
Action ended 14:31:38: CostInitialize. Return value 1.
MSI (c) (7C:F8) [14:31:38:089]: Doing action: FileCost
MSI (c) (7C:F8) [14:31:38:090]: Note: 1: 2205 2: 3: ActionText
Action 14:31:38: FileCost. Computing space requirements
Action start 14:31:38: FileCost.
MSI (c) (7C:F8) [14:31:38:093]: Note: 1: 2205 2: 3: MsiAssembly
MSI (c) (7C:F8) [14:32:40:728]: Note: 1: 2716 2: id_841c16be109411ec8e165c80b69a0712
MSI (c) (7C:F8) [14:32:40:740]: Note: 1: 2205 2: 3: Error
MSI (c) (7C:F8) [14:32:40:740]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 2716
DEBUG: Error 2716: Couldn't create a random subcomponent name for component 'id_841c16be109411ec8e165c80b69a0712'.
I can guarantee that the ID of each component is unique. I tried to Google for any msi limitations but nothing seems to apply in my case: I have 9k files, msi size is less that 1Gb. I tried splitting components among features so that each feature has less than 1600 components as stated here http://www.msifaq.com/a/1043.htm, but that didn't fix the problem. The error goes away however when I reduce total number of files included to ~8k.
What can be a possible cause of the issue?
Here's the general representation of my wxs file:
<Wix>
<Product>
…
<Directory>
…
</Directory>
<FeatureGroup>
<Feature>
<Component Id="id_84aad4c710ac11ec92ad5c80b69a0712" Guid="84AAD4C8-10AC-11EC-A737-5C80B69A0712" Directory="id_811c471310ac11ec92af5c80b69a0712">
<File Id="id_84aad4c910ac11ec935c5c80b69a0712" Source="$(var.sourceDir)\bin\cache\dir\102.1\a47df368\shadercache\release\69128a2106de710dd07ad20c532a6a4c.v.desc" />
<RegistryValue Root="HKCU" Key="Software\Company\Product" Name="dummyName" Value="dummyValue" Type="string" KeyPath="yes" />
<RemoveFolder Id="id_84aad4ca10ac11ec9b0f5c80b69a0712" Directory="id_811c471310ac11ec92af5c80b69a0712" On="both" />
<RemoveFolder Id="id_84aad4cb10ac11eca2605c80b69a0712" Directory="id_811c471410ac11ec989a5c80b69a0712" On="both" />
<RemoveFolder Id="id_84aad4cc10ac11ecbb915c80b69a0712" Directory="id_811c471510ac11ec91155c80b69a0712" On="both" />
<RemoveFolder Id="id_84aad4cd10ac11ecaf505c80b69a0712" Directory="id_811c471610ac11ecbaa15c80b69a0712" On="both" />
<RemoveFolder Id="id_84aad4ce10ac11ec86a15c80b69a0712" Directory="id_811c471710ac11ec9b945c80b69a0712" On="both" />
<RemoveFolder Id="id_84aad4cf10ac11ecb6035c80b69a0712" Directory="id_811c471810ac11ec8ca15c80b69a0712" On="both" />
<RemoveFolder Id="id_84aad4d010ac11ec98ea5c80b69a0712" Directory="id_8111bfae10ac11ec8b805c80b69a0712" On="both" />
<RemoveFolder Id="id_84aad4d110ac11ec93125c80b69a0712" Directory="INSTALLDIR" On="both" />
</Component>
<Component>
…
</Feature>
<Feature>
…
</FeatureGroup>
</Product>
</Wix>
UPDATE: The problem was solved by removing all the RemoveFolder subcomponents (and moving the installation itself to the ProgramFiles folder). I assume that the total number of RemoveFolder entries was over some limit, although the only limitations mentioned in the doc concern number of components or number of files.

From the MSI help file:
MSI Error: 2716 - Could not create a random subcomponent name for component '[2]'.
May occur if the first 40 characters of two or more component names are identical. Ensure that the first 40 characters of component names are unique to the component.
It does not look like this is the case for your component names, but they are pretty similar. I see 9 identical first characters, perhaps there are further name clashes with more characters involved? Please check.
Perhaps you have file names that have more than 40 identical characters? https://www.advancedinstaller.com/forums/viewtopic.php?t=8213

Related

WiX toolset - EventSource sets wrong path to EventMessageFile (prepends "#%")

I have WiX 4.0 project. I'm using Util to create Windows EventLog event source. The problem is, the Registry entry to the EventMessageFile gets the path prepended with "#%". Therefore, the EventLog will display errors for events created by this event source.
Code to create the EventSource:
<Include xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<PropertyRef Id="NETFRAMEWORK40FULLINSTALLROOTDIR64"/>
<PropertyRef Id="NETFRAMEWORK40CLIENTINSTALLROOTDIR64"/>
<PropertyRef Id="NETFRAMEWORK40CLIENT"/>
<PropertyRef Id="NETFRAMEWORK40FULL"/>
.
.
.
<ComponentGroup Id="EventLog" Directory="INSTALLFOLDER">
<!-- 64 bit -->
<Component Id="CreateEventSource64BitFullNet4" DiskId="1" Guid="{9978592B-3E96-4AAA-B7A6-34B0421FDD02}" Condition="NETFRAMEWORK40FULLINSTALLROOTDIR64 AND VersionNT64">
<CreateFolder/>
<util:EventSource Log="Application" Name="ScholarshipSapQueue" EventMessageFile="[NETFRAMEWORK40FULLINSTALLROOTDIR64]EventLogMessages.dll" />
</Component>
<Component Id="CreateEventSource64BitClientNet4" DiskId="1" Guid="{B42622A1-B7C0-48CB-B306-65F3558C6678}" Condition="NETFRAMEWORK40CLIENTINSTALLROOTDIR64 AND NOT NETFRAMEWORK40FULL AND VersionNT64">
<CreateFolder/>
<util:EventSource Log="Application" Name="ScholarshipSapQueue" EventMessageFile="[NETFRAMEWORK40CLIENTINSTALLROOTDIR64]EventLogMessages.dll" />
</Component>
</ComponentGroup>
</Include>
Looking at the log file from installing the MSI, the value of the properties does look correct:
MSI (c) (B4:68) [10:05:27:331]: PROPERTY CHANGE: Adding NETFRAMEWORK40FULLINSTALLROOTDIR64 property. Its value is 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\'.
But the Registry entry is wrong:
MSI (s) (3C:28) [10:05:33:008]: Executing op: ActionStart(Name=WriteRegistryValues,Description=Writing system registry values,Template=Key: [1], Name: [2], Value: [3])
Action 10:05:33: WriteRegistryValues. Writing system registry values
MSI (s) (3C:28) [10:05:33:014]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=13200)
MSI (s) (3C:28) [10:05:33:014]: Executing op: RegOpenKey(Root=-2147483646,Key=SYSTEM\CurrentControlSet\Services\EventLog\Application\ScholarshipSapQueue,,BinaryType=0,,)
MSI (s) (3C:28) [10:05:33:014]: Executing op: RegAddValue(Name=EventMessageFile,Value=##%C:\Windows\Microsoft.NET\Framework64\v4.0.30319\EventLogMessages.dll,)
WriteRegistryValues: Key: \SYSTEM\CurrentControlSet\Services\EventLog\Application\ScholarshipSapQueue, Name: EventMessageFile, Value: ##%C:\Windows\Microsoft.NET\Framework64\v4.0.30319\EventLogMessages.dll
That smells like a WiX v4 bug. Please open an issue at https://github.com/wixtoolset/issues/issues/new/choose.

Remove folder confusion

Using WiX, I'm replacing a application with a new version.
In the old version, there was a directory which is no longer needed in the new version.
So on install, this should do it:
<Component Id="killDir_" Guid="..." KeyPath="yes">
<RemoveFolder Id="killDir" On="both" />
</Component>
So far so good, this works fine.
But if the folder is already removed, the setup creates it again!
This happens also when using
<util:RemoveFolderEx .../>
I have tried a condition within the <Component> tag:
<Condition>OLD_STUFF_EXISTS</Condition>
along with a DirectorySearch in the Product:
<Property Id="OLD_STUFF_EXISTS">
<DirectorySearch Id='DirSearch' Path="OldDir" Depth='0'>
</DirectorySearch>
</Property>
But that doesn't seem to work.
In the MSI log file, the RemoveFolder seems to be executed:
MSI (s) (A0:4C) [13:44:45:742]: Doing action: RemoveFolders
MSI (s) (A0:4C) [13:44:45:742]: Note: 1: 2205 2: 3: ActionText
Action 13:44:45: RemoveFolders. Removing folders
Action start 13:44:45: RemoveFolders.
Action ended 13:44:45: RemoveFolders. Return value 1.
Some lines down, the istalled creates it again:
MSI (s) (A0:4C) [13:44:45:807]: Executing op: FolderCreate(Folder=C:\...\,Foreign=0,,)
Is there any way to tell the installer NOT to create it again?

How to change RemoveExistingProducts to after InstallFinalize when using WixUI_Advanced?

Here's my scenario:
Using Wix 3.6
Using the WixUI_Advanced dialog set (adds ability able to control individual features during install)
Setting NeverOverwrite="yes" for a web.config component (so that local changes post-install aren't lost)
However, the installer still seems to remove and re-install the web.config file during upgrade.
Best I can tell the WixUI_Advanced dialog set has something like the following configured:
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallInitialize"/>
</InstallExecuteSequence>
Here are logs snippets from the install:
MSI (s) (74:8C) [18:37:00:959]: Executing op: ActionStart(Name=InstallInitialize,,)
Action 18:37:00: InstallInitialize.
...
Action 18:37:00: ProcessComponents. Updating component registration
...
Action 18:37:00: UnpublishFeatures. Unpublishing Product Features
...
UnpublishFeatures: Feature: ProductFeature
...
UnpublishFeatures: Feature: AdditionalFeature
...
MSI (s) (74:8C) [18:37:00:967]: Executing op: ActionStart(Name=RemoveFiles,Description=Removing files,Template=File: [1], Directory: [9])
Action 18:37:00: RemoveFiles. Removing files
MSI (s) (74:8C) [18:37:00:967]: Executing op: ProgressTotal(Total=2,Type=1,ByteEquivalent=175000)
MSI (s) (74:8C) [18:37:00:967]: Executing op: SetTargetFolder(Folder=C:\Program Files (x86)\MyTestApp\WebApp\)
MSI (s) (74:8C) [18:37:00:967]: Executing op: FileRemove(,FileName=web.config,,ComponentId={B4A12A8F-56A3-4DD1-A0BA-B9C39EB305FD})
RemoveFiles: File: web.config, Directory: C:\Program Files (x86)\MyTestApp\WebApp\
MSI (s) (74:8C) [18:37:00:968]: Verifying accessibility of file: web.config
MSI (s) (74:8C) [18:37:00:969]: Note: 1: 2318 2:
MSI (s) (74:8C) [18:37:00:969]: Note: 1: 2318 2:
MSI (s) (74:8C) [18:37:00:969]: Executing op: FileRemove(,FileName=somefile.txt,,ComponentId={B835CEF5-1A84-4C37-8CB0-BE983BAF73F9})
RemoveFiles: File: somefile.txt, Directory: C:\Program Files (x86)\MyTestApp\WebApp\
MSI (s) (74:8C) [18:37:00:970]: Verifying accessibility of file: somefile.txt
MSI (s) (74:8C) [18:37:00:970]: Note: 1: 2318 2:
MSI (s) (74:8C) [18:37:00:970]: Note: 1: 2318 2:
MSI (s) (74:8C) [18:37:00:971]: Executing op: ActionStart(Name=PublishProduct,Description=Publishing product information,)
Action 18:37:00: PublishProduct. Publishing product information
...
Action 18:37:00: RollbackCleanup. Removing backup files
RollbackCleanup: File: C:\Config.Msi\7cd65c.rbf
RollbackCleanup: File: C:\Config.Msi\7cd65d.rbf
MSI (s) (74:8C) [18:37:00:980]: Note: 1: 2318 2:
MSI (s) (74:8C) [18:37:00:981]: Note: 1: 2318 2:
MSI (s) (74:8C) [18:37:00:981]: No System Restore sequence number for this installation.
MSI (s) (74:8C) [18:37:00:981]: Unlocking Server
MSI (s) (74:8C) [18:37:00:985]: PROPERTY CHANGE: Deleting UpdateStarted property. Its current value is '1'.
Action ended 18:37:00: InstallFinalize. Return value 1.
Action ended 18:37:00: INSTALL. Return value 1.
As you can see it removes the web.config file after InstallInitialize
When I try to change the wxs file, adding:
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallFinalize"/>
</InstallExecuteSequence>
I get:
error LGHT0091: Duplicate symbol 'WixAction:InstallExecuteSequence/RemoveExistingProducts' found. This typically means that an Id is duplicated. Check to make sure all your identifiers of a given type (File, Component, Feature) are unique.
Here is the Product.wxs file I'm using:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*" Name="MyTestInstaller" Language="1033" Version="1.0.9.0" Manufacturer="Acme, Inc" UpgradeCode="6ca3779c-e8ce-42e8-bf81-3166bd96e585">
<Package Id="*" InstallerVersion="301" Compressed="yes" InstallScope="perMachine" Platform="x64" InstallPrivileges="elevated" />
<Upgrade Id="6ca3779c-e8ce-42e8-bf81-3166bd96e585">
<UpgradeVersion Minimum="1.0.9.0" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />
<UpgradeVersion OnlyDetect="no" Minimum="0.0.0.0" IncludeMinimum="yes" Maximum="1.0.9.0" Property="OLDERVERSIONBEINGUPGRADED" IgnoreRemoveFailure="yes">
</UpgradeVersion>
</Upgrade>
<Condition Message="A later version of [ProductName] is already installed.">NOT NEWERVERSIONDETECTED</Condition>
<Media Id="1" Cabinet="myapp.cab" EmbedCab="yes" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Feature Id="ProductFeature" Title="MyTestInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<Feature Id="AdditionalFeature" Title="Additional Features" Level="10">
<ComponentGroupRef Id="AdditionalComponents"/>
</Feature>
<Property Id="ApplicationFolderName" Value="MyTestApp"/>
<!-- BEGIN: DISABLE THE Per User Install -->
<Property Id="WixAppFolder" Value="WixPerMachineFolder"/>
<WixVariable Id="WixUISupportPerUser" Value="0" />
<!-- END: DISABLE THE Per User Install -->
<UI>
<UIRef Id="WixUI_Advanced" />
</UI>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONFOLDER" Name="ICS">
<Directory Id="WebApp" Name="WebApp">
<Component Id="WEB.CONFIG" Guid="B4A12A8F-56A3-4DD1-A0BA-B9C39EB305FD" DiskId="1" NeverOverwrite="yes">
<File Id="WEB.CONFIG" Name="web.config" Source="web.config" KeyPath="yes"/>
</Component>
<Component Id="SOMEFILE" DiskId="1" Guid="B835CEF5-1A84-4C37-8CB0-BE983BAF73F9">
<File Id="SOMEFILE" Name="somefile.txt" Source="somefile.txt" KeyPath="yes"/>
<util:XmlConfig Id="WEBCFG_1" File="[WebApp]Web.config" Action="create" Node="element" Name="module" ElementPath="/configuration/autofac/modules" VerifyPath="/configuration/autofac/modules/module[\[]#type='ICS.Automation.JDE.Base.JDEModule, ICS.Automation.JDE.Base'[\]]" Sequence="10" On ="install" />
<util:XmlConfig Id="WEBCFG_2" ElementId="WEBCFG_1" File="[WebApp]Web.config" Name="type" Value="MyDll, MyDll" Sequence="11" />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents">
<ComponentRef Id="WEB.CONFIG"/>
</ComponentGroup>
<ComponentGroup Id="AdditionalComponents">
<ComponentRef Id="SOMEFILE"/>
</ComponentGroup>
</Fragment>
</Wix>
How can I change the RemoveExistingProducts to come after InstallFinalize?
Ultimately, I just need this file to never be overwritten.
Thanks!
The MajorUpgrade tag is the preferred way to do the upgrade, and that will sequence RemoveExistingProducts (REP) wherever you specify - that should simplify some of this. There's no reason for the UI to move REP around.
The default for scheduling REP is after InstallValidate, which is basically a uninstall of the old product followed by an install of the upgrade, so it's not so much an update/overwrite of the config file as an uninstall/remove followed by a fresh install.
If the REP is scheduled afterInstallExecute then overwrite rules apply during the upgrade (because the upgrade "overwrites" the existing installed product before it's uninstalled). The web.config file just needs to have the same component id in both the old and new products, and if it has indeed been changed after it was installed then the overwrite rules should mean it won't be overwritten.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa370531(v=vs.85).aspx
In other words just use the major upgrade element with afterInstallExecute, have the same component ids in both old and new resources (files etc) and the web.config file shouldn't be overwritten, and you don't need to set neveroverwrite.
In my opinion having REP afterInstallExecute is better than after InstallFinalize because the latter is outside the install transaction, so the upgrade install can succeed, then the REP after InstallFinalize can fail and roll back, leaving both products simultaneously installed. Having REP within the transaction results in a full rollback if the uninstall of the older product fails.

How to launch executable after installation (exe is delivered by .msm)

I did everything as explained in tutorial, but my executable wasn't launched after product installation completed.
There is a nuance that my executable is delivered with .msm module, so in .wxs file for .msi I do the following to launch application:
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product>
<!-- I omit here features and elements which are irrelevant to the question-->
<Feature Id="Configurator" Display="hidden" Level="1">
<MergeRef Id="MergeConfigurator"/>
</Feature>
<UI>
<UIRef Id="WixUI_Minimal"/>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction"
Value="LaunchConfigurator">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.ExitDlgCheckBoxText)" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
<Property Id="WixShellExecTarget" Value="[#SystemConfigurator.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146]" />
<CustomAction Id="LaunchConfigurator" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
</Product>
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Merge Id="MergeConfigurator" SourceFile="$(var.MergeModulesPath)\ConfiguratorSetup_$(var.Platform).msm" DiskId="1" Language="1033"/>
</DirectoryRef>
</Fragment>
</Wix>
For the property with Id=WixShellExecTarget I have tried to pass value both with and without GUID (this is Package/#Id of .msm with my executable).
I opened my .msi with Orca and saw the exact ID of my executable (it's SystemConfigurator.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146, that's why I pass this very value).
But what it's wrong?
I logged installation process using /l*v option, and there is a portion from log:
Action 18:47:57: LaunchConfigurator.
Action start 18:47:57: LaunchConfigurator.
MSI (c) (54:68) [18:47:58:106]: Invoking remote custom action. DLL: C:\Users\AAGENO~1\AppData\Local\Temp\MSIB233.tmp, Entrypoint: WixShellExec
MSI (c) (54:08) [18:47:58:106]: Cloaking enabled.
MSI (c) (54:08) [18:47:58:106]: Attempting to enable all disabled privileges before calling Install on Server
MSI (c) (54:08) [18:47:58:106]: Connected to service for CA interface.
MSI (c) (54!04) [18:47:58:476]: Note: 1: 2715 2: SystemConfigurator.Client.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146
MSI (c) (54!04) [18:47:58:476]: Note: 1: 2715 2: SystemConfigurator.Client.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146
Action ended 18:47:58: LaunchConfigurator. Return value 3.
MSI (c) (54:34) [18:47:58:476]: Note: 1: 2205 2: 3: Error
MSI (c) (54:34) [18:47:58:476]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 2896
DEBUG: Error 2896: Executing action LaunchConfigurator failed.
Error 2715 means that the file key you're using isn't actually in the file table. Assuming it's referring to SystemConfigurator.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146 I would open the MSI file with Orca and see if that is the correct value AND keep in mind that Windows Installer proiperties are case-sensitive so if if it really is upper-case then use upper case. Make sure it really is a dash too, and not an underscore.

WiX 3: Error 1406: Could not write value {ValueName} to key {KeyName}

I recently converted an old WiX 2 project to WiX 3. In the previous WiX project there was a component that contained a number of shortcuts, as follows.
<Component Id="ShortcutsComponent" Guid="$(var.ShortcutsComponentGuid)">
<Shortcut Id="Shortcut1" Name="Shortcut1Name" LongName="Shortcut1LongName"
Directory="ShortcutsDir" Target="{Target}" />
<Shortcut Id="Shortcut2" Name="Shortcut2Name" LongName="Shortcut2LongName"
Directory="ShortcutsDir" Target="{Target}" />
</Component>
When I converted the project to WiX 3 this caused the following error.
error LGHT0204 : ICE43: Component ShortcutsComponent has non-advertised shortcuts. It's KeyPath registry key should fall under HKCU.
To resolve the error I made modified the ShortcutsComponent by adding a RegistryValue element as follows.
From our Variables.wxi file.
<?define JAWSVersion = "$(env.Major).0"?>
<?define FSRegistryKey = "SOFTWARE\Freedom Scientific"?>
<?define JAWSRegistryKey = "$(var.FSRegistryKey)\JAWS"?>
And in the WXS file, which includes Variables.wxi, I added the following line to ShortcutsComponent.
<RegistryValue
Root="HKCU" Key="$(var.JAWSRegistryKey)\$(var.JAWSVersion)\Components"
Name="ShortcutsComponent" Action="write" Type="integer" Value="1"
KeyPath="yes" />
I made similar changes to a number of components.
Now I am getting errors when installing the software, but only on some computers. The error is as follows.
Error 1406: Could not write value {ValueName} to key {KeyName}.
System error. Verify that you have sufficient access to that key,
or contact your support personnel.
I considered replacing the above RegistryValue line with something like the following but I do not expect the results to be any different.
<RegistryKey Root="HKCU" Key="$(var.FSRegistryKey)" Action="create">
<RegistryKey Key="JAWS" Action="create">
<RegistryKey Key="$(var.JAWSVersion)" Action="create">
<RegistryKey Key="Components" Action="create">
<RegistryValue
Name="ShortcutsComponent" Action="write"
Type="integer" Value="1" KeyPath="yes" />
</RegistryKey>
</RegistryKey>
</RegistryKey>
</RegistryKey>
Does anyone have any suggestions on how to solve this problem?
NOTE: I was asked to give the precise values for {ValueName} and {KeyName}. Here are the relevant lines from the log file.
MSI (s) (1C:8C) [14:36:29:183]: Executing op: RegOpenKey(Root=-2147483647,Key=SOFTWARE\Freedom Scientific\JAWS\17.0\Components,,BinaryType=1,,)
MSI (s) (1C:8C) [14:36:29:183]: Executing op: RegAddValue(Name=RemoveExploreDir,Value=#1,)
WriteRegistryValues: Key: \SOFTWARE\Freedom Scientific\JAWS\17.0\Components, Name: RemoveExploreDir, Value: #1
MSI (s) (1C:8C) [14:36:29:183]: Note: 1: 1401 2: HKEY_CURRENT_USER\SOFTWARE\Freedom Scientific\JAWS\17.0\Components 3: 1021
Error 1406. Could not write value RemoveExploreDir to key \SOFTWARE\Freedom Scientific\JAWS\17.0\Components. System error . Verify that you have sufficient access to that key, or contact your support personnel.
MSI (s) (1C:8C) [14:40:09:789]: Product: Freedom Scientific JAWS 17.0 -- Error 1406. Could not write value RemoveExploreDir to key \SOFTWARE\Freedom Scientific\JAWS\17.0\Components. System error . Verify that you have sufficient access to that key, or contact your support personnel.
I hope this helps.
This is more of a report of a discovery than an answer. As it turns out the problem was not in the WiX code but in a custom action contained in a DLL that is used by the installer. This custom action created the registry key "HKEY_CURRENT_USER\Software\Freedom Scientific\RJSetup" with the REG_OPTION_VOLATILE option. What this means is that if the "HKEY_CURRENT_USER\Software\Freedom Scientific" did not already exist, it too was created with the REG_OPTION_VOLATILE option. When the WiX installer attempted to write to any key under "HKEY_CURRENT_USER\Software\Freedom Scientific" this caused the Error 1406. We are fixing the custom action so that it first creates the "HKEY_CURRENT_USER\Software\Freedom Scientific" registry key as a standard key and then creates the "HKEY_CURRENT_USER\Software\Freedom Scientific\RJSetup" registry key with the REG_OPTION_VOLATILE option. That hopefully will fix the problem.
The moral of the story is, if you find an odd error in a WiX installer that you cannot figure out in code that appears to be consistent with thousands of resources found online consider the possibility that you are shooting yourself in the foot in one of your custom actions.