Change id of binary generated by using ElevatedManagedAction

Jan 10, 2017 at 5:10 PM

When using elevatedmanagedaction in WixSharp, I get the following generated Wix file:

<CustomAction Id="Action2_SetJavaEnvironment" BinaryKey="Action2_SetJavaEnvironment_File" DllEntry="SetJavaEnvironment" Return="check" Impersonate="no" Execute="deferred" />
<CustomAction Id="Action3_RemoveJavaEnvironment" BinaryKey="Action2_SetJavaEnvironment_File" DllEntry="RemoveJavaEnvironment" Return="check" Impersonate="no" Execute="deferred" />

<Binary Id="Action2_SetJavaEnvironment_File" SourceFile="C:\Public\MergeModules\CustomActions.CA.dll" />
Is it possible to change the id of the binary node generated by creating an elevatedmanagedaction in WixSharp? I will also need to change the BinaryKey of the customaction nodes to match that new id.

Jan 11, 2017 at 12:35 AM
Yes it is. You can use the technique described in this post answer:
But why do you need to do this? Are you reusing the binaries for other non-CA purposes??
Jan 12, 2017 at 1:57 PM
Thanks Oleg,

I am adding the elevatedmanagedaction in an MSM. When trying to build the MSM, the "Id" of the Binary Node is too long due to WIX adding the GUID of the MSM to the end of the "Id". The "Id" I use will have to have at the most 18 characters.