差異處
這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
java:installanywhere:upgrade:previous_version_detection [2018/11/30 18:01] tony [Problem] |
— (目前版本) | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== How to detect previous version in InstallAnywhere? ====== | ||
- | ===== Problem ===== | ||
- | 軟體升級是維護產品必經之路,而透過安裝程式升級,幾乎是大家都會使用的方式。InstallAnywhere在Premier版本提供了Upgrade功能,可以透過以下方式啟用它:\\ | ||
- | {{:java:installanywhere:upgrade:ia_upgrade_setting_panel.png|}}\\ | ||
- | \\ | ||
- | 接著可以透過Check Running Mode去確認是否是在執行Upgrade:\\ | ||
- | {{:java:installanywhere:upgrade:ia_check_running_mode_upgrade.png|}}\\ | ||
- | ===== How to? ===== | ||
- | ==== CustomCodeRule - HasPreviousVersionRule ==== | ||
- | <code java> | ||
- | 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; | ||
- | } | ||
- | } | ||
- | </code> | ||
- | |||
- | |||
- | ===== Reference ===== | ||
- | * [[https://helpnet.flexerasoftware.com/installanywhere2015/Content/helplibrary/ia_ref_actions_modifyxml.htm#reference-part2_4211107119_1375517|Read/Modify XML File Action]] | ||
- | * [[https://helpnet.flexerasoftware.com/installanywhere2015/Content/helplibrary/ia_ref_variables_std_ia_vars.htm|Standard InstallAnywhere Variables]] | ||
- | * [[https://helpnet.flexerasoftware.com/installanywhere2015/Content/helplibrary/ia_key_custom_code_overview.htm#key_concepts_3330169420_1104528|Custom Code]] | ||
- | |||