Worklet to first Uninstall Microsoft Office 2019 then install MS Office 2021
Hi,
I tried to use the PS script to directly install MS Office 2021 to the client machine that is currently having the MS Office 2019. I’m getting the error message saying “ You have to uninstall MS Office 2019 ….”
I’m not sure if possible, but I’m looking for the worklet with script that first to Uninstall Microsoft Office 2019 Pro then install MS Office 2021 Plus after that...
Please help if any one got this procedure done successfully.
Can you share your XML file if it works for you? Thanks!
Sure thing, we’re running office 2019 I haven’t built a deployment for 2021 yet, let me work on that in a test environment and I’ll let you know how it goes
Thank you, pls keep me posted.
Ahh..sorry I compleatly misread your post…
The <RemoveMSI /> is for msi installs of office but office 2019 is C2R
so what I did was pass the Remove all in the configuration file and it worked, it uninstalled office 2019 and installed 2021
It also removed Project plus and visio so if you have those instaleld in your environment don’t forget to add them to your configuration.xml file.
I noticed, if you have MSOffice 2021 installed after remove the 2019, and schedule to run the policy frequently, then anytime the policy runs, it will automatically close the app w/t saving work while the end user having it open. I would think about we should have the validation check: When run the policy, it would check if the client machine already has MSOffice 2021 installed, then skip it. If not, then install…
I don’t have any source to come up with the script, but found in the root dir, there’s a txt file that I can use for the validation. Just want to share, but if you have any better script, pls share as well.
worklet
Evaluation Code:
# Check if txt file there, then skip if (Get-Item -Path "C:\Program Files\Microsoft Office\root\Office16\1033\ClientLangPack2021_eula.txt") {