[Install Scripts] Detecting upgrades between major releases

Hello,

Is there any way of detecting the difference between an installed current version of a script and the version that a user wants to install?

I know there is the compare_versions() method. Is there a way to use it in this way so that I can do a proper upgrade procedure (the script has different procedures for upgrading between minor and major releases).

Thanks for your help.

You would have to implement this yourself in the script_whatever_install function … for example, you could use code like :

sub script_whatever_install { my ($d, $version, $opts, $files, $upgrade, $domuser, $dompass) = @_; ... if ($upgrade) { if ($ver >= 2 && $upgrade->{'version'} < 2) { # Perform major upgrade } else { # Perform minor upgrade } } else { # Perform new install }

Ah, thank you very much! That helps a lot.