locked
Uninstall an application via App-V 5.1 script RRS feed

  • Question

  • Hello,

    I have sequenced an application on 5.1 which works well in the virtual environment.  All good!

    However the previous version of the application had been deployed through SCCM for various reasons. Unfortunately for the upgraded version to work through app-v on the client machines the old version has to be uninstalled.

    Is it possible for me to do this through a pre-launch script in the new 5.1 package and if so what would be the best way of doing it.

    Thanks

    Stephen

    Tuesday, September 27, 2016 1:40 PM

Answers

  • I would use a AddPackage script.  It runs as system and only once.  Have the script first detect if the application is installed (either registry, wmi or file system ) and then uninstall it if necessary.    

    Great App-V scripting reference - http://www.tmurgent.com/TmBlog/?p=1154


    Fred Bainbridge | President, MNSCUG | Systems Consultant, Now Micro | fredbainbridge.com

    • Marked as answer by Scoop180 Thursday, September 29, 2016 9:18 AM
    Tuesday, September 27, 2016 4:34 PM

All replies

  • Since you are using CM you may want to try using Supersedence. Supersede the old application with the App-V package.  It should uninstall the old before installing the new.



    Fred Bainbridge | President, MNSCUG | Systems Consultant, Now Micro | fredbainbridge.com

    Tuesday, September 27, 2016 1:54 PM
  • I am not that familiar with SCCM and would prefer to use App-V to do this work.

    Thanks for the suggestion though.

    Tuesday, September 27, 2016 2:10 PM
  • I would use a AddPackage script.  It runs as system and only once.  Have the script first detect if the application is installed (either registry, wmi or file system ) and then uninstall it if necessary.    

    Great App-V scripting reference - http://www.tmurgent.com/TmBlog/?p=1154


    Fred Bainbridge | President, MNSCUG | Systems Consultant, Now Micro | fredbainbridge.com

    • Marked as answer by Scoop180 Thursday, September 29, 2016 9:18 AM
    Tuesday, September 27, 2016 4:34 PM
  • Use the below command to remove the existing package.

    Get-AppvClientPackage -packageid <packageid of the package from SCCM> -versionid <versionid of the package from sccm> -all | Stop-AppvClientPackage -ErrorAction SilentlyContinue | Unpublish-AppvClientPackage -ErrorAction SilentlyContinue | Remove-AppvClientPackage -ErrorAction SilentlyContinue

    If the SCCM package is published globally use this instead of the above one

    Get-AppvClientPackage -packageid <packageid of the package from SCCM> -versionid <versionid of the package from sccm> -all | Stop-AppvClientPackage -ErrorAction SilentlyContinue | Unpublish-AppvClientPackage -global -ErrorAction SilentlyContinue | Remove-AppvClientPackage -ErrorAction SilentlyContinue


    Kiranmayi

    • Proposed as answer by Roy Essers Wednesday, September 28, 2016 1:08 PM
    Tuesday, September 27, 2016 7:12 PM
  • Oh yea, that works great I would imagine.  I was thinking the previous installation was a locally installed application and not an app-v install.  :)

    Fred Bainbridge | President, MNSCUG | Systems Consultant, Now Micro | fredbainbridge.com

    Wednesday, September 28, 2016 1:54 PM
  • Hello

    Thanks for the replies.  A great help.

    Yes the previous installation is local deployed through SCCM.  We don't use SCCM to deploy our App-V packages.

    The Add Package script is probably the best option for me here.

    Thanks again

    Stephen 

    Thursday, September 29, 2016 9:20 AM