6 Replies Latest reply on Sep 7, 2011 8:42 AM by jpozucek

    Uninstall Old Version Prior To New Installation

    jpozucek Apprentice

      I am trying to build a distribution package for a new version of Yammer.air.  In order to install the new verson the old version needs to be uninstalled first.  Is there a way for LANDesk to detect if the package is installed, uninstall it if detected and then install the new version?  Also, if not detected just install the new version.

       

      The uninstall string is:

       

      msiexec /qb /x {453FA2E8-835A-B2B6-F40C-E7B3E46CF755}

       

      The installation string is:

       

      AdobeAIRInstaller.exe -silent -eulaAccepted -programMenu yammer.air

       

      Thanks

        • 1. Re: Uninstall Old Version Prior To New Installation
          mrspike SSMMVPGroup

          Do you have "Patch Manager" and if so, what version of LANDesk are you using?

           

          Custom Defintions are the best way to do this.

          • 2. Re: Uninstall Old Version Prior To New Installation
            jpozucek Apprentice

            Yes I do.  LANDesk 9.0 SP2

            • 3. Re: Uninstall Old Version Prior To New Installation
              rictersmith Specialist

              Custom Defs are best.

               

              In my experience, if you run msiexec /qb /x {453FA2E8-835A-B2B6-F40C-E7B3E46CF755} and the app is not there, then it really does nothing.

               

              In hard to detect cases, we have just run the uninstall command line and then waited for msiexec to finish and then perform the install command line.

              • 4. Re: Uninstall Old Version Prior To New Installation
                mrspike SSMMVPGroup

                Jimmy,

                 

                See this... the Creating Custom Defintions still applies in 9.x

                 

                http://community.landesk.com/support/docs/DOC-6041

                 

                Find something in the registry or a file on the harddrive (that has a version) that you and use to detect the old version

                 

                 

                If you point to a file location on the hard drive, try not to "hard code" the location with c:\program files...  c:\windows, etc, but use variables or requery

                 

                %programfiles%\foldername\filename.exe or %programfiles(x86)\foldername\filename.exe

                 

                or %windir% etc

                 

                 

                If you have questions, post back the file name and path or reg area and we can help.

                 

                 

                Use the "patch" section to install your file

                1 of 1 people found this helpful
                • 5. Re: Uninstall Old Version Prior To New Installation
                  jpozucek Apprentice

                  Thanks for the info James,

                   

                  There are registy settings I can use that hold version info.  I'll read through the doc's and post back with any questions.

                  • 6. Re: Uninstall Old Version Prior To New Installation
                    jpozucek Apprentice

                    Thanks for the information all:

                     

                    The way I resolved it was to add the uninstall string in the registy as a scannable inventory item under Custom Data.  I then created a batch distribution package that passes this value to the batch file which checks to see if the package is installed.  If it is, the old package is uninstalled using the passed variable (%1) and then the new version is installed, else the new version is just installed.

                     

                    Here is my batch file so far.  It works but I still need to tweek it a bit, especially the error handling.

                     

                    echo on

                    IF Exist "c:\program files (x86)\yammer\yammer.exe" (
                    cmd /c TASKKILL /F /IM yammer.exe
                    cmd /c %1
                    AdobeAIRInstaller.exe -silent -eulaAccepted -programMenu yammer.air

                    Exit /B 0
                    ) Else (
                    AdobeAIRINstaller.exe -silent -eulaAccepted -programMenu yammer.air Exit /B 0
                    )

                     

                    The only drawback is that this only seems to work for a Push Distribution, if I try to use a Policy and install via the Desktop Manager the variable does not pass at run time.

                     

                    Any suggestions would be welcome.

                     

                    Jimmy