Beispielskripte für die Bereitstellung auf mehreren Computern
Im Folgenden finden Sie eine Sammlung von Skripten, die für IT-Administratoren bei der Verwaltung der GoTo-App nützlich sein können. Diese Beispielskripte erleichtern Aufgaben, die nicht automatisch durch Installationsprogramme, Gruppenrichtlinien oder auf andere Weise ausgeführt werden. IT-Administratoren können sie manuell in ihre Skripte integrieren, wenn sie diese Aufgaben ausführen müssen.
GoTo-App pro Benutzer deinstallieren (Windows)
Dieses Skript kann verwendet werden, um die GoTo-App für den aktuellen Benutzer zu deinstallieren. Sie funktioniert nur bei Installationen pro Benutzer. Sie sollte aus dem Benutzerkontext für jedes Benutzerprofil ausgeführt werden, für das die Anwendung deinstalliert werden muss.
<#
.SYNOPSIS
This script checks if the GoTo app is installed for the current user and, if so, uninstalls it silently.
.DESCRIPTION
The script checks if the app is running and stops it if so.
It then reads the uninstall command line from the "QuietUninstallString" entry under the "Uninstall" key
for the GoTo app and executes it.
#>
$ErrorActionPreference = "Stop"
Function Stop-App {
Param (
[Parameter(Mandatory)][String]$AppName
)
# Close the app, if running.
$AppProcesses = Get-Process -Name $AppName -ErrorAction SilentlyContinue
if ($AppProcesses) {
Write-Host "Stopping $AppName app..."
Stop-Process -Name $AppName -Force
# Wait a bit
Start-Sleep -Seconds 5
} else {
Write-Host "$AppName app is not running"
}
# Check that the app is not still running
$AppProcesses = Get-Process -Name $AppName -ErrorAction SilentlyContinue
if ($AppProcesses) {
Write-Host "$AppName app is still running, aborting"
Exit 1
}
}
# Make sure the GoTo app is not running
Stop-App -AppName GoTo
# Read the QuietUninstallString
try {
$UninstStr = Get-ItemPropertyValue -LiteralPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\b5746384-3503-4fbf-824a-0a42d1bd0639" -Name "QuietUninstallString"
} catch {
$UninstStr = $null
}
if ($UninstStr) {
# Optionally, preserve the user profile
# $UninstStr = "$UninstStr --KeepProfile"
Write-Host "Found GoTo app installed, uninstalling using command: $UninstStr"
# Uninstall app
$Process = Start-Process -FilePath "$Env:ComSpec" -ArgumentList "/c $UninstStr" -PassThru
$Process.WaitForExit()
Write-Host "Done"
} else {
Write-Host "GoTo app is not installed"
}
Benutzerprofile bereinigen (Windows und Mac)
Dieses Skript kann verwendet werden, um das von der GoTo-App verwendete Benutzerprofil zu bereinigen, nachdem die Anwendung deinstalliert wurde. Die zu bereinigenden Benutzerprofilelemente sind dieselben, unabhängig davon, ob die GoTo-App pro Rechner oder pro Benutzer installiert wurde, aber normalerweise ist dieses Skript nützlich, um nach der Deinstallation pro Rechner aufzuräumen. Das liegt daran, dass bei der MSI-Deinstallation für die Installation pro Maschine die Benutzerprofile nicht bereinigt werden, während bei der Deinstallation pro Benutzer das Benutzerprofil als Teil der Deinstallation bereinigt wird.
Das Skript sollte aus dem Benutzerkontext für jeden Benutzer ausgeführt werden, für den das Profil bereinigt werden muss.
Windows
REM Delete the app registry key
REG DELETE HKEY_CURRENT_USER\Software\LogMeInInc\GoTo /f
REM Delete the auto-start setting
REG DELETE HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v GoTo /f
REM Delete the app data folder
RMDIR /S /Q "%APPDATA%\GoTo"
Mac
# Delete the plist
rm -f ~/Library/Preferences/com.logmein.goto.plist
# Delete the app data folder
rm -rf ~/Library/Application\ Support/GoTo
Autostart-Einstellung in der Registrierung festlegen oder entfernen (Windows)
Diese Skripte können verwendet werden, um die Autostart-Registrierungseinstellung zu setzen oder zu entfernen, mit der die GoTo-App automatisch gestartet wird, wenn sich der Benutzer anmeldet. Das Skript funktioniert sowohl für die Installation von Anwendungen pro Rechner als auch pro Benutzer, aber die Autostart-Registrierungseinstellung selbst befindet sich in der Benutzerregistrierung(HKCU).
Das Skript sollte aus dem Benutzerkontext für jedes Benutzerprofil ausgeführt werden, für das die Autostarteinstellung gesetzt oder entfernt werden muss.
So legen Sie die Autostart-Registrierungseinstellung fest:
<#
.SYNOPSIS
This script sets the auto-start registry setting used to automatically start the GoTo app when the user
logs in.
.DESCRIPTION
The script checks the installation folder of the app, in both HKLM and HKCU (it works for both per-machine
and per-user app installations). It then sets a "GoTo" entry under the "Run" key for the current user.
#>
$ErrorActionPreference = "Stop"
# Read the InstallLocation. Try both HKLM and HKCU
try {
$instLoc = Get-ItemPropertyValue -LiteralPath "HKLM:\Software\LogMeInInc\GoTo\ElectronInstallDetails" -Name "InstallLocation"
} catch {
try {
$instLoc = Get-ItemPropertyValue -LiteralPath "HKCU:\Software\LogMeInInc\GoTo\ElectronInstallDetails" -Name "InstallLocation"
} catch {
$instLoc = $null
}
}
if ($instLoc -ne $null) {
Write-Host "Found GoTo app installed at: $instLoc"
# Set the auto-start registry setting
$regValue = Join-Path -Path $instLoc -ChildPath "GoTo.exe" -Resolve
Write-Host "Setting auto-start registry setting to value: $regValue"
Set-ItemProperty -LiteralPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "GoTo" -Value $regValue -Type String
Write-Host "Done"
} else {
Write-Host "GoTo app is not installed"
}
So entfernen Sie die Autostart-Registrierungseinstellung:
REM Delete the auto-start setting
REG DELETE HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v GoTo /f