InstallShield InstallAnywhere 培训要点记录(二)

            10)使用ISMP 11.5的project file
                ISMP 11.5的project file是uip格式的,IA不能直接打开它。我们可以在ISMP 11.5中导出一种DIM file,然后在
                IA的organization-->DIM Reference-->add DIM Reference中使用它。ISMP 11 sp1之前的版本IA不再兼容
            11)installer运行时参数
                你可以在installer运行的时候添加一些参数,比如
                installer.exe -i console //在console模式下运行
                //在silent模式下运行,由于silent模式不会有任何界面,所以你可以
                //设置一些安装的属性,格式如下:
                installer.exe -i silent <propertyname>=<value>
                //具体实例:
                installer.exe -i silent USER_INSTALL_DIR=C:\Mydirectory
                //如果你属性很多,你可以都写在一个文件中,然后引用就可以了
                installer.exe -i silent -f <path to the properties file>
            12)用代码启动IA的build
                稍微复杂一点的java项目在编译打包的时候都少不了要用到ant。如果我们要在ant中启动IA来制作安装程序该怎么做呢
                IA的安装目录下有一个build.exe,用它就可以了。
                build.exe <path to IA project file>
            13)source path
                在Edit菜单里面可以设置source path。感觉它跟ISMP的alias是一样的。无非就是让你设置IA_HOME,PROJECT_HOME等等。
                和alias不同的是,source path都是global,没有project类型的。source path存放在C:\Documents and Settings\Administrator\InstallAnywhere\80\Enterprise\preferences中
            14)merge modules
                当我们需要有一个project包含其他project的时候,就要用到merge modules。最典型的例子就是office包含word,powerpoint
                ,excel等。merge modules最少要有两个project,一个parent project,若干个child project。merge modules主要有以下几种:
                i. design time merge module
                 这种merge module直接把child project拷贝到了parent project中,child project中的panel和action都会在parent project
                 的安装过程中出现,并且你可以在parent project中修改它们。如果原来的child project做了某些变化,parent project中的child project不会有任何变化。
                 这种merge module只生成一个uninstaller,它会卸载掉整个软件产品。如果要只卸载child project,好像可以通过把child project
                 设成feature来实现,但我目前还没有实验过。
                ii. dynamic time merge module
                  这种merge module不拷贝child project到parent project中,它只链接到child project。所以child project的任何变化都会反映到
                  parent project中。但是你不能在parent project中修改child project的panel和action,因为你只是链接到child project。
                  这种merge module会生成多个uninstaller,分别用来卸载parent project 和child projects。
                iii. build time merge module
                   和dynamic time merge module类似,不同的是build time merge module不会出现child project的panel。换句话说,child project是以silent模式安装的。
            怎么在具体的项目中用merge module呢?首先,你需要把child project build成merge module,会生成一个文件。然后在parent project的
            orgnization-->Modules 导入就可以了
            15)Custom Code
                IA的advanced designer已经可以满足大部分用户的需要了,如果你所要的功能advanced designer还无法实现,你可以自己编写Custom Code来实现。可以说
                Custom Code是IA的more advanced designer。
                Custom Code分成以下几种:
                i.custom code actions
                ii.custom code panels
                iii.custom code consoles
                iv.custom code rules
                在IA的安装目录下有一个javadoc目录,里面有IA提供的api的文档,跟java的api的文档的使用方法是一样的。IA为以上四种Custom Code提供了四个
                缺省的类来实现,分别是CustomCodeAction,CustomCodePanel,CustomCodeConsoleAction,CustomCodeRule,你可以去继承它们并添加你需要的
                功能。
                代码写好了之后不能直接用于IA中,还需要编译,打包。打包有两种方法
                一)打包成类的JAR包
                   先写好代码,然后用javac命令编译(当然你也可以用eclipse,netbean来得到class文件),最后把class file压成jar包。
                   点击Add Action-->Execute Custom Code,指定你的jar包的位置,如果用到了第三方的jar包,记得把它们添加到“Dependencies”中
                   ps:点击Add Action,你会看到有四个tab:General,Panels,Consoles,Plug-ins。如果你是Custom Code Action,要选择General里面的
                   Execute Custom Code,如果你是custom code panels,你要选择Panels里面的Execute Custom Code,如果是custom code consoles,
                   要选择Consoles里面的Execute Custom Code,如果是custom code rules,不能通过Add Action添加,你需要点击Add Rule-->evaluate custom code
                   来执行
                二)打包成plugin
                先写好代码,然后用javac命令编译(当然你也可以用eclipse,netbean来得到class文件)。
                创建一个properties文件,然后把这个properties文件打包成一个jar包。可见与第一种方法的区别就是多了一个属性文件
                举一个属性文件的例子:
                 plguin.name=my custom action
                 plugin.main.class=MySampleAction
                 plugin.type=action
                 //如果你写了preinstall,那在preinstall view中Add Action-->Plugin里面可以看见这个plugin,否则是看不见的。
                 plugin.available=preinstall,install,postinstall
                 //property.myproperty=this value
                 property.database=localhost
                 打包完成后,把jar包拷贝到IA安装目录下的plugins文件夹,然后重启IA(eclipse的用户肯定很熟悉这个操作吧,呵呵) 
                 然后你就可以在Add Action-->Plug-Ins里面发现你自己写的plugin了。
                 最后列一下IA提供的api中比较重要的方法(IA提供了一个zip包IAClasses.zip在IA安装目录下)
                 public class MySampleAction extends CustomCodeAction
                 {
                  public  void install(InstallerProxy ip)
                {
                 }
                 }
                 subsititue(String var)-recursively gets the variable value
                getVariable(String var)- jaut gets the variable value
            for example:
                 database_name=$user_install_dir$/mydir
                subsititue(String var) C:\pf\macrovision\mydir
                getVariable(String var)
                 $user_install_dir$/mydir
                
                  public class MyCustom Panel extend CustomCodePanel{
    public boolean setupUI(CustomCodePanelProxy ccpp){
        //execute some condition or logic
        return true or false;//if true ,display,or don't display
        public voidpanelIsDisplayed()
        {//you will put controls and logic for displaying the panel
       
        //this is where you will use java's swing classes to display controls on your dialogs
        //just for text area,if you wanna add a button to the bottom,then you need
        //to create a new dialog by swing ,
        }
        public boolean okToContinue()
        {
        }
    }
    }
 
   public class MyCustomConsole extend CustomCodeConsoleAction{
    public boolean setup(CustomCodePanelProxy ccpp){
    //any validation you want to execute before displaying this console panel
    you will put here
        }
    
    }
    }
    public class MyCustomRule extends CustomCodeRule{
 
        public void evaluateRule()
        {
        //in this method,you can put the logic to evaulate this custom rule
        //return true or false
        }
    }
    }
    在IA安装目录下的Custom Code文件夹,你可以找到一些sample code,更多的sample code可以到
    它的网站上查询。

        最后,引用training teacher的一句话作为本文的结尾“不管你的产品有多好,用户第一印象是看你的安装程序,如果你的安装程序不够人性化,甚至安装失败了,那用户对它的评价就不会高”

