這是本文件的舊版!
How to detect previous version in InstallAnywhere?
Problem
軟體升級是維護產品必經之路。透過安裝程式升級,幾乎是大家都會使用的方式。
How to?
CustomCodeRule - HasPreviousVersionRule
package org.tonylin.practice.ia.customcode; import com.zerog.ia.api.pub.CustomCodeRule; public class HasPreviousVersionRule extends CustomCodeRule { @Override public boolean evaluateRule() { String base_version = (String)ruleProxy.getVariable("BASE_PRODUCT_VERSION"); if( base_version == null || base_version.isEmpty() ) { return false; } String installer_version = (String)ruleProxy.getVariable("PRODUCT_VERSION_NUMBER"); return installer_version.compareTo(base_version) >= 1; } }