Add extra installations to customized WP installers script?

SDK Docs: http://installatron.com/developer/apps
SDK GUI Editor: http://installatron.com/editor
donnacha
Posts: 46
Joined: Thu Feb 12, 2009 2:35 am
Location: Edinburgh UK

Add extra installations to customized WP installers script?

Postby donnacha » Sat Mar 07, 2009 5:43 pm

Hello again.

As you know, I have been using Installatron to automate the installation of WordPress and plugins, using a customized installers script to customize the standard Installatron installation of WP and creating an installer for each of the plugins.

I've been busy with other stuff for the last few weeks but, now, I'm free to have another shot at mastering Installatron :D

One thing I really like about the customized installers script is that it is possible to delete certain files and folders from every installation of WordPress.

Is it also possible to edit the customized installers script to automatically add several of the plugin installers to each installation of WordPress?

donnacha
Posts: 46
Joined: Thu Feb 12, 2009 2:35 am
Location: Edinburgh UK

Re: Add extra installations to customized WP installers script?

Postby donnacha » Sat Mar 07, 2009 6:00 pm

Also,...

... would it be possible to somehow create different "packages", all based upon my customized WordPress installation but with different selections of other installers automatically added i.e. different selections of plugins and themes.

Does that make sense?

donnacha
Posts: 46
Joined: Thu Feb 12, 2009 2:35 am
Location: Edinburgh UK

Re: Add extra installations to customized WP installers script?

Postby donnacha » Sat Mar 07, 2009 6:03 pm

The most important thing is that Installatron continue to see each plugin and theme as a separate installation, so they can be upgraded separately later.

Rowan
Staff
Posts: 235
Joined: Tue Jun 19, 2007 7:39 am

Re: Add extra installations to customized WP installers script?

Postby Rowan » Sat Mar 07, 2009 11:15 pm

Hi,

You can't mix those two things; you can either install the plugins/themes with the standard installation, using Customizations, or you can have version control for each plugin/theme, using separate installers.

We might be able to enable something like that with the next version of the installer system, but that's still several months away. For now, at least, you can only have one or the other.

Rowan.

donnacha
Posts: 46
Joined: Thu Feb 12, 2009 2:35 am
Location: Edinburgh UK

Re: Add extra installations to customized WP installers script?

Postby donnacha » Sun Mar 08, 2009 12:08 am

Interesting, I'm glad to hear that this sort of flexibility might be possible in a future version - it would be incredibly useful for WordPress and I'm probably biased but I suspect that a growing number of your users will be using Installatron primarily for WordPress installs or, at least, similar core+plugins+themes applications.

For now, taking the route of forgoing version control and installing the plugins and themes with the standard installation, using customizations, is there any way to produce multiple versions of the standard WordPress install, each of which would obey different customization instructions i.e. wordpressinstall1, wordpressinstall2, wordpressinstall3 etc, with each version of wordpressinstall being the exactly the same, only the name is different, and each having a different button?

The idea is that pressing, say, wordpressinstall4 would give me the standard version of WordPress you provide but my customization script would treat it differently, copying in a different set of themes and plugins.

Rowan
Staff
Posts: 235
Joined: Tue Jun 19, 2007 7:39 am

Re: Add extra installations to customized WP installers script?

Postby Rowan » Sun Mar 08, 2009 12:29 am

Using multiple installers for that is probably not the best approach. Instead I would recommend using a single Customization that gives the user a choice when installing wordpress. I'll whip up an example.

Rowan

donnacha
Posts: 46
Joined: Thu Feb 12, 2009 2:35 am
Location: Edinburgh UK

Re: Add extra installations to customized WP installers script?

Postby donnacha » Sun Mar 08, 2009 12:43 am

Wow, an example would be great, thank you!

I have been pondering whether saved sets might be a good idea for a future version of Installatron - where, from the New Install page, you could tick boxes to select all the plugins and themes you want to install and, when you click Submit, Installatron installs them one after the other, without any interruptions because those particular installs would require no user input.

Being able to save specific sets of selections would enable you to create groups of plugins and themes appropriate to different kinds of WordPress sites you want to create, enabling you to equip your WordPress at the press of a single button/link, without having to select them all by hand every time.

Rowan
Staff
Posts: 235
Joined: Tue Jun 19, 2007 7:39 am

Re: Add extra installations to customized WP installers script?

Postby Rowan » Sun Mar 08, 2009 12:49 am

This is along the lines of what I was thinking:

