user1618465
user1618465

Reputation: 1941

Unpack and build back wix msi installer

I'm just trying to unpack a Wix installer (*.msi) to get its wxs and build it back to *.msi. I'm doing the following:

"C:\Program Files (x86)\WiX Toolset v3.11\bin\dark.exe" installer.msi -x out 
[...]

"C:\Program Files (x86)\WiX Toolset v3.11\bin\candle.exe" *.wxs -o obj\ -ext "C:\Program Files (x86)\WiX Toolset v3.11\bin\WixUtilExtension.dll"
[...]

"C:\Program Files (x86)\WiX Toolset v3.11\bin\light.exe" obj\*.wixobj -o bin\installerModVersion.msi -ext "C:\Program Files (x86)\WiX Toolset v3.11\bin\WixUtilExtension.dll"
Windows Installer XML Toolset Linker version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.

C:\ProgramData\[...]\installer.wxs(172) : error LGHT0130 : The primary key 'INSTALLFOLDER/CreateFolder//[WIX_ACCOUNT_LOCALSYSTEM]' is duplicated in table 'LockPermissions'.  Please remove one of the entries or rename a part of the primary key to avoid the collision.

So the error just happens in the last step:

C:\ProgramData[...]\installer.wxs(172) : error LGHT0130 : The primary key 'INSTALLFOLDER/CreateFolder//[WIX_ACCOUNT_LOCALSYSTEM]' is duplicated in table 'LockPermissions'. Please remove one of the entries or rename a part of the primary key to avoid the collision.

This is the code round line 172:

                <Directory Id="drivers" Name="drivers">
                    <Directory Id="INSTALLFOLDER" Name="ProgramName" ShortName="mn7flurp">
                        <Component Id="InstallFolderPermissions" Guid="{F5BC8C33-8B18-4FE8-8D5D-555B766161FD}" KeyPath="yes" Win64="yes">
                            <CreateFolder Directory="INSTALLFOLDER">
                           line 172 ------>     <Permission User="[WIX_ACCOUNT_LOCALSYSTEM]" Read="yes" SpecificRightsAll="yes" ReadAttributes="yes" WriteAttributes="yes" ReadExtendedAttributes="yes" WriteExtendedAttributes="yes" CreateFile="yes" CreateChild="yes" DeleteChild="yes" Traverse="yes" GenericAll="yes" />
                                <Permission User="[WIX_ACCOUNT_ADMINISTRATORS]" GenericAll="yes" />

What am I doing wrong? I am not modifying anything of the created by dark.exe wxs file.

Thank you

Upvotes: 0

Views: 1882

Answers (1)

Rob Mensching
Rob Mensching

Reputation: 35976

When you decompiled you did not include the Util extension, but then you included it when you compiled. That definition lives in the Util extension so your decompiled output has a duplicate which collides.

Add -ext WixUtilExtension.dll to your dark.exe command line.

Upvotes: 1

Related Questions