【IzPack】使用----install.xml
发布时间:2020-12-15 22:28:33 所属栏目:百科 来源:网络整理
导读:为什么要先介绍install.xml这个文件呢,因为这个文件太重要了,地位犹如Ant中的build.xml,maven中的pom.xml。install.xml直接定义了安装包的界面、显示窗口、使用的类、语言等等。弄懂了install.xml,就可以很轻松的定制自己的安装程序。 ?xml version="1.0"
为什么要先介绍install.xml这个文件呢,因为这个文件太重要了,地位犹如Ant中的build.xml,maven中的pom.xml。install.xml直接定义了安装包的界面、显示窗口、使用的类、语言等等。弄懂了install.xml,就可以很轻松的定制自己的安装程序。
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <!-- A sample installation file. Use it as a base for your own installers :-) To compile it : - go in the bin directory where you installed IzPack - call "compile ../sample/install.xml -b ../sample" --> <installation version="1.0"> <!-- 程序基本信息 --> <info> <appname>台站系统</appname> <appversion>1.0</appversion> <authors> <author name="**" email=""/> <author name="**" email=""/> </authors> <url>http://csdn.net</url> <javaversion>1.6</javaversion> </info> <!-- 安装程序窗口大小、字体大小、间距等设置 --> <guiprefs width="640" height="480" resizable="no"> <laf name="looks"> <os family="windows" /> <param name="variant" value="windows" /> </laf> <laf name="substance"> <os family="windows" /> <param name="variant" value="business-blue" /> </laf> <modifier key="useButtonIcons" value="yes"/> <modifier key="labelFontSize" value="1.5"></modifier> <modifier key="layoutAnchor" value="CENTER"/> <modifier key="useLabelIcons" value="yes"/> <modifier key="useHeadingPanel" value="yes"/> <modifier key="headingBackgroundColor" value="0x00ffffff"/> <modifier key="headingPanelCounter" value="progressbar"/> <modifier key="headingPanelCounterPos" value="inNavigationPanel"/> <modifier key="allYGap" value="4"/> <modifier key="paragraphYGap" value="10"/> <modifier key="filler1YGap" value="5"/> <modifier key="filler3XGap" value="10"/> </guiprefs> <!-- The locale section. Asks here to include the English and French langpacks. 语言选项 --> <locale> <langpack iso3="chn"/> </locale> <!-- The resources section. The ids must be these ones if you want to use the LicencePanel and/or the InfoPanel. 引入的资源 --> <resources> <res id="userInputSpec.xml" src="userInputSpec.xml"/> <res id="ProcessPanel.Spec.xml" src="ProcessPanel.Spec.xml"/> <res id="shortcutSpec.xml" src="shortcutSpec.xml"/> </resources> <!-- The panels section. We indicate here which panels we want to use. The order will be respected. 需要哪些panel,panel就是窗口,列出的顺序也是显示的顺序 --> <panels> <panel classname="HelloPanel"/> <panel classname="TargetPanel"/> <panel classname="PacksPanel"/> <panel classname="UserInputPanel" id="jdbc.parameters"> <validator classname="ConnectionValidation"/> </panel> <panel classname="InstallPanel"/> <panel classname="UserInputPanel" id="station.parameters"/> <panel classname="ProcessPanel"/> <panel classname="ShortcutPanel"/> <panel classname="FinishPanel"/> </panels> <!-- 设置常量 --> <variables> <variable name="InstallerFrame.logfilePath" value="$INSTALL_PATH/log/install.log" /> <variable name="DesktopShortcutCheckboxEnabled" value="true" /> </variables> <!-- 引入自定义类和第三方jar --> <jar src="station_test.jar" stage="install"/> <jar src="jtds-1.2.4.jar" stage="install"/> <jar src="ibatis2-common-2.1.7.597.jar" stage="install"/> <!-- 引入本地类库,创建快捷方式时需要用到 --> <native type="izpack" name="ShellLink.dll"/> <native type="izpack" name="ShellLink_x64.dll"/> <!-- The packs section. We specify here our packs. 需要打包的文件或文件夹,以及打包的地址 --> <packs> <pack name="tomcat" required="yes"> <description>tomcat server</description> <file src="../tomcat7" targetdir="$INSTALL_PATH"/> <!-- The file will be parsed --> </pack> <pack name="station" required="yes"> <description>station</description> <file src="../station" targetdir="$INSTALL_PATH"/> <!-- Reccursive adding --> </pack> </packs> </installation> 上面是一个install.xml文件一个例子,其中添加了一些注释,下面详细讲一下各个标签的使用和作用:
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |