#3 Installation fails

open
None
5
2013-08-16
2011-03-01
Anonymous
No

Installation fails with the message:The installer has insufficient privileges to access this directory: C:\Program Files\Automatic Mouse Switcher. The installation cannot continue. Log on as administrator or contact your system administrator.

But I am logged on as an administrator.

Discussion

  • Nobody/Anonymous

    Forgot to add: System is Windows 7 Professional 32 bit, Acer netbook with built in track pad and Microsoft wireless Arc mouse.

     
  • Denis Dydychkin

    Denis Dydychkin - 2011-03-01

    Hi,

    I bet the issue is related to UAC introduced in Vista. Do you have UAC enabled or disabled? Have you got UAC popup when you started installer? Have you disabled UAC's popup completely? Can you run it with "right-click - Run as Administrator"?

    Here are technical details in case you are interested.
    Automatic mouse switcher is supposed to be per-user application - design decision based on the way switcher operates. As a result I have not enforced installer to require priveledged access when launched - instead, you can install mouse switcher without priveledged access in user directory (C:\Users\_username_\AppData\... for example). I've tested installer with Windows Seven and I got UAC request when it is really required, i.e. when I try to install mouse switcher into ProgramFiles.

     
  • Denis Dydychkin

    Denis Dydychkin - 2011-03-01
    • assigned_to: nobody --> nyrl
     
  • V@no

    V@no - 2012-09-01

    There is no such thing as "run as administrator" for .msi files.
    The installer supposed to show a prompt for authorization if it needs administrator privileges, but it doesn't.

     
  • V@no

    V@no - 2012-09-01

    Changing installation path to somewhere other then default seems to work.

     
  • Dániel Dékány

    Same problem on Win7 64 bit of course. The MSI should pop up the UAC prompt, like all other installers do. Until it doesn't do that, since there's no "Run as Administrator" in the right-click menu for .msi files, you can instead start cmd as administrator and there issue msiexec /a automousesw.msi.

     
    • Denis Dydychkin

      Denis Dydychkin - 2013-08-16

      Thanx for comment.

      Nevertheless, I have to state two thing:
      1) unlike other installers, it does NOT ask for admin rights by default. The reason for that is that this application is installed and configured on per-user basis - both startup action and configuration data is kept per-user. So, it is ok to install this program into user folder, not system-wide Program Files (yeah, I know, nobody does that... but it is possible).
      2) On my x64 Windows 7 it DOES pop UAC dialog when I try to install software into folder that is not accessible without administrative privileges. I have completely no idea why it does not on other systems, and I would appreciate help with that. Please note as well that WiX, which is used as installer, does not have a dialog that could ask if user wants to install per-user or system-wide, or at least I don't know how to use it.

       
      • Dániel Dékány

        I have tried this on 3 computers. All of them are different Win7 installations (different installation media, different setup in general), and they all have this issue. These were two Win7 64 Pro-s with an admin user (tested both with maximum and with default UAC level), and a Win7 32 with non-admin user (it used to prompt for the admin password in the UAC dialog). Same issue... no UAC prompt, and then the installer has no right to write C:\Program Files\whatever or (Program Files (x86)).

        Have you tried re-packing with the latest WiX? Maybe they have fixed something...

         
  • V@no

    V@no - 2013-08-16

    http://kentie.net/article/wixtipstricks/#UACShield

    Unfortunately, it seems that through no combination of InstallScope and/or InstallPrivilege settings can installers be made to only ask for administrator privileges when those are actually required, depending on the install directory. As it stands now, perUser installers will just plain fail when installed to, for example, the Program Files directory, while perMachine installers always ask for admin rights.

    Looks like InstallPrivileges="elevated" plus InstallScope="perMachine" is the ticket

     
    Last edit: V@no 2013-08-16
    • Denis Dydychkin

      Denis Dydychkin - 2013-08-16

      It is actually the last line which enforces "ask for UAC only if needed" policy. Changing it to 'elevated' enforces UAC even if not required.

      <Package Id="*"
               Description="$(var.FullName) $(var.Version) installer"
               Comments="$(var.FullName) $(var.Version) binaries and libraries package"
               InstallerVersion="200" 
               Compressed="yes"
               InstallPrivileges="limited" />
      

      Well, I might actually release two installers, but that is damn confusing.

       
      Last edit: Denis Dydychkin 2013-08-16
      • Dániel Dékány

        Isn't it the normal procedure to require admin (I mean, elevated) rights when installing something? Regardless if it's for all users or only for the current one. I mean, if I'm sys admin somewhere, I don't give users admin rights exactly because I don't want them to install stuff without me. I know some apps, like Chrome can still be installed, but that's rather the exception than the norm...

         
        Last edit: Denis Dydychkin 2013-08-17

Log in to post a comment.