1 2 3 Previous Next 32 Replies Latest reply: Feb 27, 2012 1:35 PM by AspenSkier RSS

    How does one get Patch Manager to uninstall .msi?


      So I must admit that am am still new to LDMS 9.0 SP2 patch manager, but I should at least stick up for myself and say that I have several custom definitions working.


      Today I'm trying to expand my patch manager skills a bit and create a dependancy relationship between two custom definitions.  It looks like this:


      • I have some existing software that needs to be updated
      • the new software requires that the old software be removed before being installed
      • First I need to bring a OLDsoftware.MSI file down to a client because the original was on a network share
      • I need to use MSIEXEC.EXE with that OLDsoftware.MSI file to remove the old version of the software
      • Next I need to have the NEWsoftware.MSI file down to the client
      • Then I need to use MSIEXEC.EXE with the NEWsoftware.MSI file to get the new version installed.


      this seems very straightforward to me.  I've got the 2nd part down such that I can install the new software when the old software is gone.  That custom definition works fine.


      My problem lies in the other custom definition that removes the old software.  Eventually I will create the dependency between the two definitions, but I can't get this one to work.  I can get detection to work just fine, even bring the OLDsoftware.MSI file down, but I can never get it to uninstall the old software.


      ***quick sidebar, I am bringing the OLDsoftware.MSI file back down to the client in order to simplify this scenario because it was originally on a network share and I want to avoid any permissions problems and just have the local computer remove the software with a locally stored MSI file***


      I've tried several different ways of getting the uninstall action to happen.


      I've tried a .ZIP file of the .MSI, unpacking it to %SDMCACHE% as well as %TEMP%, then executing MSIEXEC.EXE with the appropriate %variable%.  Whatever I do here the execution will fail.


      I've tried bringing the .MSI file across to the same two locations and just going about the uninstall with MSIEXEC.EXE against it, still fails.


      I've tried connecting to the network share with hard-coded credentials to copy the file down, etc.  Again, the execution of MSIEXEC.EXE fails.


      In each case I can go to the SDMCACHE folder and see the OLDsoftware.MSI file or .ZIP.  Whenever I try to use %temp% and zip I don't see it get unzipped to that location.  If I use the command line and manually execute MSIEXEC.EXE and point it to where Patch Manager put the .MSI, it will uninstall w/o problem.  It is always a simple matter that Patch Manager just can't uninstall.



      I know that I have the correct command line arguments to get the package uninstalled; I know I have the correct .MSI file necessary for the uninstall to happen; I know I can always manually execute the uninstall command when I have the MSI file...I just can't get patch manager to actually make the uninstall happen.


      any ideas on how I can get this to work?

        • 1. Re: How does one get Patch Manager to uninstall .msi?
          MarXtar SSMMVPGroup

          This sounds more like what normal software distribution is designed to achieve. Define two packages, one which is an uninstall for the old one, one that is an install for the new one but with a dependency on the uninstall. Create a query that targets your install package and away you go. Obviously a bit more than that, but in essence it is built to do this.


          Mark McGinn

          MarXtar Ltd


          LANDesk Silver ESP


          Join us on the 23rd Feb for our UK LANDesk Mobility Seminar (Smart, Laptop & Data) - Food & Fun too!


          The One-Stop Shop for LANDesk Enhancements

          - Wake-On-WAN - Distributed Wake-On-LAN, Scheduled Power Down, and SWDist Sequencing

          • 2. Re: How does one get Patch Manager to uninstall .msi?
            RichardA Apprentice

            Unless something is broken (or you've gone out of your way to clean up certain caches) you shouldn't need the old MSI to uninstall the old package -  msiexec.exe /x {productguid} should do the trick.


            You could include that as the first action in your repair steps, thus removing the need to have two separate definitions.


            Besides, I don't think dependancies in Patch Manager work the way you're thinking. If a patch it dependant on another, it won't even be detected until the other patch is repaired, as far as I'm aware. It's for handling things like a hotfix that only applied to a certain service pack.

            • 3. Re: How does one get Patch Manager to uninstall .msi?



              The reasons behind my drive to use patch manager instead of software distribution go beyond the scope of this post, but I'll just say that I can't reliably do this with SD, hence Patch Manager.  Thanks anyway.






              I already tried removing by product code, as is my standard preference, but it doesn't work with this specific piece of software so I'm having to work around the problem by using the OLDsoftware.MSI.  I have tested product removal with this work around and it works reliably and prepares the machines for the new software.  I just can't seem to get patch manager to replicate the steps that I can perform manually.



              regarding the dependencies; I broke out the uninstall and install steps to try and generate two working proceedures that could be used together but also individually.  In some cases I want the software just removed from the systems and in other cases I want it removed and reinstalled, and still I have some other systems that never had it and just need the software installed for the 1st time.  I didn't want to create three proceedures when two could work for all three cases.


              In fact, the dependencies do indeed work the way I suspect.  I have already established the dependency and I can see that Patch Manager detects both custom definitions but since the uninstall proceedure fails, the installation of the new software never starts.

              • 4. Re: How does one get Patch Manager to uninstall .msi?
                Frank Wils SSMMVPGroup

                What is in your vulscan.log files? Can you get any clue from there as to why the MSIEXEC might fail?



                • 5. Re: How does one get Patch Manager to uninstall .msi?

                  where are those logs supposed to be?



                  • 6. Re: How does one get Patch Manager to uninstall .msi?
                    mrspike SSMMVPGroup

                    I have done similar things by using a .bat file that handles everything.



                    Some things to do and know...


                    The sdmcache folder in Win 7 is restricted, so do not call anything from that location


                    What I do is create a batch file that calls all of the commands to uninstall, install etc.


                    I suggest using this as a variable in the batch file for the location:



                    Gather all .msi , .exe and your bat file and zip them into a single file, we will call it widget.zip


                    In the patch secion of your custom def, add the widget.zip file as the patch and hash it.


                    Now in the patch installation steps you add unzip a file, then add execute a file


                    See the images in the pdf I attached for help on that


                    Good luck

                    • 7. Re: How does one get Patch Manager to uninstall .msi?

                      still don't see a PDF, however:


                      it seems that your suggestion takes what I have already tried but extends it via the .BAT file.  Said another way, rather than rely on patch manager to pass the correct command line arguments for MSIEXEC.EXE I will be using a .BAT file to do that.


                      I'll give it a go and let you know how it works.  If it does, great...but then again why bother including a line item for arguments in patch manager if it can't pass them along to the file that is being executed?

                      • 8. Re: How does one get Patch Manager to uninstall .msi?
                        mrspike SSMMVPGroup

                        Let's try the pdf again

                        • 9. Re: How does one get Patch Manager to uninstall .msi?

                          this product continues to disappoint because no matter what I try nothing seems to work.


                          I did add the extra layer of complexity by putting the commands in a .BAT file and the outcome was essentially the same:  I can't uninstall the program.


                          It is worth noting that I have always been able to get the .MSI file down to my client via patch manager and today is no different:  I get both the .MSI file and the .BAT file.  As before I can manually perform the uninstall using the files delivered to the client by Patch Manager; I simply run the .BAT file and the software comes off.


                          I did manage to locate the VULSCAN.LOG file in the C:\ProgramData\Vulscan folder


                          Reading it reveals the following information:


                          RE: bat file,  ERROR: C:\Windows\temp\uninstall.bat returned a bad exit code (1) ERROR(Execute) Failed to run command - (80004005)


                          RE: original MSI file, ****can't seem to find this entry anymore, but it wasn't all that helpful when I did see it****

                          • 10. Re: How does one get Patch Manager to uninstall .msi?
                            Frank Wils SSMMVPGroup

                            What does your batch file look like? Can you post it here?



                            • 11. Re: How does one get Patch Manager to uninstall .msi?
                              RichardA Apprentice

                              Is it conceivable you're running into good ol' user context issues? That's usually the root cause when something works fine when run manually, but fails when run using a management tool such as LANDesk. If uninstallation works when run as a user, but fails as system, is it possible the MSI is somehow crafted such that is need a real user context?


                              Software distribution can run installers under the current user context. I'm not sure if Patch Manager can do the same, although you may be able to coerce it by having vulscan call sdclient /runasuser.

                              • 12. Re: How does one get Patch Manager to uninstall .msi?
                                mrspike SSMMVPGroup

                                vulscan and sdclient cannot run at the same time if my memory serves correctly

                                • 13. Re: How does one get Patch Manager to uninstall .msi?
                                  Frank Wils SSMMVPGroup

                                  Correct. The SDclient will either fail cause the vulscan is running or stay in the taskqueque. I just dont know if this will cause the vulscan action to fail and the SDclient to run after, or that the vulscan will wait for the sdclient to finish, creating a never-ending loop...



                                  • 14. Re: How does one get Patch Manager to uninstall .msi?
                                    RichardA Apprentice

                                    Good point. Sorry, forgot about that.

                                    1 2 3 Previous Next