I have written an installer script which checks to be sure the user has admin privileges before doing anything. If the user has admin rights, the script then checks whether a previous version of my app exists. If one exists, the previous version is removed, an executable installer for the new version is copied to a temp directory, and a 'RunOnce' registry key is set. Then the system is rebooted. Installation of the new version continues when the OS encounters the RunOnce key after the reboot. This all works fine.
However, if the user does not have admin privileges AND the UAC controls are set up at a restrictive level, then the OS interrupts this process. Example: 'Joe User' (not an admin) starts the installer. Before my own check to determine whether Joe User has admin rights, the OS interrupts with a UAC dialog requesting credentials from someone with admin rights (say, 'John Admin'). If they are supplied, then the install proceeds normally, up to and including the reboot. However, after rebooting, Joe User logs back on. The installation will not continue because the 'RunOnce' key was written into the registry for 'John Admin'. If 'John Admin' does happen to log on at any subsequent time, the installation will continue.
How do I keep this from happening?
Thanks!
However, if the user does not have admin privileges AND the UAC controls are set up at a restrictive level, then the OS interrupts this process. Example: 'Joe User' (not an admin) starts the installer. Before my own check to determine whether Joe User has admin rights, the OS interrupts with a UAC dialog requesting credentials from someone with admin rights (say, 'John Admin'). If they are supplied, then the install proceeds normally, up to and including the reboot. However, after rebooting, Joe User logs back on. The installation will not continue because the 'RunOnce' key was written into the registry for 'John Admin'. If 'John Admin' does happen to log on at any subsequent time, the installation will continue.
How do I keep this from happening?
Thanks!
Comment