gpt4 book ai didi

c# - WIX ComponentGroup 子目录

转载 作者:太空狗 更新时间:2023-10-29 21:45:04 26 4
gpt4 key购买 nike

我想将我的应用程序安装到以下目录结构中:

MyCompany/
MyApp/
assembly1.dll
assembly2.dll
assembly3.dll
...
plugins/
plugin1.dll
plugin2.dll

为此,我定义了以下文件夹:

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="CompanyFolder" Name="MyCompanyName">
<Directory Id="INSTALLFOLDER" Name="MyProduct">
<Directory Id="PLUGINS" Name="plugins">
<Directory Id="DATABASE_PLUGINS" Name="db" />
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>

现在我已经定义了 1 个功能并引用了一个组件组。该组件组有一个指向“INSTALLFOLDER”的属性“Directory”。但是当我现在在组件组中声明一个组件时,它也有一个“目录”属性(指向 DATABASE_PLUGINS),VS 不会让我build设置。

<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="DB.Connector.Extension.Plugins.SqlCe" Directory="DATABASE_PLUGINS" Guid="{ae87be28-b0c9-4b3e-915f-2b4bf9965c99}">
<File Source="$(var.DB.Connector.Extension.Plugins.SqlCe.TargetDir)DB.Connector.Extension.Plugins.SqlCe.dll" KeyPath="yes" />
</Component>
</ComponentGroup>

我怎样才能实现安装程序在我的主安装目录中创建一个子目录并将声明的文件放入其中?

最佳答案

这是我的完整示例,希望这对更多开发人员有所帮助

</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="GiladDir" Name="Gilad">
<Directory Id="INSTALLFOLDER" Name="App">
<Directory Id="BIN" Name="bin"></Directory>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="App">
<Component Id="ProgramMenuDir" Guid="*">
<RemoveFolder Id="ProgramMenuDir" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value="" KeyPath="yes" />
</Component>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="group_tools">
<ComponentRef Id="comp_tool_dll" />

</ComponentGroup>
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="bin" Name="bin">
<Directory Id="Release" Name="Release">
<Directory Id="Plugins" Name="Plugins">
<Component Id="comp_tool_dll" DiskId="1" KeyPath="yes" Guid="*">
<File Id="file_comp_tool_dll" Source="$(var.ReleaseSourcePath)\Plugins\tool.dll" />
</Component>

关于c# - WIX ComponentGroup 子目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18334987/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com