-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #342 from hubblo-org/336-proper-handling-of-window…
…s-service-management WIP: proper handling of windows service lifecycle
- Loading branch information
Showing
15 changed files
with
921 additions
and
230 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# https://github.com/dansmith | ||
# | ||
$source = "scaphandre" | ||
|
||
|
||
$wid=[System.Security.Principal.WindowsIdentity]::GetCurrent() | ||
$prp=new-object System.Security.Principal.WindowsPrincipal($wid) | ||
$adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator | ||
$IsAdmin=$prp.IsInRole($adm) | ||
|
||
if($IsAdmin -eq $false) | ||
{ | ||
[System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”) | ||
[Windows.Forms.MessageBox]::Show(“Please run this as an Administrator”, | ||
“Not Administrator”, | ||
[Windows.Forms.MessageBoxButtons]::OK, | ||
[Windows.Forms.MessageBoxIcon]::Information) | ||
exit | ||
} | ||
|
||
|
||
if ([System.Diagnostics.EventLog]::SourceExists($source) -eq $false) | ||
{ | ||
[System.Diagnostics.EventLog]::CreateEventSource($source, "Application") | ||
|
||
[System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”) | ||
[Windows.Forms.MessageBox]::Show(“Event log created successfully”, | ||
“Complete”, | ||
[Windows.Forms.MessageBoxButtons]::OK, | ||
[Windows.Forms.MessageBoxIcon]::Information) | ||
} | ||
else | ||
{ | ||
[System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”) | ||
[Windows.Forms.MessageBox]::Show(“Event log already exists”, | ||
“Complete”, | ||
[Windows.Forms.MessageBoxButtons]::OK, | ||
[Windows.Forms.MessageBoxIcon]::Information) | ||
|
||
} |
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
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
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
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
Oops, something went wrong.