Curtis Jewell - Corporate, Embedded, and Multi-user Perl on Windows
Title: Corporate, Embedded, and Multi-user Perl on Windows
Name: Curtis Jewell
Grant Manager: Jeff Adams
Duration: 3 months
Started: September, 2009
Enhance Strawberry Perl so that it can be customized for different environments, and silently embedded inside of other corporate and open source projects.
Benefits to the Perl Community:
With the upgrade to a .msi installer for Strawberry Perl, it is now possible to solve many outstanding issues and expand Windows Perl in new directions. These include greater compatibility with corporate environments, bundling Perl into large applications, better support for multi-user environments, and greater support for extending Strawberry Perl into a customized distribution that installs all the modules and other applications needed for a particular application.
Some corporate environments have asked about the ability to extend Strawberry Perl for their own use. At the moment, there is no contact point for them to ask a programmer to do so, and there is only "volunteer" support if they wish to do it on their own. Using the Inno Setup based Perl::Dist::Inno toolkit to produce a custom executable file has proven extremely difficult, and the .exe format has limited the willingness of corporate environments to install Strawberry Perl, as it would have to be handled differently from the majority of software packages available for Windows systems.
Now that Strawberry Perl can be installed with the Windows Installer service, it can be easily installed and patched by IT personnel and network administrators, both locally and across an entire global organization, and work well with standard network administration tools for Windows systems.
In addition, many corporate, academic, and government environments have restrictions that prevent installation of currently-provided versions of Strawberry Perl. There are two solutions that have been available to these people in the past: using Portable Strawberry on a USB drive or UNC share, and using another computer to create a version of Perl that will install on a drive that is available for them to use (using a virtual machine if required.)
Fixing the install path issues would expand the number of computers and niches that could use Perl on Windows.
Non-Perl programmers are even starting to install Strawberry Perl, as well, in order to run IRC bots or to provide a language that extends other programs. The current structure of Strawberry Perl was not built with this in mind.
Multi-user environments may not wish to allow installation of additional modules within the default directory structure that Strawberry Perl provides, as this currently requires administrator access for all their users. Currently, the local::lib module is included with Strawberry Perl as of the July 2009 release to assist in installing modules on a per-user basis for non-administrative users. However, the use and capabilities of this module on Windows can still be improved, and using Perl as a non-administrator can be made easier.
- Release a version of Strawberry Perl that:
- Is compiled as a "merge module" (.msm) file that can be included in other .msi files, as well as an independent .msi file.
- Can have the base drive (and possibly directory name) passed in to the merge module.
- Can be installed to any drive (the top directory may still be named "strawberry" under the root of the selected drive)
- Separates the modules installed with the initial installation from modules that the user / administrator installs, by using the "vendor" directories for module installation that can be configured when compiling Perl.
- Includes a script that saves the settings that local::lib creates within the Windows Registry.
- Release versions of Perl::Dist::WiX and Perl::Dist::Strawberry that will create the version of Strawberry Perl mentioned above, as well as making it easy to create .msi installers that include the Strawberry Perl merge module.
- The script for configuring local::lib will be releasable on CPAN independently, as well.
This project is a "multi-language" project in that it includes portions that are written in XML, C++, and Perl.
The merge module (an XML part, with Perl support)
Perl::Dist::WiX and the version of Perl::Dist::Strawberry that uses it currently build an .msi based on "fragments" of XML for the perl core, for each module and extra library, and for each significant portion of the compilation toolchain. An XML file created using a Template Toolkit template calling Perl::Dist::WiX subroutines connects all the fragments together, and contains the global settings for the installer.
As part of this grant, instead of one XML file to link everything together, there would be two: One to make the merge module, and one to use the merge module to create the .msi that end-users would use, and that would be modifiable for extension or use in corporate environments.
There would also be support in Perl::Dist::WiX for creating .msi files that use the Strawberry merge module and add their own Perl modules to it.
Relocatability (XML and C++ parts)
There are three parts to the implementation of a relocatable Perl on Windows:
1) The first part is to write a user interface in the Windows Installer XML dialect so as to pass what drive to install on to...
2) A Windows Installer custom action implemented as a .dll file to be included within the generated installer that does a search/replace on the installed perl and modules so that it has a sense of the place that it is being installed.
A .dll implementation is preferred to an executable file or script approach because JScript/VBScript scripts are "fragile" and often are disabled by virus scanners, and executable files cannot return the status codes that Windows Installer would like to use.
Perl::Dist::WiX already includes one MSI custom action, written as a C++ dll, to clean up all installed modules from within the Strawberry Perl installation during uninstall.
3) A perl script will also be available to use to relocate .zip builds.
Better multi-user support (via local::lib et al)
local::lib is a useful option to use on a system that has locked down its perl installation so that only administrators can install modules into the system's @INC, but it has not worked well on Windows.
This module will be made more usable by writing a script that would allow for easy configuration and persistence of the local::lib settings across reboots on Windows systems, and installing it in Strawberry Perl by default.
Modules installed using local::lib would not be uninstalled when a Perl distribution is uninstalled.
Adding support for "vendor" directories for module installation will also enhance multi-user support, as will using the new 'correct' @INC load ordering.
There may also be other code beyond the local::lib script and "vendor" module installation support that is required to both improve multi-user support and allow full CPAN client use in a multi-user environment.
There are 6 major "inch-stones" that are mentioned or otherwise required (in no particular order):
- The local::lib configuration Perl script.
- The .zip relocation Perl script.
- The relocation "custom action" DLL and supporting Perl/XML code.
- A Perl::Dist::WiX that supports building merge modules (.msm files), and supports "vendor" directories for module installation.
- A Perl::Dist::WiX subclass/alternative/additional code that supports installing a previously built .msm/.msi and adding more modules and software on top of it.
- Final building of the deliverable Strawberry Perl.
I am estimating that 3 months would be required to complete the first 5 inch-stones mentioned.
The deliverable version of Strawberry Perl would be released on the normal January/April/July/October schedule that has been previously established.
I do not program professionally, nor do I have other work responsibilities at this time, so I will be able to work on this grant full-time.
I can begin work as soon as the grant is awarded.
The grant amount requested includes living expenses for 3 months ($4000) and a dedicated computer for programming purposes ($1000), as I'm currently using a desktop machine that is shared among 5 family members and a 5-year-old personal laptop to build Strawberry Perl.
My name is Curtis Jewell. I live in Fielding, Utah, in the United States.
I'm the creator of Perl::Dist::WiX, which is the builder for the Windows Installer (.msi) versions of Strawberry Perl.
I've been writing programs in Perl since 5.005 days (1999 or so) and released my first module to CPAN in 2007.
I've been coordinating with Adam Kennedy (the project leader of Strawberry Perl) since I started writing Perl::Dist::WiX in January 2009, and will be taking over maintenance of Strawberry Perl from the July 2009 release onwards, when Strawberry Perl will be switched to being built using the Perl::Dist::WiX distribution.
$2.000 will be sponsored by Adam Kennedy and $3.000 by TPF.