在WiX中获取FILE的绝对路径

时间:2016-01-12 16:32:07

标签: windows wix registry

我在WiX中获得了以下文件:

<Component Id='MainExecutable' Guid='91C8C2C0-59AF-4BDD-A78D-C4369DD4CD81'>
  <File Id='FoobarEXE' Name='FoobarAppl10.exe' Source='FoobarAppl10.exe' KeyPath='yes'>
  </File>
</Component>
<Component Id="ProgramMenuDir" Guid="D3B0871E-A86D-4692-B419-AE2A2A578648">
  <RegistryValue Root='HKCR' Key='conversationwindowaction\shell\open\command' Type='string' Value='"[absolute path to exe]" "%1"' KeyPath='yes' />
</Component>

我想[exe的绝对路径]是FoobarEXE路径的字符串,我该怎么做?

1 个答案:

答案 0 :(得分:2)

<Component Id="ProgramMenuDir" Guid="D3B0871E-A86D-4692-B419-AE2A2A578648">
  <RegistryValue Root='HKCR' Key='conversationwindowaction\shell\open\command' Type='string' Value='"[#FoobarEXE]" "%1"' KeyPath='yes' />
</Component>

您需要将文件ID括在[#fileid]中,请参阅上面的示例。