zotero/zotero-standalone-build — pull request #4 by mikesteele81 (2012-06-06 19:02:25+00:00)
Title: windows: Don't try to install to c:\ProgramData if c:\Program Files fails

I ran into this issue while trying to improve the handling for per-user installations. Basically, the installer is deciding whether to use %LOCALAPPDATA% based on whether there is write access to c:\ProgramData.

In practice this is a minor issue. By default Windows will let any user write to that location.

## Commit comment

Previously the Windows installer was intending to try each of the following folders in turn until one with write access was found

#### Windows XP

* c:\Program Files
* c:\Documents and Settings\All Users\Application Data
* c:\Documents and Settings\\Application Data

#### Windows 7

* c:\Program Files or c:\Program Files (x86)
* c:\ProgramData
* c:\Users\\AppData\roaming

What was actually happening was that if the second path was checked for and
was found to be writable by the current user, then the 3rd option would be
chosen. If the current user did not have write access to the second path,
however, then that path would be chosen.

A user running the installer with administrative access should be able to put
programs in the first path. Should this not be the case, it would be better to
abort the installation rather than look for an alternate place to install the
software system-wide.

With this patch the behavior is as follows. First the installer will check
whether it has write access to the system wide location ("c:\Program Files" or
"c:\Program Files (x86)"). If this fails it will fall pack on a per-user
installation.