C# 引导程序清单生成器的注册表搜索

C# 引导程序清单生成器的注册表搜索,c#,manifest,setup-deployment,bootstrapper,C#,Manifest,Setup Deployment,Bootstrapper,引导程序清单生成器的注册表搜索允许您获取任何键的注册表值 但是,如果该密钥不存在,它将返回什么 因为我想先决条件安装的基础上,如果适当的注册表项存在或不存在 如果存在,则不要安装必备软件,否则请安装 如何做到这一点?可以通过使用元素中的ValueExists比较来轻松实现: <Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="AAA"> <Ins

引导程序清单生成器的注册表搜索允许您获取任何键的注册表值

但是,如果该密钥不存在,它将返回什么

因为我想先决条件安装的基础上,如果适当的注册表项存在或不存在

如果存在,则不要安装必备软件,否则请安装


如何做到这一点?

可以通过使用元素中的ValueExists比较来轻松实现:

<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="AAA">
   <InstallChecks>
      <RegistryCheck Property="IsInstalled" Key="HKCU\Software\ABC Software\ABC" Value="Installed" />
   </InstallChecks>

   <Commands Reboot="Defer">
      <Command PackageFile="setup.exe" EstimatedInstallSeconds="15" >
         <InstallConditions>
            <BypassIf Property="IsInstalled" Compare="ValueExists" />
         </InstallConditions>
      </Command>
   </Commands>

   ...

</Product>

...