Skip to content

Commit

Permalink
Merge pull request #7 from Mogeko/dev
Browse files Browse the repository at this point in the history
Update(bug): Fix crash in splash screen
  • Loading branch information
mogeko authored Apr 21, 2020
2 parents e5f009e + 21849c2 commit f5ad68e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions run.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# 强制以管理员权限以运行
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$testadmin = $currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
if ($testadmin -eq $false) {
Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition))
exit $LASTEXITCODE
}

$script:LICENCE = @"
Expand Down

0 comments on commit f5ad68e

Please sign in to comment.