2
votes

What is the real difference between:

I read the help but don't really get it:

IsAdminInstallMode: Returns True if Setup is running in administrative install mode or if Uninstall is running with administrative privileges.

IsAdmin: Returns True if Setup/Uninstall is running with administrative privileges.

What is the difference between administrative install / administrative privileges?

I am asking because when building I received this warning:

Warning: Line 118, Column 6: [Hint] Support function "IsAdminLoggedOn" has been renamed. Use "IsAdmin" instead or consider using "IsAdminInstallMode".

Which should I use and why?

1

1 Answers

3
votes

As the documentation says, the IsAdminInstallMode returns True if Setup is running in administrative install mode. Where the administrative install mode means:

  • The {group} folder is created in the All Users profile.
  • The "auto" form of the directory and Shell Folder constants is mapped to the "common" form.
  • The HKA, uninstall info, and font install root keys will be HKEY_LOCAL_MACHINE.

Whether administrator install mode is used depends on the PrivilegesRequired directive. You basically use the directory to declare, if the installer needs the privileged.


While the IsAdmin (aka IsAdminLoggedOn) is true, if the installer has been executed with administrator privileges. So that's something the user controls, not the installer.


IsAdminLoggedOn IsAdminInstallMode Meaning
True True The installer was executed with administrator privileges, and uses them to install the application for all users.
True False The installer was executed with administrator privileges, but does not need them and will still install the application for the current user only.
False False The installer was not executed with administrator privileges, and does not need them as it will install the application for the current user only.
False True Not possible.

The IsAdmin is an equivalent of IsAdminLoggedOn. But usually, you actually want IsAdminInstallMode, not IsAdminLoggedOn. That's why the function was renamed and split into these two. It depends on what you test for.