Previous Topic: Extract Pre-install Components to a Temporary FolderNext Topic: Run Installation Dialogs


Execute a Migration Script

To migrate non-PIF product installations, you can provide a migration script, which is executed by the Installer prior to the first installation of the product. You must specify the migration script for the PIF product through the keyword #prepif in the Product information section of the prototype file.

With the migration script, you can change your product-specific installation path parameter that has been defined through #ppath (for example, $MY_PIF_INSTALL_PATH) and the installation job ($PIF_INSTALL_JOB).

PIF parameters are passed through the shell environment and a temporary response file. The PIF product installation process recognizes updated parameters, which are appended to the response file, later on.

Example: Migration Script

The following script checks old installation base directories, sets the installation directory, and changes the installation mode from INSTALL to UPDATE.

##  check if response file parameter is passed
[ ! "$PIF_RESPONSE_FILE" -o ! -s "$PIF_RESPONSE_FILE" ] && exit 1
## check non PIF installation: product is either installed under /home or /opt directory
if [ -d /home/merchant ]
then
	echo "MY_PIF_INSTALL_PATH=/home/merchant" >> $PIF_RESPONSE_FILE
	echo "PIF_INSTALL_JOB=UPDATE" >> $PIF_RESPONSE_FILE
elif [ -d /opt/merchant ]
then
	echo "MY PIF_INSTALL_PATH=/opt/merchant" >> $PIF_RESPONSE_FILE
	echo "PIF_INSTALL_JOB=UPDATE" >> $PIF_RESPONSE_FILE
fi
exit 0