Uninstall old Reportviewer and Install Reportviewer 2015 using DSC

Hi Guys,

I am trying to install Reportviewer 2015 using Package resource in my servers on top of old Reportviewer. The old reportviewer was also installed through DSC.

Is there any way to modify the DSC script so that the same script will uninstall the old version and install the new version without affecting the applications which depend on the reportviewer?

Or can we modify the package module in any way so that we can Ensure a particular version of Package is present in server and a particular version is not there?

Existing Code :

Package SQLScript
{
Ensure = “Present”
Path = “X\xxxxx\Microsoft Report Viewer 2012 Runtime\x64\SQLSysClrTypes.msi”
Name = “Microsoft System CLR Types for SQL Server 2012 (x64)”
ProductID = “F1949145-EB64-4DE7-9D81-E6D27937146C”
ReturnCode = 0
Credential= $cred

    }

    Package ReportViewer
    {
        Ensure = "Present"
        Path = "X\xxxxxx\Microsoft Report Viewer 2012 Runtime\ReportViewer.msi"
        Name = "Microsoft Report Viewer 2012 Runtime"
        ProductID = "A047101C-A3AE-4FAD-802F-01C965079F66"
        DependsOn = "[Package]SQLScript"
        ReturnCode = 0
        Credential= $cred
    }

Thanks,
Aravinda

Everything is possible with enough donuts and time…

Honestly I dont know the details of what you’re trying to do BUT typically the ProductID/Name tends to be unique across releases so you can maybe use the ensure=absent on the “old” version then add it to the dependson of the new.

Hi Justin,

You are right, but If I write a package resource to uninstall the older version and another resource to install new version in my automation script, every time the script runs it will do both jobs. Again after first time I don’t need the uninstall resource to be there. So , in a way that will be junk in my code.

I think if we have a version parameter in Package module , it will solve the problem. If we mention a version it will search for the particular installer version in the directory specified and install it.

Thanks,
Aravinda

That simply sounds like you need to refine your test-targetresource script so that it simply “checks for” the old one then quietly closes if it’s not found.

Another option would simply be to write the replacement logic into you install custom resource. Then you only need to call one resource and the installation understands it needs to look for and remove the old version if found.