如何在wix安装程序中的自定义操作中添加真正长的十六进制注册表?

sce*_*ler 1 registry wix registrykey

当我尝试使用自定义操作在卸载之前添加一个非常长的注册表值时,我收到错误.

<CustomAction Id="InsertValue" Return="check" Execute="deferred" Impersonate="no" Directory="INSTALLDIR" ExeCommand="&quot;reg add HKEY_CURRENT_USER\Software\Intel\Display\igfxcui\HotKeys&quot; /v 9530 /t REG_BINARY /d <REALLY LONG HEXADECIMAL VALUE>"/>
Run Code Online (Sandbox Code Playgroud)

该值在安装时被删除,我需要在卸载期间将其写回,但是该值超过255个字符,因此它给了我一个字符串溢出错误.

我还有什么其他选择可以将这么长的值写入注册表?

Leo*_*eoN 5

试试这个代码.这是从wix写入注册表的正确方法.

 <RegistryKey Root="HKCU"
                 Key="SOFTWARE\Intel\Display\igfxcui\HotKeys">
        <RegistryValue Name="9530"
                       Action="write"
                       Value="LONG HEXADECIMAL VALUE"
                       Type="binary"
                       KeyPath="yes" />
      </RegistryKey>
Run Code Online (Sandbox Code Playgroud)

你应该在组件标签之间写这个.