Skip to content

~GSoC2010: Grigoruta Adrian Auto Installer and Updater

anildash edited this page Mar 26, 2011 · 1 revision

Project Goals

  • Simplify the ThinkTank installation process, ala WordPress’ “famous 5-minute install”
  • Implement an auto-update feature so that current ThinkTank installations get a notification when a new version is available

Installation process

After checking several open source platform installation processes1, I decided not to use a class for installing TT but to modify existing classes to add objects and methods which will help on the installation process. This approach is better because some functions are used in many places(such as is_email()), and when you want to use it anywhere in the application you need to call installation class tt_install→is_email and is not so good.

The installation form is as follows:

When the user accesses the installation form, the system requirements will be checked and displayed. The install button won’t be enabled until the system requirements and the database connection are ok. On the system requirements message warning, the user will get tips on how to enable or set folder permissions to solve the errors. After hitting reload the requirements form will be updated with new values until everything is set.

Next step is to configure mysql connection. In the same way as with the system requirements, users fill the host, username, and password test connection and if the connection is good, button will make inactive and can enter next step where user will fill in the database and table prefix. If the database doesn’t exist, user can check “create database” and database will be automatically created.

An email will be required , where the generated password will be mailed. After installation finishes the user gets a change password notification.

For the moment we know for sure that everything is ok and installation can start. User presses Install button and function tt_install() is called.

A pop-up will display current installation process like in this screenshot.

Finally will display email address and generated password with the login button to TT .

Auto-update process

For this process I am thinking to use an online API that will return latest or upgrade message with the link to the zipped archive of TT. File update-core.php will manage the upgrade process.

  1. Send version to http://www.thinktankapp.com/version-check/ to see if there is an update available. Get a link to the TT package if so.
  2. Download the package to the system temp directory
  3. Unzip the package
  4. Copy update-core.php from the new version unzipped into the current TT folder
  5. Call tt_update_core(), which is defined in update-core.php
  6. tt_update_core() takes over and does the following:
  • check the new version of TT
  • Overwrite old TT files with the new ones
  • Remove files that are no longer part of the TT
  • Send a request to ugrade.php to perform a DB upgrade. We do this as a separate request instead of calling the upgrade function directly because we need a fresh request that has all of the new stuff loaded.
  • Done

A directory schema will contain db.sql file that will create the initial database, and upgrade directory that will have database updates in format ddmmyyyyXX.php (1404201003.php). These files will be run on core upgrade, depend on version and date.

Upgrade notification and process is presented down:



Finally will have these functions:

function tt_install(string user,string email) return array[user_id,password];
 - install tt
function generate_password(int length,boolean special_chars) return string[length];
 - generate random password for admin
function is_email(string email) return boolean;
 - check if email is correct
function is_tt_installed() return boolean;
 - check if tt is installed
function tt_email_notification(string password, string user_id, string login_url);
 - send email with password to admin
function tt_make_db() 
 - create tables
function tt_install_defaults()
 - install default database values
function tt_update_core()
 - upgrade tt app and database to latest version

Timeline and Deliverables

27 April – 10 May
I will make a full review of the project, with task and deadline for functions. I will decide with mentors the best method to use on the implementation.

11 May – 28June *
I will code the install function and design the interface and ajax functions that will handle the installation.

28 June -15 July
I will design and code the upgrade core and database function.

15 July – 30 July
Test the application on different hosting providers, on windows on linux, make the documentation, add comments to every code I wrote

31 July – 12 Aug
I will post the code so everyone on group can comment and make suggestion.If there are suggestions I will implement them.

About me

My name is Adrian Grigoruta and i am from Romania. I have finished the University of Computer Science2 with mark 10 (A+).Now I am a student at Web Technologies and Databases Master in Bucharest Romania. I have finish high school with mark 10 (A+) in Informatics, and I am cisco and oracle certified. I have 10 years of programming3 experience (PHP, C++/C, Ruby on Rails, C# , ASP.net) and very good linux skills. I have worked before for other open source projects like Wordpress4.

References

1 Automating WordPress customizations

2 University of Bucharest

3 My Portfolio

4 WordPress Theme

Clone this wiki locally