6 Replies Latest reply on Mar 27, 2017 11:01 AM by SpencerTC

    I'm having an issue with Package Bundle & Order of Operations

    SpencerTC Apprentice

      Hey, guys.

       

      I'm in a puzzle right now, and I could use your input.

      I'm currently attempting to make a package bundle containing Firefox ESR 52.0.1, a powershell script containing instructions to re-enable NPAPI, and a Batch file instructed to run said powershell script.


      My setup has the Firefox install and the Batch file as the two package components, and I have the powershell script attached as an additional file to the Firefox install. I can't run the Powershell script before the Batch file or else we'll run into complications, so my thinking is if I had the Powershell script attached as an additional file to the Firefox install, then it should theoretically copy over to the target device first while Firefox installs, and then once the installation completes, the next item in the package bundle (the batch file) should run next. NOTE: the batch file must be run from the same location as the Powershell script. Since all these files are being copied over to the same temp file within the target device, this would tell me that the Firefox install, the powershell script and the batch file are all in the same location (which they were; we confirmed).

       

      However, once the package bundle completes, the fix is not applied, and it acts as though neither the batch file nor the powershell script were run. When we looked at the target machine and saw the files listed, we ran the batch file manually and everything applied like it should. The issue here is the order of operations with these packages.

       

      At first, I would just include the powershell script as a part of the bundled package, but I DO NOT want it to run at any point during this task. It's set up in such a way that the batch file should be the only way this script should be utilized. I had also modified the batch file package to make it run dependent on the Powershell script, but our tests with that resulted in failure as well.

       

      Now I'm at wits end today, and I wanted to ask the community if they had any ideas to brainstorm or solutions that may come from a similar experience. Please lend me your thoughts.

        • 1. Re: I'm having an issue with Package Bundle & Order of Operations
          MarXtar ITSMMVPGroup

          Breaking this down into the components then.

           

          So effectively two packages:

           

          Firefox (with an extra file, the powershell script attached)

          A Batch File that calls the powershell script

           

          Correct?

           

          You have confirmed that if these are in a bundle, then Firefox gets installed, the script is in place but the batch file does not seem to run and call it.

           

          Correct?

           

          So what happens if you do this as two independent packages (forget the bundle for now)? Does Firefox install and the powershell script get copied down? If you then just send the batch file package to the same machine does that work? I'm ssking because I'd just like to be certain we don't have an issue with the batch file package itself. If it doesn't work independently then that alone can be worked on and we know it isn't bundle related..

           

          Also, why attach the script to Firefox? Wouldn't it make sense for it to be an additional file in the batch file package?

           

          I know you said running the batch file works. I'm assuming that was done manually on the client rather than as part of a package. What is in the batch file? Could this behave differently when called by LDMS than when run manually?

           

          Mark McGinn

          MarXtar Ltd/MarXtar Corporation

          http://ivantione.marxtar.com

          Ivanti One Development Partner

           

          Try MarXtar State Management for Ivanti to Better Understand and Manage your Assets

          • 2. Re: I'm having an issue with Package Bundle & Order of Operations
            SpencerTC Apprentice

            I haven't yet tried running these as two individual packages, only because I was hoping to knock them out in one task. I can try that one out later today.

             

            I attach the script to Firefox because it's the first package in the bundle to deploy, so in my mind, as it installs, it copies the file over to the temp folder for the second package (the batch file) to see.

            I have reservations attaching the powershell script to the batch file package because essentially, you're asking the batch file to run immediately as it gets deployed, and I wasn't 100% certain that it would run correctly if the batch file tried running first before it copies the additional file over.

             

            The batch file (authored by a coworker) contains the following:

            "@ECHO OFF

            PowerShell.exe -executionpolicy Bypass -File "FirefoxFix_Global.ps1""

             

            So it's important that the batch and the powershell files are in the same location. If the batch runs before the powershell script is placed in that folder, it will obviously error out.

            • 3. Re: I'm having an issue with Package Bundle & Order of Operations
              MarXtar ITSMMVPGroup

              An additional file is copied down as part of the same process that downloads the main file (the batch) so don't be concerned about the batch running too soon. If the additional file fails to download then the package fails anyway.

               

              Definitely try it as a standalone package just to be certain that works.

               

              Mark McGinn

              MarXtar Ltd/MarXtar Corporation

              http://ivantione.marxtar.com

              Ivanti One Development Partner

               

              Try MarXtar State Management for Ivanti to Better Understand and Manage your Assets

              • 4. Re: I'm having an issue with Package Bundle & Order of Operations
                SpencerTC Apprentice

                I think I may have found my issue, but have not yet got to test yet. The Powershell script calls upon files we have listed on another server. Well running this package bundle as a Local System Account won't have the required privileges needed to access those files. So I'm going to try and copy the referenced files to my Core, attach them as additional files, edit the powershell script and the retry the deployment.

                • 5. Re: I'm having an issue with Package Bundle & Order of Operations
                  Frank Wils ITSMMVPGroup

                  Also, with batch and powershell scripts, make sure you have the System Architecture in the Distribution Package set properly ti run as X64 on X64 bit systems. Maybe these scripts do work, but the results are not where you would expect them (in 32-bit spaces instead).

                   

                  Frank

                  • 6. Re: I'm having an issue with Package Bundle & Order of Operations
                    SpencerTC Apprentice

                    I was finally able to get it to work! What I ended up doing was completely do away with the powershell script. The changes that were needed could be accomplished with some other firefox configuration files. One person from our team noted that the Local System Account would not be able to talk to our online server to access said files, so I copied them all over to my packages folder on the LANDesk core. From there, I attached those files as additional files to my batch file. The same team member made some adjustments to the batch file where it would then copy the files from their future location (in the sdmcache/packages folder) to their necessary folders in the FireFox Program Files folders.

                     

                    We ran some tests today which resulted in failure. The batch file wouldn't successfully copy over in the task. So I just reboot the VM hosting LANDesk and tried it again. SUCCESS!!