3
votes

I'm trying to first uninstall a package, then install the latest version of that same package. Simple you would think, but when I include the following code in my DSC configuration:

    ### remove old product setup
    Package removeOldProduct {
        Ensure = 'Absent'
        Name = 'My Product Name'
        Path = ""
        ProductId = ""
    }
    ### now install the latest product setup
    Package productSetup {
        Ensure = 'Present'
        Name = 'My Product Name'
        Path = "$productShare\Repository\product.msi"
        ProductId = ""
        Arguments = "ACCEPT_EULA=1 /q"
        DependsOn = '[Package]MsSql'
    }

While creating the .mof file, I receive the following error:

Test-ConflictingResources : A conflict was detected between resources '[Package]productSetup and '[Package]removeOldProduct in node 'myNodeServer'. Resources have identical key properties but there are differences in the following non-key properties: 'Path;Ensure;Arguments'.

I don't want to use a Script resource to process my uninstall. What am I doing wrong here?

1

1 Answers

1
votes

Your configuration is supposed to be idempotent, generally, so this doesn't make a lot of sense. You would be uninstalling and reinstalling the package every time the configuration is applied (every 30 minutes or whatever it's set to).

An MSI installer should support upgrading automatically, which means you would just ensure the installation of the (newer) MSI.