使用AntInstaller制作安装程序

今天用antinstaller来制作了一下安装程序,总结一下:

(1)antinstaller是使用xml来描述安装界面,并调用ant的脚本来执行一些操作。可以在安装界面中设置一些需要用户填写的属性,然后根据这些属性去执行build.xml。

(2)antinstall会使用到user.home中的temp作为临时文件jar。不过可以在安装完成之后自己编写ant脚本去删除临时文件。

问题:

(1)swing的乱码问题。

修改antinstall的程序,在执行org.tp23.antinstaller.selfextract.SelfExtractor的init方法之前设置字体。具体如下:
   Font _font = new Font("宋体", Font.PLAIN, 12);
   FontUIResource fontRes = new FontUIResource(_font);
   for (Enumeration keys = UIManager.getDefaults().keys(); keys
     .hasMoreElements();) {
    Object key = keys.nextElement();
    Object value = UIManager.get(key);
    if (value instanceof FontUIResource) {
     UIManager.put(key, fontRes);
    }
   }

(2)unzip乱码问题

    发现unzip的时候也出现乱码,增加unzip的encoding=“GBK”

(3)编写ant-install-config.xml

(4)编写build.xml 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值