2

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.

Daria K
  • 21
  • 2

1 Answers1

0

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

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • Thanks, but I've already checked this: all my IDs are unique and they are less than 40 characters long. Same goes for file names, although according to https://www.advancedinstaller.com/forums/viewtopic.php?t=8213 it's the component names and not the file names that matter. – Daria K Sep 09 '21 at 13:24
  • I would add an initial "counter" to the ID - unless MSI insists on a letter as the first character? MSI is known for quirks like this. Did you try putting components in merge modules to merge at compile time? Are these components going into the GAC? – Stein Åsmul Sep 09 '21 at 14:00
  • Adding a counter didn't solve the issue, I will try doing it with merge modules. No, the components are not going into the GAC. – Daria K Sep 13 '21 at 07:22
  • Putting the components in several merge modules didn't solve the problem either, I still get the same error. – Daria K Sep 14 '21 at 08:45
  • Sorry for leading you on a wild goose chase here. I don't have time to test anything at the moment I am afraid. Could you leave out the whole Id field? Maybe you have tried it. Please take the time to [read this answer](https://stackoverflow.com/a/24769965/129130). Are you generating the source with heat.exe? There are some alternatives and you can also process the generated XML with XPath. Samples can be found on github.com. – Stein Åsmul Sep 14 '21 at 13:53
  • Some quick links on generating WiX sources: [`1)` - auto-generated source](https://stackoverflow.com/a/55977336/129130), [`2)` - COM](https://stackoverflow.com/a/55459208/129130), [`3)` - some heads-up stuff on auto-generated sources](https://stackoverflow.com/a/52927439/129130). – Stein Åsmul Sep 14 '21 at 14:10
  • Actually I was using my own python script to generate the WiX sources. In any case I managed to resolve the issue by discarding RemoveFolder subcomponents, still not sure why it was causing the problem. Thanks a lot for your advices anyways. – Daria K Sep 17 '21 at 10:09