I'm currently thinking how to create a module installer. I think we have two options here:
1. Package the module in a .zip file.
The zip file can be uploaded and the module will install itself with the help of some .xml file that describes how the module should be installed. This is what, for example, DNN and Mambo have.
pro's:
- Very easy installation for non-technical users
con's:
- The ASP.NET user needs write access all over the place
- Takes a lot of time to develop
2. Manually upload the module files and install/upgrade the database from the site adminstration
pro's:
- Easy to develop
con's:
- Less easy installation
I slightly prefer the second option, mainly driven by the spare-time aspect :).
Does anybody have some other ideas or what preference do you have?
I can only speak from my experience with Mambo and Postnuke and the installer was rarely (actually never) used by non-technical users.
I think module deployment will always be in the administrators hand and uploading a folder to a web space and clicking "install" on an admin page is as easy as it can get.
So the second options sounds better to me, too.
What could be enforced is some sort of Module folder hierarchy where the needed sql script always have to be on the top level in a folder named sql, for example sql/mysql/script.sql and
sql/oracle/script.sql, so a simple installer can automatically choose the right script.
mgaerberWhat could be enforced is some sort of Module folder hierarchy where the needed sql script always have to be on the top level in a folder named sql, for example sql/mysql/script.sql and
sql/oracle/script.sql, so a simple installer can automatically choose the right script.
Exactly my thoughts :). Now only figure out some elegant way how to handle upgrade scripts. It can be a real pain, especially when you have to deal with three different database platforms.
Btw, I see you mentioning Oracle ;). Is there a demand for this or is this hypothetical?
Yeah, upgrading is a bit more tricky, one would have to supply a version number but I can't think of an easy way right away.
Oracle is not my favourite database and I am using Firebird at the moment / + investigating SQLite.
Those two have a big advantage: easily embedable... so a no touch deployment wouldn't be so far away ;-)
mgaerberYeah, upgrading is a bit more tricky, one would have to supply a version number but I can't think of an easy way right away.
Well, I figured it out. Every (installable) module needs at least an install.sql and uninstall.sql. With the first upgrade, the install.sql still has the complete script. The previous install.sql must be renamed to, for example, 0.9.0.sql and the upgrade script will be 0.9.1.sql. Then with the next upgrade a 0.9.2.sql script is added and the install.sql is updated to the latest version.
This way, any new installation will use a clean script (I have some less-optimal experiences with create scripts that are combined upgrade scripts) and you'll still be able to upgrade.
Oracle is not my favourite database and I am using Firebird at the moment / + investigating SQLite.
Those two have a big advantage: easily embedable... so a no touch deployment wouldn't be so far away ;-)
I've looked at them both as potential alternatives for hosting scenarios where there is no db-server. Firebird is currently the best alternative although people advise to not use the embedded version with a web application.
I like your idea of keeping it simple, but as mgaerber mentioned the install should be an admin only task, and anything except simple components will need more customization, like additions of HTTP Modules in Web.Config, Directory permissions etc.
But as you so rightly put it, developing an install scripting engine would be time consuming and troublesome, not to mention a HUGE security risk. ;)
So a simple interface should be more than sufficient, and any more complex modules / addins will just need a server admins help.
Just my two cents :)
Thanks! You guys really made me realize that keeping it simple is by far the best solution.
Simple is good.
Also - I would like to put a vote towards moving
towards the end user - not have to use any database tool.
(perhaps other than creating an empty database
in the beginning).
This will probably take a few iiterations to get right -
but it is very useful when used on hosted servers.
Elias
easfawAlso - I would like to put a vote towards moving
towards the end user - not have to use any database tool.
(perhaps other than creating an empty database
in the beginning).
I second that. We're talking about a module installer here, but I'm also working on a web-based installer for the core of Cuyahoga.
The module installer is working right now and comitted to SVN. The Downloads module has the install directory structure in place.
I'm pretty pleased with the result. Creating an installer for the core now is a piece of cake because I can reuse the entire database installer class :).
hm ... the module installer looks relly nice. But what are the base needs a module must provide to be useable with the installer?
Do you have some documentation? Because I haven't found something special in the repository version ?!?
cu
Thomas
Documentation is coming with the next release, including deployment instructions (like installer directory structure).