Using DSC to deploy an EXE installer - Need to deploy new builds

This topic contains 6 replies, has 3 voices, and was last updated by Profile photo of Alex Alex 2 years, 5 months ago.

  • Author
    Posts
  • #16954
    Profile photo of Alex
    Alex
    Participant

    So after spending a few days with learning the basics of DSC I have a setup where my MOF is deploying an EXE installer for some software I am testing to a VM. A fresh install of this EXE works fine. What I would like to do is also use DSC to push new builds of this EXE installer to the VM and run it so that it self upgrades, but I am not sure how to achieve that. Running the MOF again using the new build of the EXE doesn't run the installer, because the LCM sees that the Product Name already exists.

    My code to create the MOF is very simple:

    Package MyProduct
            {
            Ensure="Present"
            Path="C:\Temp\Installers\Net\Product.exe"
            Name="Product"
            ProductID=""
            DependsOn = '[Package]CrystalReports'
            }
    
  • #16955
    Profile photo of Don Jones
    Don Jones
    Keymaster

    You're probably going to have to custom-build this in a Script resource or something. The Package resource wasn't really designed with EXEs in mind; the "test" function has no way of testing to see if a particular version is installed or not. I'm not entirely sure DSC is going to prove a good long-term way of managing software deployments, at least not using current Setup routines.

  • #16956
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    Doesn't look like the built-in Package resource supports this, but it also look like it shouldn't be too difficult to make a community modification of it (cPackage) which adds some optional Version behavior.

  • #16957
    Profile photo of Alex
    Alex
    Participant

    Would it be easier if I extracted the MSI from the EXE?

    Thanks for the help, I sincerely apprecaite it!!

  • #16958
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    Only if the new versions of the MSI have a different product ID. Right now, that's the only way the Package resource identifies currently-installed software other than "Name".

  • #16959
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Yeah, to be clear: The native Package resource doesn't presently care about versions at all. It's "is this software installed or not." It isn't designed to be a full-fledged software deployment mechanism a la SCCM or GPO. At least, not currently. Who knows what'll happen in the future.

  • #16960
    Profile photo of Alex
    Alex
    Participant

    Got it. Thanks again for the assistance!

You must be logged in to reply to this topic.