InstallAnyWhere使用笔记-制作升级补丁时的一些判断

本文详细介绍了跨平台软件(包括Windows和Linux)的版本检查、升级判断及实施流程。通过注册表项和特定文件来确定软件版本,并使用对话框引导用户进行版本升级或安装操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Gmail:chenluqq@gmail.com

现状和需求:目前本版 165

        1. window 下有注册表项

2. Linux  /opt/XXXX/productinfo.txt   (XXXX 产品名  此文件位置是固定的)  

XXXX Office
5.0
linux
zh-CN
专业版
0501.0201.3000.6500

 

   3.补丁可以 对 65-69的版本升级到70.

 

Winodows 

 1.Get Windows Registry Entry:comment  获取程序的安装路径

     Store Value in Variable: $USER_MAGIC_FOLDER_1$

     Store Key Existence in Variable:$cs2c_path_bool$ 

 

  1.Get Windows Registry Entry:comment  获取程序的版本信息 存入 $HaveUp$

 

 

 3.添加Show message dialog  (Add action..Show message dialog) 判断产品是否安装

 

 

  Dialog Type  

Button 0 -3  3个按钮可以选 每个按钮后的 有3个可以选项 Return to Previous Panel (返回上一步) Continut to Next (继续下一步  "忽略")  Cancel and Exit (退出) 

Rules 里设置此Dialog的显示条件  

  Add  Rule... >>Compare InstallAnywhere Veriables

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

 Operand 1: Operand 1:

 $USER_MAGIC_FOLDER_1$ does not contains  NeoShineOffice 5

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

这里其实也可以根据 $cs2c_path_bool$判断 ,  但是由于我们的软件有多个系列 注册表位置都写在此处 切别只是安装目录名不同 (如NeoShineOffice 5  、 NeoShineOffice 3)且这个安装过程用户是不可以更改的。

 

   4.添加Show message dialog  (Add action..Show message dialog) 判断产品版本

 Properties 设置方法和上一步一样 

 Rules 里设置此Dialog的显示条件  (根据升级策略 安装o退出)

  Add  Rule... >>Match Regular Expression

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

 Operand : Regular Expression

 $HaveUp$ does not Match   0501.0201.3000.6[5-9]00

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


*注:正则规则 同java

4.添加Show message dialog  (Add action..Show message dialog) 判断程序是否正在运行

 Add Rule...>>>Check File/Folder Attributes

 选中 Perform only if the file/folder is  in-use 

若有多个条件 请注意 Rules List :logically {or/and} when evaluating multiple rules 

 

 5.Post-Install 内修改注册表 更改版本号

 

 

Add Action...>>>Exeute Command: 

Command Line: reg add  "HKLM\software\NeoShine Office" /v Version /t REG_SZ /d 0501.0201.3000.7000 /f

 6 Build >>build project 

 

 Linux 下的类似windows     (权限和版本判断 我都了外部脚本中)

Install 

 ExpandedBlockStart.gif代码

# !/bin/bash

dir
= `dirname $ 0 `
cmd
= " $dir/update.bin "


if  [ ${UID}  =   0  ]; then
        
exec    $cmd
        
exit  
fi

xsu
= `which gksu kdesu  2 >&-   |  head  - 1 `

if  [  $xsu  ]; then
        
$xsu    $cmd
        
exit
fi

xterm
= `which gnome - terminal terminal  konsole xterm rxvt eterm  2 >&-   |  head  - 1 `

if  [  - " $xsu "  ]; then  
    
$xterm   - " $dir/textinmod "   &&   exit
fi

 

 textinmod

# !/bin/bash
exec   <   / opt / neoshineoffice5 / productinfo . txt
#  读取 /opt/neoshineoffice5/productinfo.txt 的第6行
for  i in { 1 .. 6 }
do
read  line
done
#  判断版本、校验升级    
#if [[ ${line:0:4}  -eq "0501"  ]]
#then    

     if  [[ ${line : 15 : 2 - le  " 76 "   &&  ${line : 15 : 2 - ge  " 60 "  ]]
    then
    echo 
" 当前版本是:1 " ${line : 15 : 2 } "  可以升级. "
    echo 
" 请按系统提示输入密码 "
    sudo 
./ update . bin
    echo 
" 升级完成! "     
    
else
    echo 
" 当前版本是:1 " ${line : 15 : 2 } "  不可以升级 "
    echo 
" 此升级补丁 支持 160~170之间的版本升级! "
    fi
# fi
sleep   3

 

 InstallAnywhere只是打包了和释放下文件

方块字解决 查看 http://www.cnblogs.com/cpper/archive/2010/05/19/1739507.html 

转载于:https://www.cnblogs.com/cpper/archive/2010/06/02/1749779.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值