Compare 2 different file version and prompt for action

Hi,

I need some assistance with comparing 2 diff application. The format of the first file is in TAR "filename.1.2.3.tar" . The second file is a running application for which i need to find the version and then prompt the user for action as below :-

Once compared, It needs to prompt the user, asking them for action :-

a) Uninstall the old version and install the new ?

Or if the the new tar version is older or equal to the running application ver prompt the user :-

b) The installed version is higher / equal to the new tar file...exiting

--------------------------------------------------------------------------

Thanks

PS :- VINO..need your assistance