Announcement

Collapse
No announcement yet.

Uninstall with User Privilege Level

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Uninstall with User Privilege Level

    Is it possible to set the User Privilege Level also for the Uninstall?

    The standard Uninstall runs with normal user rights. I need elevated rights to remove some settings done by Shell.Execute (remove firewall settings).

    Thanks in advance!

  • #2
    It looks like you understood something backwards.

    By default, the setup will run with administrative privileges, or the process won't be able to deploy files to the System or ProgramFiles folders, for example. With default settings, the uninstaller will request the same privileges, via User Account Control dialog, when started, so all changes done during the setup can be undone properly.

    If you set up you project to create an installer which runs with invoker privileges (Project Settings > Advanced > Requested User Privilege Level), then the uninstaller will also run as invoker.

    Spawning a new process with Shell.Execute() will run this process as invoker, not as admin. Setting up the firewall for all users of the computer requires admin privileges, and should use File.Run() instead, in a setup with default settings (running as admin).

    Ulrich

    Comment


    • #3
      Solved

      Hello Ulrich,

      thanks a lot. With File.Run it works as expected. I was not aware that Shell.Execute spawns not as a child of the Uninstall (and in the end could have different rights).

      Comment

      Working...
      X