posted on 2007-07-30 17:09 小牛小虾 阅读(3339) 评论(1)  编辑  收藏

评论

# re: InstallShield InstallAnywhere 培训要点记录(二) 2008-10-08 10:11 bluehouse1985

InstallShield & InstallAnywhere 涨价前最后一次特卖!
Acresso公司主打产品installshield和installanywhere从11月1日起全面涨价!InstallShield & InstallAnywhere 涨价前最后一次特卖!仅10天!先到先得!
为庆祝最新版InstallShield 2009 & InstallAnywhere 2009上市,答谢广大新老用户的支持与厚爱,从即日起,上海世全软件(XLsoft)举办Acresso产品优惠活动!数量有限,售完为止!
销售热线:021-62128912/010-64616123
销售邮箱:sales@XLsoft.com.cn
XLsoft网站:http://www.xlsoft.com.cn/

InstallShield 2009 & InstallAnywhere 2009 双重惊喜,闪亮登场!
InstallShield 是软件安装、配置软件包和升级解决方案领域内公认的标准,强大灵活而又简单易用。首次使用的开发者将发现它非常容易创建安装程序,而高级用户也将发现它的潜力与灵活性,非常适合开发复杂的软件安装。InstallShield 2009 现在支持最新的Microsoft Windows Vista,包括 Internet Explorer 7、Windows Installer 4 和其它令人耳目一新的新技术,对微软最新技术的支持、重要性能、品质和功能的改进,让你充分适应Windows Vista。
InstallShield 中文官方网站
http://www.installanywhere.com.cn
InstallAnywhere 是领先的多平台安装解决方案,供软件生产商使用。它为所有支持的平台提供统一的、自定义的安装体验,快速而且简单。InstallAnywhere 提供完整的高品质安装工具套件,以生成功能全面、灵活的安装程序。它包含大量的新功能,让您的软件部署和客户端配置易如反掌。有了 InstallAnywhere,您可专心开发优秀的软件,而不用在意如何部署软件。
Installanywhere 中文官方网站
http://www.installanywhere.com.cn

InstallShield 2008 => 2009 新特性
八个升级到InstallShield 2009 的理由:
● InstallShield 2009 通过InstallShield 预取器在统一的安装界面连接多个MSI文件
● 微软 Installer 4.5 支持
● Visual Studio 2008 支持
● .NET Framework 3.5 支持
● Managed-Code Custom Action 支持,允许整合多个模块化工程
● Installing Multiple Product Instances 允许支持多个产品示例
● 允许MSI文件在同一台机器安装多个示例
● 增强的希伯来文和阿拉伯文的支持

InstallShield 简介
著名的专业安装程序制作软件,支持修改Autoexec.bat, config.sys、注册表、加入产品德注册码,自动生成反安装程序,功能非常强大。
它有以下几种版本:
InstallShield Premier Edition
InstallShield Professional Edition
InstallShield Premier Edition - 功能最强大、最灵活的Windows安装方案。主要功能有无与伦比的Windows Installer(MSI)支持、结合了Visual Studio .NET、补丁的创建、可视化对话框编辑器(Visual Dialog Editor)、源代码控件。(此版本包含了老版本中的东方语言包和西方语言包)
InstallShield Professional – 专业版 是商业和企业开发商们进行创建复杂的企业标准版Windows安装程序的明智选择!
销售热线:021-62128912/010-64616123
销售邮箱:sales@XLsoft.com.cn
XLsoft网站:http://www.xlsoft.com.cn/

InstallShield 中文官方网站
http://www.installanywhere.com.cn


  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航:
 
<2007年7月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

导航

统计

常用链接

留言簿(6)

随笔档案

文章档案

eclipse

搜索

最新评论

阅读排行榜

评论排行榜