3 Replies Latest reply on Aug 4, 2017 4:59 AM by PMason1

    Packages with dependencies

    Rookie

      Hi

       

      Looking for some advice if possible about deploying packages that have dependencies, and need reboots?

       

      I'm deploying .NET Framework 4.6.2, Microsoft Management Framework 5.1 and finally the Microsoft UEV Agent.

       

      I created packages for all three, that work in isolation if I manually install them from DSM, reboot, then install the next, however as part of a software set they fail.  I believe the issue is that they need a reboot from the previous step before the next package can install.

       

      I thought there might be a way to get DSM to retry a package if it failed after the next reboot, but I can't seem to find it if it exists.

       

      I don't mind if they are part of a set, or how I deploy them, I'd just like to try and find a way to handle this if possible?

       

      Thanks

      Paul

        • 1. Re: Packages with dependencies
          _Mel_ Master

          1. the package that installs something that requires a reboot should say so (e.g. by using the escript command InitiateSystemShutdown)

          2. in the second package you have to detect the missing reboot; there are several ways to do this

          - just try the installation and detect by the error code that a reboot is missing

          - use the if condition IsRestartFlagSet (caution: will only work in the same installer run the reboot was requested)

          - if you are already on 2016.2 R2 you can use the GetComplianceStatistics Command to check for the RebootPending property on the policyinstance of the first package

          3. abort the execution of the second package by using the ExitProc command with the undone option

           

          there is also the possibility to set a number of automatic retries for packages either globally in the infrastructure settings or (I think starting with 2016.2 R2) per package.

          but this won't help you if the computer isn't restarted before the maximum number of retries is reached

          1 of 1 people found this helpful
          • 2. Re: Packages with dependencies
            derniwi Master

            Hi Paul,

             

            I use this piece of code for installing .NET Framework 4.6.1... should also work with 4.6.2

            --------------------------------------------------------------------------------------

            Set('returncode','0')

            RunAsEx('.\Extern$\NDP461-KB3102436-x86-x64-AllOS-ENU.exe','/q /norestart /log "%SystemRoot%\Logs\NET461.html"','','PASSWORD','30','returncode',raUseSisAccount+WaitForExecution+raLogonWithProfile+UndoneContinueParentScript)/TW

            If %returncode%='TIMEOUT'

            ExitProcEx(Failed,'Timeout during setup!')

            If %returncode%='3010'

            System_Reset

            EndInstallerSession

            If %returncode%='0' or %returncode%='3010'

            ExitProc(Done)

            Else

            ExitProcEx(Failed,'Returncode of installation: %returncode%')

            --------------------------------------------------------------------------------------

             

            Since the Microsoft installer uses default return codes it is easy to handle them.

             

            I prefer the use of "System_Reset" (with or without user question).

             

            Using "EndInstallerSession" is also a good option for packages in a software set. This will stop the execution of other packages after the current package has finished so a pending reboot can be executed.

             

            Regards

            Nils

            1 of 1 people found this helpful
            • 3. Re: Packages with dependencies
              Rookie

              Thanks for this, really got me on the right lines, just ran a test with the three packages and worked fine on the test machine.