简体   繁体   English

我怎样才能解决这个烦人的WiX问题?

[英]How can I get around this annoying WiX issue?

WiX is complaining (what are the odds, right?): WiX正在抱怨(赔率是多少,对吧?):

Error 95 The component 'blahblah' has a key file with path 'TARGETDIR\\blah.dll'. 错误95组件'blahblah'有一个带有路径'TARGETDIR \\ blah.dll'的密钥文件。 Since this path is not rooted in one of the standard directories (like ProgramFilesFolder), this component does not fit the criteria for having an automatically generated guid. 由于此路径不是以其中一个标准目录(如ProgramFilesFolder)为根,因此该组件不符合自动生成guid的条件。 (This error may also occur if a path contains a likely standard directory such as nesting a directory with name "Common Files" under ProgramFilesFolder.) (如果路径包含可能的标准目录,例如在ProgramFilesFolder下嵌套名为“Common Files”的目录,也可能发生此错误。)

But I WANT an automatically generated GUID, and I DON'T want to have to set the TARGETDIR to some other path comprised of ProgramFilesFolder since I am setting the TARGETDIR in the UI and I even allow the user to change it so that people can specify the path they want to install the application at...how does someone get this functionality? 但我想要一个自动生成的GUID,我不想将TARGETDIR设置为由ProgramFilesFolder组成的其他路径,因为我在UI中设置了TARGETDIR,我甚至允许用户更改它以便人们可以指定他们想要安装应用程序的路径......有人如何获得此功能? Is it possible? 可能吗? I mean, can I have the best of both worlds or not? 我的意思是,我能否拥有两全其美的优势? Why is it such a big deal? 为什么这么重要? WiX is way too restrictive sometimes... WiX有时太严格了......

您需要做的就是设置Directory / @ ComponentGuidGenerationSeed,然后您可以将auto guids用于非标准文件夹。

I just got it...kind of annoying but its working alright... 我刚刚得到它......有点烦人但工作正常......

I was modifying the TARGETDIR and working with it prior...but now, I realize that I can easily just have worked with INSTALLDIR...for example, I re-factored my directory structure as such: 我正在修改TARGETDIR并在之前使用它...但现在,我意识到我可以很容易地使用INSTALLDIR ...例如,我重新考虑了我的目录结构:

<Directory Id='TARGETDIR' Name='SourceDir'>
  ...
  <Directory Id="ProgramFilesFolder">
    <Directory Id="blahFolder" Name="blah">
      <Directory Id="INSTALLFOLDER" Name="blah"/>
    </Directory>
  </Directory>
</Directory>

I can get components to reference the INSTALLFOLDER and it will auto-generate GUIDs for them: 我可以获取引用INSTALLFOLDER的组件,它会为它们自动生成GUID:

<ComponentGroup Id='blahgroup'>
    <Component Id='blahId' Directory='INSTALLFOLDER' Transitive='no'>
      <RegistryKey Root='HKLM' Key='Software\blah\blah' ForceCreateOnInstall='no' ForceDeleteOnUninstall='no'>
        <RegistryValue Type='string' Name='blah' Value='BLAH' />
      </RegistryKey>
    </Component>
    ...
</ComponentGroup>

But in my UI, its nice because I can modify just the installation folder path quite well: 但在我的UI中,它很好,因为我可以很好地修改安装文件夹路径:

<Product ...>
  ...
  <CustomAction Id='SetInstallFolder' Property='INSTALLFOLDER' Value='[ProgramFilesFolder]blah\blah\'/>
  ...
</Product>

I can then force the INSTALLFOLDER to point anywhere I want: 然后我可以强制INSTALLFOLDER指向我想要的任何地方:

<InstallUISequence>
  <Custom Action='SetInstallFolder' Sequence='1'/>
  ...
</InstallUISequence>
<AdminUISequence>
  <Custom Action='SetInstallFolder' Sequence='1'/>
  ...
</AdminUISequence>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM