Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use a bootstrapper to handle prerequisites like checking for the .NET Framework. Check the <a href="http://msdn.microsoft.com/en-us/library/h4k032e1%28v=vs.100%29.aspx" rel="nofollow noreferrer">Application Deployment Prerequisites</a> MSDN article, especially the sections about bootstrapping with ClickOnce and MSBuild. </p> <p>There are also 2 more MSDN articles that detail <a href="http://msdn.microsoft.com/en-us/library/8st7th1x%28v=vs.100%29.aspx" rel="nofollow noreferrer">how to install ClickOnce prerequisites</a> and <a href="http://msdn.microsoft.com/en-us/library/ms165429%28v=vs.100%29.aspx" rel="nofollow noreferrer">Creating bootstrapper packages</a>. </p> <p>As for auto-updates, do you want to locate the auto-update functionality outside the application itself, i.e., in an installer vs. in the application? There are <a href="http://msdn.microsoft.com/en-us/library/s22azw1e%28v=vs.100%29.aspx" rel="nofollow noreferrer">several ways to allow ClickOnce updates</a> in your application, including <a href="http://msdn.microsoft.com/en-us/library/ms404263%28v=vs.100%29.aspx" rel="nofollow noreferrer">auto-updates via the ClickOnce Deployment API</a>.</p> <p>A brief explanation of using ClickOnce Bootstrapper packages can be found in <a href="https://stackoverflow.com/a/1336416/461382">this existing Stackoverflow article</a>. Though you're not using WiX here, you can also check this <a href="http://www.mentby.com/jason-ding/install-net-framework-4.html" rel="nofollow noreferrer">this WiX thread</a>, which is useful because you see some of the steps that didn't work along the way. These examples show the use of the <a href="http://msdn.microsoft.com/en-us/library/ms164294%28v=vs.100%29.aspx" rel="nofollow noreferrer">GenerateBootstrapper MSBuild task</a> to create the bootstrapper for the ClickOnce installer. Note that in the examples at the above links, the "Path" in the GenerateBootstrapper task is set to a subfolder under a Windows SDK location. This can be changed to another location, as long as that location has the necessary prerequisite packages. </p> <p>Below is an example in which the .NET 4.5 Framework is set as a prerequisite for the install. The parent directory structure for the .NET 4.5 prerequisite is specified by the $(MyPathToPrerequisitePackages) property.</p> <p>The <strong>BootstrapperFile</strong> item in the below example specifies the .NET 4.5 Framework prerequisite package. The value ".NETFramework,Version=v4.5" comes from the product.xml file in the Bootstrapper\Packages\DotNetFX45 folder, and allows the <strong>GenerateBootstrapper</strong> task to correctly identify the .NET 4.5 prerequisite/bootstrapper package. The "ProductName" value is simply a friendly description of the package.</p> <pre><code>&lt;PropertyGroup&gt; &lt;MyPathToPrerequisitePackages&gt;C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper&lt;/MyPathToPrerequisitePackages&gt; &lt;/PropertyGroup&gt; &lt;ItemGroup&gt; &lt;BootstrapperFile Include=".NETFramework,Version=v4.5"&gt; &lt;ProductName&gt;.NET Framework 4.5&lt;/ProductName&gt; &lt;/BootstrapperFile&gt; &lt;/ItemGroup&gt; &lt;GenerateBootstrapper ApplicationFile="$(MyAppAssembly).application" ApplicationUrl="$(MyClickOnceAppUrl)" ApplicationName="$(MyClickOnceAppName)" BootstrapperItems="@(BootstrapperFile)" Culture="en" FallbackCulture="en-US" CopyComponents="true" Validate="false" Path="$(MyPathToPrerequisitePackages)" SupportUrl="$(MyAppSupportUrl)" OutputPath="$(MyDesiredOutputPath)\" /&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload