wpfclickonceprerequisites

How to add custom prerequisite for ClickOnce?


I have a WPF application which is distributed by ClickOnce. ClickOnce handles well prerequisite like LocalDb and .Net Desktop Runtime. I started to use Identity in the program so now I need ASP.NET Core Runtime as well, but it is not in the list. I have sent the problem to MS 3 weeks ago, but no response from them. https://developercommunity.visualstudio.com/t/ClickOnce-prerequisite-ASPNET-Core-Run/10179285?

I started to look how to add a custom prerequisite but the descriptions was quite old or not detailed. Does somebody have a good description?

UPDATE 1

I did some research.

  1. On windows 10 my Bootstrap directory is at "c:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages". But here are only some of the prerequisite, for example SqlLocalDB2019 but not net 5. Why is that?
  2. I have found some useful stuff, an old and a new. They provided the product.xml and the en/package.xml. I have copied the files to the Packages folder but the new prerequisites did not show in VS. I also tried to copy and modify slightly the existing SqlLocalDB2019 folder but the new version did not show either. What am I missing?
  3. What changes do I need in the two files once the prerequisite appear?

Solution

    1. There are two location for prerequisites

      • "c:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages"
      • "d:\Program Files\Visual Studio 2022 Community\MSBuild\Microsoft\VisualStudio\BootstrapperPackages"
    2. I did not found the problem the old examples but I was able to add my own prerequisite.

    See: https://stackoverflow.com/a/74536380/5852947