How to: Include Prerequisites with a ClickOnce Application

Before you can distribute prerequisite software with a ClickOnce application, you must first download the installer packages for those prerequisites to your development computer. When you publish an application and choose Download prerequisites from the same location as my application, an error will occur if the installer packages aren’t in the Packages folder.

To add an installer package by using Package.xml

  1. In File Explorer, open the Packages folder.

    By default, the path is C:\Program Files\Microsoft SDKs\Windows\v8.0a\Bootstrapper\Packages on a 32-bit system and C:\Program Files (x86)\ Microsoft SDKs\Windows\v8.0a\Bootstrapper\Packages on a 64-bit system.

  2. Open the folder for the prerequisite that you want to add, and then open the language folder for your installed version of Visual Studio (for example, en for English).

  3. In Notepad, open the Package.xml file.

  4. Locate the Name element that contains https://go.microsoft.com/fwlink, and copy the URL. Include the LinkID portion.

    Note

    If no Name element contains https://go.microsoft.com/fwlink, open the Product.xml file in the root folder for the prerequisite and locate the fwlink string.

    Important

    Some prerequisites have multiple installer packages (for example, for 32-bit or 64-bit systems). If multiple Name elements contain fwlink, you must repeat the remaining steps for each of them.

  5. Paste the URL into the address bar of your browser, and then, when you are prompted to run or save, choose Save.

    This step downloads the installer file to your computer.

  6. Copy the file to the root folder for the prerequisite.

    For example, for the Windows Installer 4.5 prerequisite, copy the file to the \Packages\WindowsInstaller4_5 folder.

    You can now distribute the installer package with your application.

To add an installer package for the .NET Framework 4.5

  1. In File Explorer, open the Packages folder.

    By default, the path is C:\Program Files\Microsoft SDKs\Windows\v8.0a\Bootstrapper\Packages on a 32-bit system and C:\Program Files (x86)\ Microsoft SDKs\Windows\v8.0a\Bootstrapper\Packages on a 64-bit system.

  2. Open the DotNetFX45 folder.

  3. From the Download Center, download the package file dotNetFx45_Full_x86_x64.exe, and then copy it to the DotNetFX45 folder.

  4. For localized applications (any locale other than EN), open the language folder for the application’s locale.

  5. In Notepad, open the Package.xml file.

  6. Locate the Name element that contains “DotNetFX45FullLanguagePackBootstrapper”, and copy the URL, including the LinkID portion.

  7. Paste the URL into the address bar of your browser.

  8. When you're prompted to run or save, choose the Save button.

    This step downloads the installer file to your computer.

  9. Copy the file to the DotNetFX45 folder.

    You can now distribute the installer package with your application.

See Also

Tasks

How to: Install Prerequisites with a ClickOnce Application