(#12630) Run puppet agent as a service

Originally we were planning on installing puppet agent as a scheduled
task, but there are issues with this, such as the task scheduler service
itself may be disabled, may be configured to run as different user that
doesn't have sufficient privileges, etc.

This commit adds a wrapper script to run puppet agent as a service using
the win32-daemon gem. The Service Control Manager invokes the daemon.bat
script, which runs `rubyw.exe daemon.rb`.

The daemon ruby process sits in a loop executing `puppet agent --onetime` every
`runinterval` seconds, the value of which is obtained from puppet itself, and
can be configured in puppet.conf.

Windows services cannot write to stdout/err. Instead they are supposed to
write to the event log. But since we don't support that yet, the daemon
logs to a file in var/log/windows.log. By default the daemon logs at the
`notice` level.

In order to pass arguments to the service, you can either use the Service
Control Manager GUI or do the following from the command line:

  sc start puppet --debug --test --server foo.com

If --debug is passed as an argument, then the daemon will log at the
`debug` level.

This commit also updates the msi to install the daemon as a service. The
service's name is 'puppet' and its display name is 'Puppet Agent'. During
an install, msiexec will automatically stop the (old) service, install the
new files, and start the new service. The service is installed as an
automatic service, meaning it will start when Windows starts. It is
difficult to make this configurable from the command line, but can easily
be done using Orca/InstEd MSI editors.

Conflicts:

	wix/puppet.wxs
(#13027) Guard against invalid runinterval values

Previously, if the daemon was unable to start puppet, e.g. because the
wrong version of puppet was bundled into the installer, then the
runinterval value was getting set to 0, which caused the daemon to get
into an infinite loop launching puppet/ruby processes.

This commit guards against this, so that if runinterval is 0, we
instead default it to 1800 seconds, and display an error message in
the log.
Moving windows service into the ext directory.
(#15756) Call include function correctly

The hiera puppet backend called the include function without passing the
argument as an array. This changes it to call the function correctly.
Merge pull request #1132 from zaphod42/ticket/3.x/15756-disallow-incorrect-function-calls

(#15756) Call include function correctly
Merge branch 'maint/3.x/add_windows_daemon_service_to_ext' of github.com:haus/puppet into 3.x

* 'maint/3.x/add_windows_daemon_service_to_ext' of github.com:haus/puppet:
  Moving windows service into the ext directory.
  (#13027) Guard against invalid runinterval values
  (#12630) Run puppet agent as a service
(#16347) Replace \x92 character with apostrophe

Previously, there was a non-ascii character in the comment, which caused
a warning when building rdoc during `gem install puppet` on ruby 1.9.3.
It is possible from a copy & paste from MS Word smart apostrophe.

This commit doesn't change any code, just the comment.

Paired-with: Andy Parker <andy@puppetlabs.com>
(#16347) Qualify references to windows-pr gem

Previously, running `gem install puppet` on ruby 1.9.3, would fail when
the Puppet::Util::Windows::Security and Puppet::Util::Windows::User
modules both included the Windows::Security module from the windows-pr
gem.

The failure occurs when rdoc attempts to generate documentation for
Puppet::Util::Windows::User, and gets into an infinite loop, eventually
causing a stack overflow.

This commit fully qualifies to windows-specific gems so that this
doesn't occur in the future.

Paired-with: Andy Parker <andy@puppetlabs.com>
Merge branch 'ticket/2.7.x/16347-gem-install' into 2.7.x

* ticket/2.7.x/16347-gem-install:
  (#16347) Qualify references to windows-pr gem
  (#16347) Replace \x92 character with apostrophe
Merge remote-tracking branch 'upstream/2.7.x' into 3.x

* upstream/2.7.x:
  (#16347) Qualify references to windows-pr gem
  (#16347) Replace \x92 character with apostrophe
Merge remote-tracking branch 'upstream/3.x'

* upstream/3.x:
  (#16347) Qualify references to windows-pr gem
  (#16347) Replace \x92 character with apostrophe
  (#15756) Call include function correctly
  Moving windows service into the ext directory.
  (#13027) Guard against invalid runinterval values
  (#12630) Run puppet agent as a service