WiX: Digitally Sign BootStrapper project

前端 未结 4 962
陌清茗
陌清茗 2020-12-04 14:27

I have a project for which I have built a WiX msi file. I also have a WiX bootstrapper (exe file) that checks for the existence of C++ 2005, installs it if not found and th

4条回答
  •  再見小時候
    2020-12-04 15:27

    Updating for VS2019, and based on @jchoover's answer, here is what I got working.

    This leverages some MSBuild property function work by @webjprgm here that makes finding signtool.exe more generic across Windows Kit versions. As mentioned by @karfus in a comment above, adding the SignOutput section is the incantation that kicks everything off.

    This goes at the end of your bootstrap.wixproj file, before the closing /Project tag.

      
       
        true
      
    
      
      
          
            $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots', 'KitsRoot10', null, RegistryView.Registry32, RegistryView.Default))
            $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots', 'KitsRoot81', null, RegistryView.Registry32, RegistryView.Default))
            $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots', 'KitsRoot', null, RegistryView.Registry32, RegistryView.Default))
            $(WindowsKitsRoot)bin\x64\
            $(WindowsKitsRoot)bin\$(Platform)\
            $([System.IO.Directory]::GetDirectories('$(WindowsKitsRoot)bin',"10.0.*"))
            $(SignToolPathBin.Split(';').Length)
            $([MSBuild]::Add(-1, $(SignToolPathLen)))
            $(SignToolPathBin.Split(';').GetValue($(SignToolPathIndex)))\
            $(SignToolPathBase)x64\
            $(SignToolPathBase)$(Platform)\
          
      
    
      
      
        
      
    
      
      
        
      
    

提交回复
热议问题