<title>oInstall : World's First Open Source Installer in Python and XML</title>
<pre>
"""####################################################################
oInstall (means Open Source Installer)
Developed by : Mohd Anwar Jamal Faiz
Email : toughjamy@yahoo.com
Website : www.meonshow.com/splash.php?uid=toughjamy
Version : This is version 1.0.1.1
Start date : 9th May 2012
Release date : 11th May 2012
Webpage : http://sourceforge.net/projects/oinstall/
#######################################################################"""
~~~~~~~~~~~~~~~
Usage Document
~~~~~~~~~~~~~~~
oInstall is currently a Python Program that helps installation of Simple Programs using
XML config file.It comes with its source code. Either download required files separately.
Or, simply download the oInstall-1.0.1.1.zip. It has all files.
How to Use:
Step 1: Prepare your Application in any technology you want and proceed to next step when you finally want to ship
Step 2: Prepare a oInstallConfig.xml, for installation of your App/Product. Use the tags available to do what you want
Step 3: In the environment tag , set the parameters needed for your installation
Step 4: Under the steps tag, enlist all the steps of your installation
Step 5: Run the oInstall.py
Step 6: See the magic happen!
List of tags in oInstall v 1.0.1.1:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<install> It is the root tag. All environment settings and installation steps are contained in them
<environment> This tag contains the configurable settings for the installation of your App/Product
Currently it identifies 4 valid child tags - productid, productname,installdir, and temp
Presently, we are just reading and displaying these settings. In this early release, we are
targetted to present a prototype of oInstall.
<productid> Has the product id. This can be used in creating temp directories, or uninstallation database later
Basic Usage:
<productid>myapp20056</productid>
<productname> Name of your App/Product
Basic Usage:
<productname>My App</productname>
<installdir> The install directory location (where your product binaries will be copied)
Basic Usage:
<installdir>C:\Program Files</installdir>
<temp> The temp directory on user's machine
Basic Usage:
<temp>C:\Documents and Settings\mohdanwar_faiz\Local Settings\Temp\</temp>
<steps> This tag contains the installation steps in sequential order
Currently it identifies 4 child tags- makefolder,makefile,copyfile,and copyfolder
These tags may additionally have attributes which give another meaningful usage to the same tag
<makefolder> It simply has the name of folder that has to be created
Basic usage:
<makefolder>C:\x\y\z\abc</makefolder>
<makefile> It simply has name of file that has to be created
Basic usage:
<makefile>C:\Program Files\abc\aisehi.log</makefile>
<copyfile> It has information related to file which needs to be copied
Baisc usage:
<copyfile>
<source>cabinet\anwar.bmp</source>
<target>C:\Program Files\abc</target>
</copyfile>
<copyfolder> It has information related to folder which needs to be copied.
Currently not supported
Baisc usage:
<copyfile>
<source>cabinet\anwar.bmp</source>
<target>C:\Program Files\abc</target>
</copyfile>
Available attributes in oInstall v 1.0.1.1:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
createtree : This attribute is valid for makefile,makefolder,copyfile
Its value can be true or false. By default false
In makefile, it means that if the directory structure is not present then create it, before creating file
In makefolder, it means that if the directory structure is not present then recursively create the directory
Basic usage:
<makefile createtree='true'>C:\abc\waisehi.log</makefile>
data : This attribute is valid for makefile tag
Its value can be any text. By default it is empty string
If it is set to some string, then this string will be written/appended to the file created by makefile
Basic usage:
<makefile mode='w' data='version 1.89.097.67'>C:\xyz\abc\aisehi.log</makefile>
mode : This attribute is valid for makefile
Its value can be 'a' or 'append' and 'w' or 'write'. By default it is 'w'
It works only if data attribute for makefile is set.
if mode='w' or 'write', the value of data attribute of makefile, will be written in the file created. previous file data, if any will be removed.
if mode='a' or 'append', previous file data will be retained, and the new data will be inserted at the last
Basic usage:
<makefile mode='w' data='version 1.89.097.67'>C:\xyz\abc\aisehi.log</makefile>
Present State of Project:
The Project is in its nascent stage. Yet it is effective in showing its architecture and extensibility.
Presently it supports very basic operations, but the best part is that the Installer can be prepared
very easily. And the entire installation instructions would be user and machine friendly
Limitations:
Currently it supports Clean Install ie. Version Control is not there
The facilities it offers now is very minimal, but it has been designed to be very scalable
Presently Uninstallation is not supported
Python must be installed
Future Developments:
A lot more tags have to be added with new attributes
Method to finally prepare an MSI/MSM/Exe or PKG/MPKG will be implemented
The process of making oInstallConfig.xml will be automatic
Python necessity will have to be removed, if change in architecture permits
dangerous operation would need user confirmation. This will also check any sideeffect of xml attack
Asking user responses e.g. sometime intstalldir location can be overrided by user
Usage example:
Download the Zip file. It has Source Code and executable
Prerequisite: You should have Python Installed
A sample file 'oInstallConfig.xml' is provided with the first release v 1.0.0.1
read 'readme.txt' for more details
Run it like: >python oinstall.py
Enhancements in v 1.0.1.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now uses python, minidom, xml, shutil, and employs xml validation before execution
unique identifier for each message is present
copyfile tag added. Attribute support of createtree
Bugfixes in v 1.0.1.1
~~~~~~~~~~~~~~~~~~~~~~
1. DESCRIPTION: At some places when status is made FALSE, code war traveres further doing something that it should not. It should have exited from the function returning proper status message.
STATE: FIXED and VERIFIED
RESOLUTION: because handling was in except check, so even after displaying error it resumed and executed further. This technically was not its proper meant-to-be code path. Changed this at 2 places.
2. DESCRIPTION: At some places when status was assigned a value, it continued further. And this caused doing unintentional work>
STATE: FIXED and VERIFIED
RESOLUTION: Now every code path return a status message. And as soon as proper status message is found, return from the function is called
3. DESCRIPTION: Users need complete documentation of each error string
STATE: Scrubbed. To be Fixed with v 1.0.2.x branch
4. DESCRIPTION: make separate function to print header and footer, because it may be used by some other function too.
STATE: FIXED and VERIFIED
RESOLUTION: For increased code reusability it was essential. Made functions _displayHeader() and _displayFooter()
5. DESCRIPTION: Some Error messages displayed and positioning of header/footer is not aesthetic and meaningful
STATE: FIXED and VERIFIED
RESOLUTION: Cosmetic changes. Done as per requirement
6. DESCRIPTION: Proper comments needed in _makefile and _makefolder()
STATE: FIXED and VERIFIED
RESOLUTION: For better code readabity and maintenance, proper comments were added at appropriate places
Contact:
Mohd Anwar Jamal Faiz
toughjamy@yahoo.com
0091-8888327658
oInstall team is open to accept researchers, collaborators, and developers.
If you find you can be of help to this team and/or want to be a part of this team, please do not hesitate to write back at toughjamy@yahoo.com
NOTE: If you want to use this Project for non-commercial and personal use, you are free. Any other usage presently needs permission of the owner.
</pre>