cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dinesh_redhawk
Level 6

How to use Privileged property in Installshield - Suite Installer

Hello Guys,

Can somebody provide a code snippet where it shows how to use "Privileged" property. What value needs to be checked and all?

Currently i am using SuiteGetProperty("Privileged", szAdmin);
Its returning me " "

I dont know how to use this property but i know that this is the property i need to use.

Please help.

thanks
Labels (1)
0 Kudos

(5) Replies
MarkusLatz
Level 8

With SuiteGetProperty you can retrieve "suite properties".

But the "Privileged"-Property I know is a Windows Installer property.

We have to know from where you want to retrieve that value.

i.e. if you are inside an MSI you can just use the property.

regards

Markus
0 Kudos
dinesh_redhawk
Level 6

MarkusLatz wrote:
With SuiteGetProperty you can retrieve "suite properties".

But the "Privileged"-Property I know is a Windows Installer property.

We have to know from where you want to retrieve that value.

i.e. if you are inside an MSI you can just use the property.

regards

Markus


Thanks markus, I want to use this property in Suite installer. Can I do this? Or any alternative is there?
0 Kudos
MarkusLatz
Level 8

Privileged is like AdminUser so you could also create an InstallScript action and call: Is(USER_ADMINISTRATOR,"") and set the result to a suite property.
0 Kudos
dinesh_redhawk
Level 6

MarkusLatz wrote:
Privileged is like AdminUser so you could also create an InstallScript action and call: Is(USER_ADMINISTRATOR,"") and set the result to a suite property.


Is(USER_ADMINISTRATOR,"") anyways i am using but its not full proof, as i found and also read in lot of forums that its not capable of finding full admin privileges as compared to Privileged property. Privileged property is the ultimate property for knowing that you have all the privileges or not.
0 Kudos
MarkusLatz
Level 8

What I know is from here:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa370852(v=vs.85).aspx

If setting the "Required execution level" to "Administrator" is also not sufficient you can write a custom dll in C/C++ or .NET. There you have access to all APIs from Microsoft ....

What I sometimes use:

public static bool checkElevatedPrivilege() {

WindowsIdentity winIdentity = WindowsIdentity.GetCurrent();
WindowsPrincipal winPrincipal = new WindowsPrincipal(winIdentity);

return winPrincipal.IsInRole(WindowsBuiltInRole.Administrator);

} /* end method */


regards

Markus
0 Kudos