Tuesday, February 09, 2016

ReportViewer 2015 Clickonce Bootstrapper

In order to have ReportViewer 2015 (version 12) as a clickonce prerequisite, you will need a 'dependson' for sql 2014 clr types which will be posted separately.

1.  Create folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\ReportViewer2015 (you can copy an old ReportViewer bootstrapper)

2.  product.xml:
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (c) Microsoft.  All rights reserved. -->
<Product
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  ProductCode="Microsoft.ReportViewer.12.0"
>
  <RelatedProducts>
    <EitherProducts>
      <DependsOnProduct Code="Microsoft.Net.Framework.3.5.SP1" />
      <DependsOnProduct Code=".NETFramework,Version=v4.0,Profile=Client" />
      <DependsOnProduct Code=".NETFramework,Version=v4.0" />
      <DependsOnProduct Code=".NETFramework,Version=v4.5" />
    </EitherProducts>
    <DependsOnProduct Code="Microsoft.SqlServer.SQLSysClrTypes.12.0.x86" />
  </RelatedProducts>

  <PackageFiles CopyAllPackageFiles="false">
    <PackageFile Name="ReportViewer.msi" HomeSite="ReportViewerMsi" PublicKey="3082010a0282010100c2ded6cfe2b77f1165ffb363a9f372b9f124eb5fa41cb24459eb6f9cfb70db65699aab90315effde2b6411f5ed6ce9002182c390cc8219a3e39963658abdd3d5fb20a3e0197fb88d3c6afec8128de5d339ef4d4e3e86964c11b111849b2798883b2dd47d18f305e0ad4b043e437519e646c48c9ddb89d82487bef44727bf6d8ddc78b9c365a16f37eabc71a69dac8e8f8d88917ea83725d98124a988f46346eabb20c9012fd88e0cd9d9ede036fb64684dfc422f9120a9089a284a47a8f0fed9b27afdd8e83801bc8145ab3ae81a2add39833f07dbd8e18ffc392c369e019fef6877c8786f3ef820ff961a10bef1aad0619ea89a84bf3eaeafca0a59e58d8b050203010001" />
  </PackageFiles>

  <InstallChecks>
    <RegistryCheck Property="IsViewerInstalled" Key="HKLM\Software\Microsoft\Microsoft SQL Server 2014 Redist\Microsoft Report Viewer 2015 Runtime" Value="Version" />
  </InstallChecks>

  <Commands Reboot="Defer">
    <Command PackageFile="ReportViewer.msi"
         Arguments="/q /norestart"
         EstimatedInstalledBytes="13000000"
         EstimatedInstallSeconds="150">

      <!-- These checks determine whether the package is to be installed -->
      <InstallConditions>
        <BypassIf Property="IsViewerInstalled" Compare="VersionGreaterThanOrEqualTo" Value="12.0.0.0"/>

        <!-- Block install if user does not have admin privileges -->
        <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
      </InstallConditions>

      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <ExitCode Value="3010" Result="SuccessReboot"/>
        <ExitCode Value="4097" Result="Fail" String="AdminRequired"/>
        <ExitCode Value="4099" Result="Fail" String="WindowsInstallerImproperInstall"/>
        <ExitCode Value="4101" Result="Fail" String="AnotherInstanceRunning"/>
        <ExitCode Value="4113" Result="Fail" String="BetaProductFailure"/>
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>

    </Command>
  </Commands>
</Product>

Take note that the PublicKey is 3082010a0282010100c2ded6cfe2b77f1165ffb363a9f372b9f124eb5fa41cb24459eb6f9cfb70db65699aab90315effde2b6411f5ed6ce9002182c390cc8219a3e39963658abdd3d5fb20a3e0197fb88d3c6afec8128de5d339ef4d4e3e86964c11b111849b2798883b2dd47d18f305e0ad4b043e437519e646c48c9ddb89d82487bef44727bf6d8ddc78b9c365a16f37eabc71a69dac8e8f8d88917ea83725d98124a988f46346eabb20c9012fd88e0cd9d9ede036fb64684dfc422f9120a9089a284a47a8f0fed9b27afdd8e83801bc8145ab3ae81a2add39833f07dbd8e18ffc392c369e019fef6877c8786f3ef820ff961a10bef1aad0619ea89a84bf3eaeafca0a59e58d8b050203010001

3. Within "en" subfolder (or whatever language you are localizing) package.xml:
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (c) Microsoft.  All rights reserved. -->
<Package
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  Name="DisplayName"
  Culture="Culture"
  LicenseAgreement="eula.rtf"
>

    <PackageFiles>
        <PackageFile Name="eula.rtf"/>
    </PackageFiles>

    <!-- Defines a localizable string table for error messages-->
    <Strings>
        <String Name="DisplayName">Microsoft Report Viewer 2015 Runtime</String>
        <String Name="Culture">en</String>
        <String Name="AdminRequired">Administrator permissions are required to install Microsoft Report Viewer 2014 Runtime. Contact your administrator.</String>
        <String Name="DotNetFxRequired">Installation of Microsoft Report Viewer 2014 Runtime requires Microsoft .NET Framework 3.5 SP1 or above. Contact your application vendor.</String>
        <String Name="WindowsInstallerImproperInstall">Due to an error with Windows Installer, the installation of Microsoft Report Viewer 2014 Runtime cannot proceed.</String>
        <String Name="AnotherInstanceRunning">Another instance of setup is already running. The running instance must complete before this setup can proceed.</String>
        <String Name="BetaProductFailure">A beta version of Microsoft Report Viewer 2014 Runtime was detected on the computer. Uninstall any previous beta versions of Microsoft Report Viewer 2014 Runtime before continuing.</String>
        <String Name="GeneralFailure">A failure occurred attempting to install Microsoft Report Viewer 2014 Runtime.</String>
      <String Name="ReportViewerMsi">https://download.microsoft.com/download/A/1/2/A129F694-233C-4C7C-860F-F73139CF2E01/ENU/x86/ReportViewer.msi</String>  
    </Strings>

</Package>




No comments: