cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jrokicki
Level 4

verifying windows credentials via C DLL

Hi folks,

In a previous installer, we have code that calls a Windows DLL to verify user credentials. The LibraryLoader class is utilized to do so.

I can't seem to find an equivalent method for doing this.

Generically I see this as calling a Windows DLL from a custom action.

What would be a solution to this problem, either specifically or generically?

Thanks!

- john
Labels (1)
0 Kudos
(6) Replies
pv7721
Level 20

There used to be an IsUserAdmin plugin, but it's been a while since it has been discontinued and thus removed from the list of downloadable files & utilities. I'm afraid I don't understand though why exactly the previous method you used no longer works. Nevertheless, there is a method in the IA API that allows you to check if the user that has launched the installer is Windows admin or not (it's in an API that has been inherited from InstallShield, actually).
0 Kudos
jrokicki
Level 4

The problem is not if the current user is an admin or not. The problem to solve is validating that any user-supplied account name and password exists and is valid.

In my scenario, the user can choose if a service to be installed is run as LocalSystem or as a named account. We would like to verify that the specified user exists and the password is valid before registering the service with that information.
0 Kudos
pv7721
Level 20

AFAIK, there is no builtin support for that, so you would need custom code, unless there are platform specific functions to do that.
0 Kudos
jrokicki
Level 4

My only issue at the moment is making a Windows DLL be available during the pre-install phase.

I've seen workarounds of:
1) creating a seperate install for it and run it prior to the pre-install step (yuck!)
2) modifying the JVM zip file to include the file (ewwww)

Any better solutions?

Thanks!

- john
0 Kudos
pv7721
Level 20

There is a plugin called ExtractToFile (available on this page: http://www.flexerasoftware.com/products/installanywhere/files-utilities.htm) which allows access to a file inside the installer.
0 Kudos
TerryRidgway
Level 3

You can use JNI to call from your IA Custom Code into your C DLL.

Call getResource to load the resource URL:

URL CustomCodePanelProxy.getResource("MyCDLL.dll");


Call saveURLContentToFile to get the DLL out of the installer and onto disk:

File dll = CustomCodePanelProxy.saveURLContentToFile(ourURL);

The load the DLL into memory:

System.load(dll.getAbsolutePath());

Then call your JNI method in your C DLL as if it were a local Java Method.

--Terry
0 Kudos