Page 1 of 1

Uninstalling Teams

Published: June 29, 2020 - 10:29 PM
by f4242
Hi,

I added this to the uninstall() block of the Teams package. Without it, Teams doesn't uninstall from users' home directories.

Code: Select all

#désinstallation dans les home des utilisateurs
    for user_profile in local_users_profiles():
        teamsUpdater = makepath(user_profile, 'AppData', 'Local', 'Microsoft', 'Teams', 'Update.exe')
        if isfile(teamsUpdater):
            print('Desinstallation de ' + teamsUpdater)
            run_notfatal(teamsUpdater + ' --uninstall -s')
        raccourciDemarre = makepath(user_profile, 'AppData','Roaming','Microsoft','Windows','Start Menu','Programs','Microsoft Teams.lnk')
        if isfile(raccourciDemarre):
            remove_file(raccourciDemarre)
        raccourciBureau = makepath(user_profile, 'Desktop', 'Microsoft Teams.lnk')
        if isfile(raccourciBureau):
            remove_file(raccourciBureau)

Re: Uninstalling Teams

Published: June 30, 2020 - 10:03
by jpele
Hello,

We are aware of the problem; more and more software publishers are starting to install in a user environment. Currently, WAPT does not handle uninstallation in this scenario, at least not yet.

Please note that your code snippet may only work in a package development environment.

I suggest you create a separate package specifically for uninstalling Teams; the code already present in session_setup() should allow you to create this package without any issues.

Sincerely,
Jimmy

Re: Uninstalling Teams

Published: June 30, 2020 - 3:55 PM
by f4242
jpele wrote: June 30, 2020 - 10:03 Hello,

We are aware of the problem, publishers are increasingly starting to install in the user environment.
Yes, and I don't really like this trend. We have a fairly strict SRP policy, and applications installed in AppData are a real pain that forces us to compromise our software security policy... The Teams installer is one of the worst I've ever encountered.
jpele wrote: June 30, 2020 - 10:03 Warning: your code snippet may only work in a package development environment.
Indeed, I just tried requesting an uninstallation from the console and it doesn't work. It only works in PyScripter or when using WaptGet from the command line. What explains this behavior?

I also added this to the session_setup() block to launch the installation (because it doesn't seem to start automatically):

Code: Select all

installer = makepath(programfiles32, 'Teams Installer', 'Teams.exe')
run('"' + installer + '" -s')
Unfortunately, it doesn't work in production either, only in development environments or via the command line by calling wapt-get session-setup. :(

This reminds me that I attempted a Teams MSI deployment for VDI a few weeks ago (I based it on https://www.masterpackager.com/blog/mst ...windows-10 (to create my package). It worked in the development environment but no longer worked in production. Is it the same reason? I liked this approach which allowed for a global installation rather than a per-user installation in AppData.

THANKS!

Re: Uninstalling Teams

Published: June 30, 2020 - 4:07 PM
by jpele
The "ALLUSERS=1 ALLUSERS=1" flag is supposed to install Teams in System-Wide mode according to the official Microsoft documentation, but unfortunately, it only works in semi-system-wide mode. I've already spent a lot of time on the package; I'll wait for a few updates and hope that the double "ALLUSERS" flag will work in the future.

In the meantime, yes, we did install the package using the procedure mentioned, and it worked. You can find the package here: https://store.wapt.fr/store/details-tis ... ffce5.wapt

It needs to be tested to see if the procedure is still functional; I haven't retested it.

Re: Uninstalling Teams

Published: June 30, 2020 - 8:48 PM
by f4242
That's pretty much what I was doing. I just tried your package and I have the same problem; it only works from my PC. When I deploy it, the package deploys without errors, but it seems like the app isn't actually installing. I can find the installed app with `wapt-get list-registry`, but there's nothing in C:\Program Files(x86)\Microsoft\Teams (the folder doesn't exist).