Custom Action Impersonate User - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

CharlesS
Posts: 3
Joined: Thu May 07, 2009 9:57 am

Custom Action Impersonate User

Hi all,
One of the screens in our installer asks the user to input DB Credentials (Domain/User/Pwd).
We need to impersonate the entered user and test whether this specific user can connect to our DB.

I haven't found a way to write the specific code we wrote to test the connection can't in VBS (we need to call these Win32 API methods "LogonUser" "RevertToSelf") see here http://support.microsoft.com/default.as ... us;Q306158.

I have created a .Net Custom Installer Action but I can't seem to run it when the user clicks Next (as an UI Custom Action). It appears that .Net Installer Class Actions can't be UI Custom Actions.
I have tried to create a .Net Exe which runs and returns a value but I can't seem to retrieve the result after it is run.
I have tried to call a vbs script which calls my .Net Exe using WshShell.Exec("TestDB.exe") but that doesn't seem to work.

What is the recommended way to create an EXE which recieves the entered credentials test the impersonation and returns the result back to the DoAction when the Next Button is clicked?

Please advise.
-c
CharlesS
Posts: 3
Joined: Thu May 07, 2009 9:57 am

Re: Custom Action Impersonate User

I just saw this post http://www.advancedinstaller.com/forums ... 843#p22843 of mine.
I suppose it could work in my case so if anyone has a better idea let me know.
-c
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Custom Action Impersonate User

Hi Charles,

The solution Cosmin recommended in that post seems to be your best option.

Also, note that .exe custom actions can not directly pass data back to the installer through return values.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”