Question about running the installer as administrator

Comments

1 comment

  • Avatar
    BitRock support

    Hi Andreis,

    If the installer is switched to an administrator because it needs elevation, it is possible to use WMI or other tools to detect the currently logged in user, but that would only work for client versions of Windows, because server versions of Windows may have multiple users logged in.

    We recommend installing the data files to ${windows_folder_common_appdata} instead and have your application also use the files located there?

    Or install to ${windows_folder_common_appdata} and have logic in the application determine when the files are missing and copy them from the common appdata folder to current user's folder.

    This way if the app is installed in Program Files and the machine is used by more than one user, other users would be able to run the application as well.

    Would that work in this case?

    Another option would be to set <requestedExecutionLevel> to highestAvailable - this will only elevate the installer if the current user is an administrator, but will not ask to login as an administrator if the current user is not. You could also add logic that sets the default installation directory to user's appdata folder if Program Files folder is not writable.

    Regards,

    Alejandro

Please sign in to leave a comment.