izpack 使用说明
最近做项目需要做打包发布,查阅了好多开源、商业软件,对比如下:
1、jsmooth:
优点: 使用简单、有ui界面、可以将jar文件打包为exe文件
可以打包独立与jdk的安装包
缺点:没有安装过程,单单一个exe文件,在windows大行其道下,显得不够专业
2、izpack:
优点:功能强大、熟悉ant的就完全会使用。有类似windows的安装界面,可以设定序列号、可以配置数据库、可以环境校验等等。
缺点:没有ui,都是xml配置语言;打包后还是一个jar文件,不能直接是exe;安装文件必须依靠jre环境;服了,服了,izpack的文档写的太差了,sample要么就太简单,要么没有一个完整的例子!
izpack 4.2 下载地址
官方的连接地址没有修改,无法下载
正确的下载地址:
http://dist.codehaus.org/izpack/releases/4.2.0/
1、
3、installshield
优点:不用说的是当前最专业的打包工具
缺点:商业软件非开源,但是还好有好多破解版,本人使用了installshield 2009破解版(需要的留言),界面那叫一个帅! 但是对于java打包来说,优点不顺路(主要符合微软系列的软件、delphi等等)。当然如果要完成java的打包也是完全胜任的,不过你的花些时间和经理,学习installscript来自己写脚本!
综合了以上几点(每个软件,俺都使用了),最后还是选择了izpack,把使用心得整理出来,如下:
这个打包,主要是为公司开发的“ezSMS短信群发”做的安装程序。
ezSMS:直接利用手机,完成短信群发的功能
支持ACCESS-客户数据库
支持文本客户列表
支持MySQL、MSSQL、ORACLE客户数据库
使用简单
本安装程序脚本解决内容:
1简要了安装系统
2、 设置了shortcut
3、 Copy若干文件
4、 测试了中文
如下:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
<info>
<appname>ezSMS</appname>
<appversion>1.0</appversion>
<authors>
<author name="jxc114" email="jxc114@163.com"/>
<author name="wanhq" email="wanhanqiu@gmail.com"/>
</authors>
<url>http://www.jxc114.com/bbs/</url>
<javaversion>1.5</javaversion>
</info>
<variables>
<variable name="InstallerFrame.logfilePath" value="$INSTALL_PATH/log/My-install.log"/>
<variable name="desktopshortcutcheckboxenabled" value="true"/>
</variables>
<conditions>
<condition type="java" id="installonwindows">
<java>
<class>com.izforge.izpack.util.OsVersion</class>
<field>IS_WINDOWS</field>
</java>
<returnvalue type="boolean">true</returnvalue>
</condition>
</conditions>
<installerrequirements>
<installerrequirement condition="installonwindows" message="This installer could only be run on Windows operating systems."/>
</installerrequirements>
<!--
The gui preferences indication.
Sets the installer window to 640x480. It will not be able to change the size.
-->
<guiprefs height="600" resizable="no" width="800">
<laf name="looks">
<os family="windows" />
<param name="variant" value="extwin" />
</laf>
</guiprefs>
<!--
The locale section.
Asks here to include the English and French langpacks.
-->
<locale>
<langpack iso3="eng"/>
</locale>
<!--
The resources section.
The ids must be these ones if you want to use the LicencePanel and/or the InfoPanel.
-->
<resources>
<res id="LicencePanel.licence" src="Licence.txt"/>
<res id="InfoPanel.info" src="Readme.txt"/>
<res src="D:/sample/me/shortcutSpec.xml" id="shortcutSpec.xml"/>
</resources>
<!--
The panels section.
We indicate here which panels we want to use. The order will be respected.
-->
<panels>
<panel classname="HelloPanel"/>
<panel classname="InfoPanel"/>
<panel classname="LicencePanel"/>
<panel classname="ShortcutPanel"/>
<panel classname="TargetPanel"/>
<panel classname="PacksPanel"/>
<panel classname="InstallPanel"/>
<panel classname="FinishPanel"/>
</panels>
<!--
The packs section.
We specify here our packs.
-->
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<file src="Readme.txt" targetdir="$INSTALL_PATH"/>
<file src="Licence.txt" targetdir="$INSTALL_PATH"/>
<!-- The file will be parsed -->
</pack>
<pack name="Docs" required="no">
<description>The documentation</description>
<file src="doc" targetdir="$INSTALL_PATH/doc"/>
<!-- Reccursive adding -->
</pack>
<pack name="lib" required="yes">
<description>The sources</description>
<file src="lib/ezsms11111111.jar" targetdir="$INSTALL_PATH/"/>
<file src="lib/ttaa.txt" targetdir="$JAVA_HOME/jre/"/>
<file src="run.bat" targetdir="$INSTALL_PATH/"/>
<file src="lib/log4j- 1.2.9 .jar" targetdir="$INSTALL_PATH/lib/"/>
<file src="start.ico" targetdir="$INSTALL_PATH/Icons/"/>
</pack>
</packs>
<native type="izpack" name="ShellLink.dll" stage="install"/>
</installation>
更多关于izpack的使用心得,可以参见http://www.jxc114.com/bbs/forum-60-1.html
欢迎大家讨论!