Hello,
Is there any method from inside InstallAware that I can test if my install is running under the SYSTEM account? I need to terminate one of my installs when run in this environment.
I know about the Get System Setting Logged on User Name - the problem is that the SYSTEM name is locale specific. On an English O/S it is SYSTEM, and on a French system it is SYSTÈME. Is there a way to ask "Are you SYSTEM"? Or get the Well-Known SID (S-1-5-18)?
Right now my only approach is to write a C# console exe that queries that information for me using System.Security.Principal.WindowsIdentity.GetCurrent().IsSystem and to include that in my Support files and call it from inside IA.
Is there is a simpler way to do this from inside IA?
Thanks,
Sheri
Terminate Install Under SYSTEM Account
-
- Posts: 124
- Joined: Mon Oct 22, 2012 2:14 pm
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Terminate Install Under SYSTEM Account
Dear Sheri,
I suppose that you are already using the best solution
Regards
I suppose that you are already using the best solution

Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
- Posts: 124
- Joined: Mon Oct 22, 2012 2:14 pm
Re: Terminate Install Under SYSTEM Account
Francesco,
Thanks for confirming; I just wanted to make sure I wasn't missing anything obvious.
For reference for any other users who may need to do the same thing, I created a C# console app to test this using the following mainline code:
Sheri
Thanks for confirming; I just wanted to make sure I wasn't missing anything obvious.
For reference for any other users who may need to do the same thing, I created a C# console app to test this using the following mainline code:
Code: Select all
static int Main(string[] args)
{
int result = 0;
using (var identity = System.Security.Principal.WindowsIdentity.GetCurrent())
{
if (identity.IsSystem)
{
result = 1;
}
}
Console.Write(result.ToString());
return result;
}
Sheri
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Terminate Install Under SYSTEM Account
Thanks for sharing
!
Regards

Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Who is online
Users browsing this forum: No registered users and 184 guests