My suggestion is that you ask the user for an admin domain\\name and password at that point, thus allowing them to continue. This is where the experimentation comes in. My first suggestion is to try the following code:
Code: Select all
lbResult := LogonUser(PChar(szUser), PChar(szDomain), PChar(szPassword),
{LOGON32_LOGON_NETWORK {} LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, hToken);
// nLastError := GetLastError;
if lbResult then
lbResult := ImpersonateLoggedOnUser(hToken);
if not lbResult then
Report('User "' + szDomain + '\\' + szUser + '" logon failed - cancelling.', true);
This would all give a much smoother end-user experience.
Hopefully this will get into an update, along with my previous suggestion of being able to test for power-user status which is actually all that is needed to do a basic app install.
Thanks,
Matthew

