We have developed a web application with embedded java application web server (Jetty). We need to develop an installer and uninstaller for none gui based Linux servers (Ubuntu). We have also used H2 as an embedded database engine.
The script should check if there is already a version of the application installed. If it is installed inform the user about this and give the choice to remove existing version and have a clean install or upgrade the existing version.
Uninstall existing application and remove all file and processes. Install new version.
Remove application without removing data files and install new application files.
Update the database
If there are any updates to the database schema perform an upgrade. The application should auto start with server restart.
Confirmation dialog (Yes, No).
Ask user if data files (database) should be removed as well.
If yes remove application and data files
if No: remove application but leave data files.