Code: Select all

<?php
class i_installer_customcode
{
    function init()
    {
$this->registerArchive("plugina", "http://www.something.com.au/Plugin_A.zip", "zip");
$this->registerCustomCode("wordpress", "all", "install", 1, "init", "wordpressinstall");
$this->registerCustomCode("wordpress", "all", "install", "last", "process", "wordpressinstall");
$this->registerCustomCode("wordpress", "all", "upgrade", "last", "process", "wordpressupgrade");
    }
    function wordpressinstallinput($o)
    {
$o->setInputFields(array(
    array( "TYPE" => "header", "LABEL" => "Plugin Options" ),
    array(
        "ID" => "plugina",
        "LABEL" => "Plugin A",
        "TEXT" => "Plugin A",
        "TYPE" => "check",
    ),
));
    }
    function drupalinstall($o)
    {
if ( isset($o->input["field_plugina"]) && $o->input["field_plugina"] === "1" )
{
    $o->extract("plugina","wp-content/plugins");
}
    }
    function drupalupgrade($o)
    {
// something to do at each upgrade
    }
}
?>


It registers an extra archive then adds three inserts. The first insert adds an extra input field to step 1 (you could add more inputs), and the second insert uses that value to decide whether it should extract the plugin.

The last insert could be used to run something after each upgrade, to handle the plugin.

--

I don't know about that "plugin groups' idea, but I'll keep it in mind.

Rowan

donnacha
Posts: 46
Joined: Thu Feb 12, 2009 2:35 am
Location: Edinburgh UK

Re: Add extra installations to customized WP installers script?

Postby donnacha » Sun Mar 08, 2009 1:03 am

Wow, that was fast, thanks Rowan.

I should merge that with the existing code in my Customize installers code box, right?

And I should change the drupalinstall and drupalupgrade to wordpressinstall and wordpressupgrade, right?

donnacha
Posts: 46
Joined: Thu Feb 12, 2009 2:35 am
Location: Edinburgh UK

Re: Add extra installations to customized WP installers script?

Postby donnacha » Sun Mar 08, 2009 1:19 am

Would something like this be about right?

I stuck my existing customizations in after the new arrays and extractions.

Also, I copied the plugin-relevant lines to create copycat theme-relevant lines but I wasn't sure how to create a B choice for either plugins or themes.

Code: Select all

    <?php
    class i_installer_customcode
    {
        function init()
        {
    $this->registerArchive("plugina", "http://www.something.com.au/Plugin_A.zip", "zip");
    $this->registerArchive("themea", "http://www.something.com.au/Theme_A.zip", "zip");
    $this->registerCustomCode("wordpress", "all", "install", 1, "init", "wordpressinstall");
    $this->registerCustomCode("wordpress", "all", "install", "last", "process", "wordpressinstall");
    $this->registerCustomCode("wordpress", "all", "upgrade", "last", "process", "wordpressupgrade");
        }
        function wordpressinstallinput($o)
        {
    $o->setInputFields(array(
        array( "TYPE" => "header", "LABEL" => "Plugin Options" ),
        array(
            "ID" => "plugina",
            "LABEL" => "Plugin A",
            "TEXT" => "Plugin A",
            "TYPE" => "check",
        ),
    ));

   $o->setInputFields(array(
        array( "TYPE" => "header", "LABEL" => "Theme Options" ),
        array(
            "ID" => "themea",
            "LABEL" => "Theme A",
            "TEXT" => "Theme A",
            "TYPE" => "check",
        ),
    ));
        }
        function wordpressinstall($o)
        {
    if ( isset($o->input["field_plugina"]) && $o->input["field_plugina"] === "1" )
    {
        $o->extract("plugina","wp-content/plugins");
    }
    if ( isset($o->input["field_themea"]) && $o->input["field_themea"] === "1" )
    {
        $o->extract("themea","wp-content/themes");
    }

//THE 5 LINES BELOW ARE FROM MY EXISTING CUSTOMIZATION

$o->write(".htaccess", "");
$o->chmod(".htaccess", 0666);
$o->write(".dont_disable_plugins", "please");
$o->rm("wp-content/plugins/hello.php");
$o->rm("wp-content/plugins/akismet/");

        }
        function wordpressupgrade($o)
        {
    // something to do at each upgrade
        }
    }
    ?>


Return to “Application Packaging SDK and Application Customizations”

Who is online

Users browsing this forum: No registered users and 5 guests