-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "b2s tools should not allow to be run as admin #75"
This reverts commit bfd7f4d.
- Loading branch information
1 parent
107a1f9
commit 6f13aef
Showing
3 changed files
with
1 addition
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
b2s_screenresidentifier/b2s_screenresidentifier/B2S_ScreenResIdentifier.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,13 @@ | ||
Imports System | ||
Imports System.Drawing | ||
Imports System.IO | ||
Imports System.Security.Principal | ||
Imports System.Windows.Forms | ||
Imports Microsoft.Win32 | ||
Imports MessageBox = System.Windows.MessageBox | ||
|
||
Module B2S_ScreenResIdentifier | ||
Sub Main() | ||
If IsAdmin() Then | ||
MessageBox.Show("You should not start this as Administrator!", My.Resources.AppTitle, MessageBoxButtons.OK, MessageBoxIcon.Stop) | ||
Exit Sub | ||
End If | ||
|
||
Application.EnableVisualStyles() | ||
Application.SetCompatibleTextRenderingDefault(False) | ||
Application.Run(New formPlayfield()) | ||
End Sub | ||
Private Function IsAdmin() As Boolean | ||
Dim identity As WindowsIdentity = WindowsIdentity.GetCurrent() | ||
Dim principal As New WindowsPrincipal(identity) | ||
Return principal.IsInRole(WindowsBuiltInRole.Administrator) | ||
End Function | ||
End Module |
10 changes: 0 additions & 10 deletions
10
b2sbackglassserverexe/b2sbackglassserverexe/Classes/B2SBackglassServerEXE.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,13 @@ | ||
Imports System | ||
Imports System.Drawing | ||
Imports System.IO | ||
Imports System.Security.Principal | ||
Imports System.Windows.Forms | ||
Imports Microsoft.Win32 | ||
|
||
Module B2SBackglassServerEXE | ||
Sub Main() | ||
If IsAdmin() Then | ||
MessageBox.Show("You should not start this as Administrator!", My.Resources.AppTitle, MessageBoxButtons.OK, MessageBoxIcon.Stop) | ||
Exit Sub | ||
End If | ||
Application.EnableVisualStyles() | ||
Application.SetCompatibleTextRenderingDefault(False) | ||
Application.Run(New formBackglass()) | ||
End Sub | ||
Private Function IsAdmin() As Boolean | ||
Dim identity As WindowsIdentity = WindowsIdentity.GetCurrent() | ||
Dim principal As New WindowsPrincipal(identity) | ||
Return principal.IsInRole(WindowsBuiltInRole.Administrator) | ||
End Function | ||
End Module |