Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
Added another Popup
Browse files Browse the repository at this point in the history
Added popup to notify if not running as admin
  • Loading branch information
pplude committed Sep 8, 2015
1 parent d6e9e18 commit 95208a8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Core.ps1
Expand Up @@ -56,9 +56,7 @@ $SafeMode = (Get-WmiObject Win32_ComputerSystem | Select-Object BootupState | fo
# This will test to see if the user is admin, and terminate the script if it fails the user rights check
If (!([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Write-Host "User is not running as administrator. `n `n Please run this script through an Administrative Powershell. `n"
Write-Host "Press any key to continue..."
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
[System.Windows.Forms.MessageBox]::Show("User is not running as administrator. `n `n Please run this script through an Administrative Powershell.", "ERROR") | Out-Null
[Environment]::Exit(6)
}

Expand Down Expand Up @@ -115,7 +113,7 @@ If ($SafeMode -eq "Normal Boot")

If ($SafeMode -eq "Fail-safe boot")
{
[System.Windows.Forms.MessageBox]::Show("The system is in Safe Mode without Network support. Tron:Evo does not function in this mode. Please boot into Windows normally or using the Safe Mode with Networking option." , "WARNING") | Out-Null
[System.Windows.Forms.MessageBox]::Show("The system is in Safe Mode without Network support. Tron:Evo does not function in this mode. Please boot into Windows normally or using the Safe Mode with Networking option." , "ERROR") | Out-Null
[Environment]::Exit(4)
}

Expand Down

0 comments on commit 95208a8

Please sign in to comment.