Changes

Microsoft Teams

9,579 bytes added, 17 October
no edit summary
 == Microsoft Teams Bootstrapper system-wide bulk installer ==There is a new method for installed the "new" Microsoft Teams. It is described at[https://learn.microsoft.com/en-us/microsoftteams/new-teams-bulk-install-client https://learn.microsoft.com/en-us/microsoftteams/new-teams-bulk-install-client]. There are multiple parts to this installer. The first is a bash script that downloads the current available files and checks them against the version number downloaded previously. If it is the same it does nothing but if it is newer it updates the wpkg installer script with the new version number. Then wpkg has to execute a batch file that is using powershell to check if the teams appx file is installed. For this to work you will need to adjust your powershell execution policy to allow locally run powershell scripts. Sorry for the convoluted process here but I couldn't immediately think of a better approach to this problem. There is no way to do a normal uninstall check for the appx files so the batch and powershell files are being executed and passing exit codes through the chain of scripts back to wpkg. == WPKG microsoft-teams.xml ==<source lang="xml"><?xml version="1.0" encoding="UTF-8"?> <!-- Thie file generated from tools\update-microsoft-teams.sh and template_microsoft-teams.xml Manual edits to packages\microsoft-teams.xml will be overwritten. --> <packages:packages xmlns:packages="http://www.wpkg.org/packages" xmlns:wpkg="http://www.wpkg.org/wpkg" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wpkg.org/packages ../xsd/packages.xsd" ><package id="microsoft-teams" name="Microsoft Teams" revision="%PKG_VERSION%" reboot="false">  <variable name="PKG_VERSION" value="24257.205.3165.2029" />  <check type="execute" path="%SOFTWARE%\batch_files\check-appx-teams.bat" condition="exitcodeequalto" value="1" />  <install cmd='"%SOFTWARE%\microsoft-teams\teamsbootstrapper.exe" -p -o "%SOFTWARE%\microsoft-teams\MSTeams-x64.msix"' />  <upgrade include='install' />  <remove cmd='"%SOFTWARE%\microsoft-teams\teamsbootstrapper.exe" -x' /> </package></packages:packages></source> == Automated update script == Here is the script that you use to update the installer packages. You'll need to adjust the paths to match your environment. It works for me but your mileage may vary. === update-microsoft-teams-xml.sh === Just to get an idea how this can be done using bash scripting if your wpkg share is on linux using samba, here is my script which checks if there is a newer version of google chrome. Only then it copies the exe and msix files and creates new xml file from template. It substitutes the __VERSION__ and __MSIKEY__ strings, which are extracted from the msi file. Seems like a quick hack to get the strings out of the MSI file, at least it works at the moment. <source lang='bash'>#!/bin/bash  # source: #  MAINPATH=path-to-wpkgTMPPATH=$MAINPATH/tempDESTPATH=$MAINPATH/installers/microsoft-teamsTEMPLATE=$MAINPATH/packages/Templates/template_microsoft-teams.xmlFILENAME=microsoft-teams.xmlTEMPFILE=$TMPPATH/$FILENAMEDESTFILE=$MAINPATH/packages/$FILENAME teams_msix_routine () {DLFILE=$1DLSOURCE=$2$DLFILE.msix cd $TMPPATHif [ -f $DLFILE.msix ]; then rm $DLFILE.msix fi /usr/bin/wget --no-check-certificate $DLSOURCE RAWSTRINGS=`/usr/bin/unzip -p $DLFILE.msix AppxManifest.xml | /usr/bin/strings | /usr/bin/grep -s -o -E Version=\"[[:digit:]]{5}\.[[:digit:]]{3}\.[[:digit:]]{4}\.[[:digit:]]{4}\" | tr -d 'Version=' | tr -d '"' \` echo msix version is $RAWSTRINGS for k in ${RAWSTRINGS} ; do unset SUBSTRING; SUBSTRING=`expr match "$k" '\([[:digit:].]\{19\}\)' ` if [ -n "${SUBSTRING}" ] ; then MSTVERSION="$SUBSTRING"; break fidone echo Version: $MSTVERSION  if [ -z "$MSTVERSION" ] ; then echo no version found exit 2 fi# create xml file from template  sed -e "s/__VERSION__/${MSTVERSION}/" <$TEMPLATE | sed -e "s/__VERSION__/${MSTVERSION}/" >$TEMPFILE diff -wB $TEMPLATE $TEMPFILE >/dev/null if [ $? -eq 0 ] ; then # version not changed echo string error exit 1fi diff -wB $TEMPFILE $DESTFILE >/dev/null if [ $? -eq 0 ] ; then # no difference echo not newer rm $DLFILE.msix exit 0fi  echo copying files mv $DLFILE.msix $DESTPATH/$DLFILE.msixcp $TEMPFILE $DESTFILE} teamsbootstrapper_routine () {DLFILE=$1DLSOURCE=$2$DLFILE.exe cd $TMPPATHif [ -f $DLFILE.exe ]; then rm $DLFILE.exe fi /usr/bin/wget --no-check-certificate $DLSOURCE RAWSTRINGS=`/usr/bin/7z l $DLFILE.exe | /usr/bin/strings | /usr/bin/grep -x "^FileVersion:.*$" | tr "\n" " " `echo Bootstrapper version is $RAWSTRINGS for k in ${RAWSTRINGS} ; do unset SUBSTRING; SUBSTRING=`expr match "$k" '\([[:digit:].]\{11\}\)' ` if [ -n "${SUBSTRING}" ] ; then TBSVERSION="$SUBSTRING"; break fidone echo Version: $TBSVERSION  if [ -z "$TBSVERSION" ] ; then echo no version found exit 2 fi  echo copying $DLFILE.exe to $DESTPATH/$DLFILE.exe mv $DLFILE.exe $DESTPATH/$DLFILE.exe} teamsbootstrapper_routine "teamsbootstrapper" "https://statics.teams.cdn.office.net/production-teamsprovision/lkg/"teams_msix_routine "MSTeams-x64" "https://statics.teams.cdn.office.net/production-windows-x64/enterprise/webview2/lkg/"</source> == Template file == This template file is stored under packages/Templates/template_microsoft-teams.xml and is used to update the packages/microsoft-teams.xml file. <source lang="xml"><?xml version="1.0" encoding="UTF-8"?><!-- Thie file generated from tools\update-microsoft-teams.sh and template_microsoft-teams.xml Manual edits to packages\microsoft-teams.xml will be overwritten. --><packages:packages xmlns:packages="http://www.wpkg.org/packages" xmlns:wpkg="http://www.wpkg.org/wpkg" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wpkg.org/packages ../xsd/packages.xsd" ><package id="microsoft-teams" name="Microsoft Teams" revision="%PKG_VERSION%" reboot="false">  <variable name="PKG_VERSION" value="__VERSION__" />  <check type="execute" path="%SOFTWARE%\batch_files\check-appx-teams.bat" condition="exitcodeequalto" value="1" />  <install cmd='"%SOFTWARE%\microsoft-teams\teamsbootstrapper.exe" -p -o "%SOFTWARE%\microsoft-teams\MSTeams-x64.msix"' />  <upgrade include='install' />  <remove cmd='"%SOFTWARE%\microsoft-teams\teamsbootstrapper.exe" -x' /> </package></packages:packages></source> == Batch ==This file is exectuted by wpkg and if it returns '1' the package is installed and if it returns '0' it isn't. I've saved this file as "installers/batch_files/check-appx-teams.bat" === Script ===<source lang="batch">%COMSPEC% /c copy /y "%SOFTWARE%\powershell\check-appx-teams.ps1" "C:\Windows\Temp\check-appx-teams.ps1"%COMSPEC% /c powershell -File "C:\Windows\Temp\check-appx-teams.ps1"exit /b %ERRORLEVEL%</source> == Powershell ==This powershell script is copied to the local machine then executed. I've saved it as 'installers/powershell/check-appx-teams.ps1'. You need to set your system's powershell execution policy to allow this to run. === Script ===<source lang="ps1">if ((Get-AppPackage -AllUsers).Name -like "*MSTeams*") {$ECODE=1} else {$ECODE=0}exit $ECODE</source> == Microsoft Teams - older version of installer procedure ==
This is a silent installer for the teams all users installer.
15
edits