gpt4 book ai didi

wix - 安装到 GAC 并在注册表中注册

转载 作者:行者123 更新时间:2023-12-04 19:12:54 24 4
gpt4 key购买 nike

好吧,我显然错过了一些东西。我正在尝试关注 this以便安装到 GAC 并可供开发使用。但是,唯一发生的事情是 DLL 被放入 ProductDirectory。它没有出现在 GAC 中,也没有添加注册表项。我怎样才能让它发挥作用?

Product.wxs的相关部分如下。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Me.Common" Language="1033" Version="1.0.0.0" Manufacturer="Me" UpgradeCode="ea52947a-0980-435d-a8f5-280d3526cb90">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<!-- The feature to install. -->
<Feature Id="ProductFeature" Title="Me.Common" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ProductDirectory" Name="Me.Common">
<Directory Id="GAC" Name="GAC" />
</Directory>
</Directory>
</Directory>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponents">
<Component Id="RunTime_Me.Common" Directory="GAC" Guid="E2B19C22-DC01-432D-85B0-0E4948F95A43">
<!-- Add to GAC. -->
<File Id="RunTime_Me.Common"
Source="$(var.Me.Common.TargetDir)$(var.Me.Common.TargetFileName)"
Assembly=".net"
KeyPath="yes" />
</Component>
<Component Id="DesignTime_Me.Common" Directory="ProductDirectory" Guid="C1BD8CD1-E834-49D5-B499-D9E313E70669">
<!-- Add locally. -->
<File Id="DesignTime_Me.Common"
Source="$(var.Me.Common.TargetDir)$(var.Me.Common.TargetFileName)"
KeyPath="yes" />
<!-- Add to registry so that Visual Studio can find it via Add Reference. -->
<Registry Id="Registry_DesignTime_Me.Common_AssemblyFolders"
Root="HKLM"
Key="SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\[ProductName]"
Value="[$DesignTime_Me.Common]"
Type="string" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

原来它已经安装在 GAC 中。我找错地方了; .NET 现在为 4.0 项(C:\Windows\Microsoft.NET\assembly)提供了第二个 GAC。这留下了注册表项。我收到警告 Registry已弃用,所以我用下面的组件替换了该组件,但仍然无法正常工作:
  <Component Id="DesignTime_Me.Common" Directory="ProductDirectory" Guid="C1BD8CD1-E834-49D5-B499-D9E313E70669">
<!-- Add locally. -->
<File Id="DesignTime_Me.Common"
Source="$(var.Me.Common.TargetDir)$(var.Me.Common.TargetFileName)"
KeyPath="yes" />
<!-- Add to registry so that Visual Studio can find it via Add Reference.
These require .NET v4.0 minimum. -->
<RegistryKey Root="HKLM"
Key="SOFTWARE\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\[ProductName]">
<RegistryValue Type="string" Value="[$DesignTime_Me.Common]" />
</RegistryKey>
</Component>
</ComponentGroup>

最佳答案

一切正常;我只是在错误的地方寻找。

4.0 GAC 位于 C:\Windows\Microsoft.NET\assembly .
注册表项被放置在 SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\[ProductName]因为安装程序是 32 位的。

关于wix - 安装到 GAC 并在注册表中注册,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13401126/

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