使用 MsBuild 删除 LookInFolders VS 2008 - 9.0 中的键
我使用 MsBuild 注册 VS Addin。
我需要在 MSBuild 中实现目标卸载。
如何使用 MsBuild 删除 SOFTWARE\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders 注册表中的插件路径?
对于安装,我使用
<Target Name="RegistryExtensions">
<Message Text="Registry AddIn..."></Message>
<Registry.Set
RegistryHive="LocalMachine"
Key="SOFTWARE\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders"
Value="$(ProgramFiles)\LifeCycle\AddIns"
DataType="String" />
<Message Text="Adding LifeCycle.targets to VisualStudio SafeImports ..."></Message>
<Registry.Set
RegistryHive="LocalMachine"
Key="SOFTWARE\Microsoft\VisualStudio\9.0\MSBuild\SafeImports"
Value="MyLifeCycle"
DataType="String"
Data="$(MSBuildExtensionsPath)\LifeCycle.targets" ContinueOnError="true">
</Registry.Set>
</Target>
<Target Name="UnRegistryAddin">
<!-- TODO -->
</Target>
尝试获取值,但得到空字符串
<Registry.GetKey
RegistryHive="LocalMachine"
Key="SOFTWARE\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders"
Value="$(ProgramFiles)\LifeCycle\AddIns">
<Output TaskParameter="Data" PropertyName="Addin1"/>
</Registry.GetKey>
<Message Text=" Addin1 $(Addin1)" />
I use MsBuild to Registry a VS Addin.
I need implement target Uninstall in MSBuild.
How can I delete my addin path in SOFTWARE\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders registry using MsBuild ?
For install, I use
<Target Name="RegistryExtensions">
<Message Text="Registry AddIn..."></Message>
<Registry.Set
RegistryHive="LocalMachine"
Key="SOFTWARE\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders"
Value="$(ProgramFiles)\LifeCycle\AddIns"
DataType="String" />
<Message Text="Adding LifeCycle.targets to VisualStudio SafeImports ..."></Message>
<Registry.Set
RegistryHive="LocalMachine"
Key="SOFTWARE\Microsoft\VisualStudio\9.0\MSBuild\SafeImports"
Value="MyLifeCycle"
DataType="String"
Data="$(MSBuildExtensionsPath)\LifeCycle.targets" ContinueOnError="true">
</Registry.Set>
</Target>
<Target Name="UnRegistryAddin">
<!-- TODO -->
</Target>
I try get the value, but I get Empty string
<Registry.GetKey
RegistryHive="LocalMachine"
Key="SOFTWARE\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders"
Value="$(ProgramFiles)\LifeCycle\AddIns">
<Output TaskParameter="Data" PropertyName="Addin1"/>
</Registry.GetKey>
<Message Text=" Addin1 $(Addin1)" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以起诉
DeleteKey
/DeleteKeyTree
注册表任务,请参阅MSBuild 扩展包帮助我相信应该使用用于
Set
任务的语法:重要(要设置的必需属性):
You can sue
DeleteKey
/DeleteKeyTree
Registry tasks, see MSBuild Extension Pack helpI believe it should work with the syntax you are used for the
Set
task:Important (required attributes to be set):