Skip to content

Commit 90b9047

Browse files
Bug Fix
Fixed version detection bug, renamed file to remove version number
1 parent d3cb566 commit 90b9047

File tree

2 files changed

+37
-19
lines changed

2 files changed

+37
-19
lines changed

WebRTC Auto Updater/Detect - WebRTC - Detection Script - 0.2.3.ps1 renamed to WebRTC Auto Updater/Detect - WebRTC - Detection Script.ps1

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT
44
See LICENSE in the project root for license information.
55
#>
66

7-
# Version 0.2.3
7+
# Version 0.3.1
88
#
99
#####################################
1010

@@ -17,8 +17,7 @@ Param(
1717
function get-CurrentRTCver {
1818

1919
$response = (Invoke-WebRequest -Uri "https://aka.ms/msrdcwebrtcsvc/msi" -UseBasicParsing)
20-
$response.headers.'Content-Disposition'
21-
$versionC = $response.Headers.'Content-Disposition' -replace ".*HostSetup_", "" -replace ".x64.msi*", ""
20+
$versionC = $response.BaseResponse.ResponseUri.AbsolutePath -replace ".*HostSetup_", "" -replace ".x64.msi*", ""
2221
$string = "The latest available version of the WebRTC client is " + $versionC
2322
update-log -Data $string -Class Information -output both
2423
$global:currentversion = $versionC
@@ -85,11 +84,24 @@ function get-teamsinstall {
8584
}
8685

8786
if ($count -eq '0') {
88-
update-log -data "Teams install not found. User may not have logged into machine yet. Returning Compliant" -Class Information -Output Both
89-
Exit 0
87+
update-log -data "Classic Teams install not found. Checking for New Teams." -Class Information -Output Both
88+
#Exit 0
89+
$appxpacks = Get-ChildItem 'C:\Program Files\WindowsApps'
90+
91+
foreach ($appxpack in $appxpacks){
92+
if ($appxpack -match "MSTeams"){$count = $count + 1}
93+
}
94+
if ($count -eq 0){
95+
update-log -data "New Teams not found. Teams is not installed. Returning compliant." -Class Information -Output Both
96+
Exit 0
97+
}
98+
else{
99+
update-log -data "New Teams installation has been found" -Class Information -Output Both
100+
}
101+
90102
}
91103
else {
92-
update-log -data "Teams install found." -Class Information -Output Both
104+
update-log -data "Old Teams install found." -Class Information -Output Both
93105
}
94106
}
95107

@@ -136,3 +148,10 @@ if ($RTCInstalled -eq $RTCCurrent) {
136148
update-log -Data "The WebRTC client is current. Returning Compliant" -Class Information -output both
137149
Exit 0
138150
}
151+
152+
153+
#$appxpacks = Get-ChildItem 'C:\Program Files\WindowsApps'
154+
155+
#foreach ($appxpack in $appxpacks){
156+
# if ($appxpack -match "MSTeams"){write-host $appxpack}
157+
#}

WebRTC Auto Updater/Remediate - WebRTC - Remediation Script - 0.2.8.ps1 renamed to WebRTC Auto Updater/Remediate - WebRTC - Remediation Script.ps1

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ See LICENSE in the project root for license information.
55
#>
66

77

8-
# Version 0.2.8
8+
# Version 0.3.1
99

1010
#####################################
1111

@@ -63,20 +63,20 @@ function get-userstate {
6363
#function to perform the upgrading
6464
function invoke-remediation {
6565
$folders = Get-ChildItem -Path C:\users -Directory -force -ErrorAction SilentlyContinue | select fullname, name
66-
$TeamsReg = "HKCU:\Software\Microsoft\Office\Teams"
67-
$TeamRegExist = test-path -path $TeamsReg
66+
#$TeamsReg = "HKCU:\Software\Microsoft\Office\Teams"
67+
#$TeamRegExist = test-path -path $TeamsReg
6868
$RTCCurrent = get-CurrentRTCver
6969
$global:currentversion
7070
$RTCInstalled = get-installedRTCver
7171
try {
72-
if ($TeamRegExist -eq $True) {
73-
$PreventInstallStateKey = Get-Item -Path $TeamsReg
74-
$preventInstall = $PreventInstallStateKey.GetValue("PreventInstallationFromMsi")
75-
if ($preventInstall -ne $null) {
76-
update-log -data "Removing PreventInstallationFromMsi reg key" -Class Information -output both
77-
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Office\Teams" -Name "PreventInstallationFromMsi"
78-
}
79-
}
72+
#if ($TeamRegExist -eq $True) {
73+
# $PreventInstallStateKey = Get-Item -Path $TeamsReg
74+
# $preventInstall = $PreventInstallStateKey.GetValue("PreventInstallationFromMsi")
75+
# if ($preventInstall -ne $null) {
76+
# update-log -data "Removing PreventInstallationFromMsi reg key" -Class Information -output both
77+
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Office\Teams" -Name "PreventInstallationFromMsi"
78+
# }
79+
#}
8080

8181
#Create a directory to save download files
8282
$tempCreated = $false
@@ -202,8 +202,7 @@ function invoke-disctimer {
202202
#function to query the latest available version number of WebRTC client
203203
function get-CurrentRTCver {
204204
$response = (Invoke-WebRequest -Uri "https://aka.ms/msrdcwebrtcsvc/msi" -UseBasicParsing)
205-
$response.headers.'Content-Disposition'
206-
$versionC = $response.Headers.'Content-Disposition' -replace ".*HostSetup_", "" -replace ".x64.msi*", ""
205+
$versionC = $response.BaseResponse.ResponseUri.AbsolutePath -replace ".*HostSetup_", "" -replace ".x64.msi*", ""
207206
$string = "The latest available version of the WebRTC client is " + $versionC
208207
update-log -Data $string -Class Information -output both
209208
$global:currentversion = $versionC

0 commit comments

Comments
 (0)