Archive: Changing to admin status within installer


Changing to admin status within installer
I've got my intsaller to detect that the user does not have admin rights to write to the registry or create a network folder etc. I then open a MessagBox informing the user that admin rights are needed to proceed.

Does anyone know how to open a dialog box (within the installer) to prompt for the admin password, so that if its entered correctly, the user can proceed without needing to log himself off, and log on as an administrator? The temporary rights should only be granted for the installer to "do its thing" and be terminated upon cancel or finish.

Thanks in advance.


This is only supported by Windows XP and later versions.

XP will automatically ask you for an administrator password if the filename contains the words "Setup" or "Installer".