Skip to content

Commit

Permalink
Changed Install/Uninstall process
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Mohrmann authored and Dennis Mohrmann committed Mar 26, 2021
1 parent 1bf5f65 commit 3f32f8d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 9 additions & 5 deletions Install MS Teams-Preview.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ $Teams = (Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentV
IF ($Teams) {$Teams.Insert(5,'0')}
IF ($Teams -ne $Version) {

# Uninstalling MS Teams
#Uninstalling MS Teams
IF (Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where DisplayName -like "*Teams Machine*") {
Write-Host -ForegroundColor Yellow "Uninstalling $Product"
DS_WriteLog "I" "Uninstalling $Product" $LogFile
Expand All @@ -111,7 +111,7 @@ Write-Host -ForegroundColor Green " ...ready!"
Write-Output ""
}

# MS Teams Installation
#MS Teams Installation
Write-Host -ForegroundColor Yellow "Installing $Product"
DS_WriteLog "I" "Installing $Product" $LogFile
try {
Expand All @@ -121,12 +121,12 @@ DS_WriteLog "E" "Error installing $Product (error: $($Error[0]))" $LogFile
}
DS_WriteLog "-" "" $LogFile

# Configure Teams Settings with json template
copy-item -Path "$PSScriptRoot\$Product\desktop-config.json" -Destination "C:\USers\Default\AppData\Roaming\Microsoft\Teams"

# Prevents MS Teams from starting at logon
Start-Sleep 5
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run" -Name "Teams" -Force
Write-Host -ForegroundColor Green " ...ready!"
Write-Output ""
}

# Register Teams add-in for Outlook - https://microsoftteams.uservoice.com/forums/555103-public/suggestions/38846044-fix-the-teams-meeting-addin-for-outlook
$appDLLs = (Get-ChildItem -Path "${env:ProgramFiles(x86)}\Microsoft\TeamsMeetingAddin" -Include "Microsoft.Teams.AddinLoader.dll" -Recurse).FullName
Expand All @@ -147,6 +147,10 @@ New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\IM Providers\Teams" -Name "GU
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\IM Providers\Teams" -Name "ProcessName" -Type "String" -Value "Teams.exe"
) | Out-Null

Write-Host -ForegroundColor Green " ...ready!"
Write-Output ""
}

# Stop, if no new version is available
Else {
Write-Host "No Update available for $Product"
Expand Down
14 changes: 9 additions & 5 deletions Install MS Teams.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ $Teams = (Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentV
IF ($Teams) {$Teams.Insert(5,'0')}
IF ($Teams -ne $Version) {

# Uninstalling MS Teams
#Uninstalling MS Teams
IF (Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where DisplayName -like "*Teams Machine*") {
Write-Host -ForegroundColor Yellow "Uninstalling $Product"
DS_WriteLog "I" "Uninstalling $Product" $LogFile
Expand All @@ -111,7 +111,7 @@ Write-Host -ForegroundColor Green " ...ready!"
Write-Output ""
}

# MS Teams Installation
#MS Teams Installation
Write-Host -ForegroundColor Yellow "Installing $Product"
DS_WriteLog "I" "Installing $Product" $LogFile
try {
Expand All @@ -121,12 +121,12 @@ DS_WriteLog "E" "Error installing $Product (error: $($Error[0]))" $LogFile
}
DS_WriteLog "-" "" $LogFile

# Configure Teams Settings with json template
copy-item -Path "$PSScriptRoot\$Product\desktop-config.json" -Destination "C:\USers\Default\AppData\Roaming\Microsoft\Teams"

# Prevents MS Teams from starting at logon
Start-Sleep 5
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run" -Name "Teams" -Force
Write-Host -ForegroundColor Green " ...ready!"
Write-Output ""
}

# Register Teams add-in for Outlook - https://microsoftteams.uservoice.com/forums/555103-public/suggestions/38846044-fix-the-teams-meeting-addin-for-outlook
$appDLLs = (Get-ChildItem -Path "${env:ProgramFiles(x86)}\Microsoft\TeamsMeetingAddin" -Include "Microsoft.Teams.AddinLoader.dll" -Recurse).FullName
Expand All @@ -147,6 +147,10 @@ New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\IM Providers\Teams" -Name "GU
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\IM Providers\Teams" -Name "ProcessName" -Type "String" -Value "Teams.exe"
) | Out-Null

Write-Host -ForegroundColor Green " ...ready!"
Write-Output ""
}

# Stop, if no new version is available
Else {
Write-Host "No Update available for $Product"
Expand Down

0 comments on commit 3f32f8d

Please sign in to comment.