Reply to Thread

Post a reply to the thread: How can we change Execution Level runtime

Your Message

Click here to log in

What's the name of our main installation product (in uppercase letters), directly followed by the current year?

 

You may choose an icon for your message from this list

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Topic Review (Newest First)

  • 09-02-2020, 01:49 AM
    testuser

    Re: How can we change Execution Level runtime

    Yes, it helps us to achieve our requirement.

    Thanks you very much Friedrich for the demo application.
  • 08-31-2020, 06:22 AM
    linder

    Re: How can we change Execution Level runtime

    Hello,

    You have several different options. I have uploaded a quick-and-dirty demo project:

    https://www.setupbuilder.com/projects/UserOption.zip

    By default, it runs (on UAC-aware) operating systems "asInvoker" (per-user). You can select "per-machine" and it re-starts itself as "requireAdministrator" (per-machine).-

    Does this help?

    Friedrich
  • 08-31-2020, 06:09 AM
    testuser

    Re: How can we change Execution Level runtime

    Thanks for the immediate reply!

    What do you mean by wrapper?

    Can you please elaborate "start the main installation elevated from this wrapper." ?
  • 08-31-2020, 05:39 AM
    linder

    Re: How can we change Execution Level runtime

    Hello,

    the manifest in an executable determines the execution level. So Windows does not allow to change the execution level "dynamically".

    What you have to do in this case is to use an "asInvoker" wrapper. This runs by default "per-user". Ask the "per-user" / "per-machine" question and if it is a per-machine install, start the main installation elevated from this wrapper.

    BTW, never use "highestAvailable". Use asInvoker or requireAdministrator.

    Windows does not allow to write to protected resources (e.g. Program Files, Windows, HKEY_LOCAL_MACHINE) from a non-elevated running application.

    Friedrich
  • 08-31-2020, 04:11 AM
    testuser

    How can we change Execution Level runtime

    Hello,

    I am not sure whether it is possible or not, Can we change UAC execution level dynamically?

    Requirement:
    1. We want to show user 2 options : A. Machine Wide B. Per-User
    2. If user selects Machine Wide option then we want to ask user for permission(UAC) and set installation path in Program Files.(like highestAvailable)
    3. If user selects Per-User option the we don't want to ask user permission and set installation in LocalAppData.(like asInvoker)

    I guess its not possible but can we do installation in Program Files without UAC permission.


    Thanks in Advance!

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •