Skip to content

Commit

Permalink
Remove administrator check.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed May 7, 2020
1 parent c28bdcf commit 6977db8
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions Desktop.Win.Wrapper/Install.ps1
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
function Is-Administrator() {
$Identity = [Security.Principal.WindowsIdentity]::GetCurrent()
$Principal = New-Object System.Security.Principal.WindowsPrincipal -ArgumentList $Identity
return $Principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
}

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 -bor [System.Net.SecurityProtocolType]::Tls13
[System.IO.Directory]::CreateDirectory("$env:AppData\Remotely")
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile "$env:AppData\Remotely\dotnet-install.ps1" -UseBasicParsing
&"$env:AppData\Remotely\dotnet-install.ps1" -Runtime dotnet
&"$env:AppData\Remotely\dotnet-install.ps1" -Runtime windowsdesktop
if (Is-Administrator) {
Start-Process -FilePath "dotnet.exe" -ArgumentList "$PSScriptRoot\Remotely_Desktop.dll" -WindowStyle Hidden -Verb RunAs
}
else {
Start-Process -FilePath "dotnet.exe" -ArgumentList "$PSScriptRoot\Remotely_Desktop.dll" -WindowStyle Hidden
}
Start-Process -FilePath "dotnet.exe" -ArgumentList "$PSScriptRoot\Remotely_Desktop.dll" -WindowStyle Hidden -Verb RunAs

0 comments on commit 6977db8

Please sign in to comment.