用jsmooth + inno生成exe并制作简单安装包

来源:互联网 发布:sql数据库查看器 编辑:程序博客网 时间:2024/05/16 00:28

jar + jsmooth + inno%26nbsp;

思路:先由 Jsmooth把jar和相关资源打包生成exe,再由Inno把exe和资源文件打成安装包

%26nbsp;

%26nbsp;

一%26nbsp; Jsmooth

%26nbsp;

%26nbsp;

1 下载 安装 Jsmooth%26nbsp;%26nbsp; 地址:jsmooth.sourceforge.net

%26nbsp;

%26nbsp;

%26nbsp;

2启动

%26nbsp;

3welcome

%26nbsp;

4skecton%26nbsp;勾选进程,单例

%26nbsp;

%26nbsp;

5Executable需要指定将来生成的exe的名字和位置以及对应的图标。这里用png最好,自己以前用的ico格式的不识别%26nbsp;%26nbsp;%26nbsp;current Directory如果勾选则是相对目录%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;这步结束后建议点击保存图标,把此前过程保存起来等下次直%26nbsp;接打开%26nbsp;%26nbsp;

%26nbsp;

%26nbsp;

6Appliction最好首先添加Classpath中的jar和其它资源。可以选择将一个jar嵌入到将来的exe中,这点对保护源代码最好不过。最后指定主类

%26nbsp;

7JVM%26nbsp; select指定jvm版本范围,指定是否携带独立的jre(好处是不管目标机器是否安装java都可以运行,缺点压缩包比较大)

8JVM Configure配置jvm参数和memory大小范围

%26nbsp;

%26nbsp;

9编译%26nbsp;点击小齿轮编译成功,之后去指定目录查看运行生成的exe%26nbsp;%26nbsp;%26nbsp;%26nbsp;本例生成的是myexe.exe%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;本例主要目标是把EC.jar打包成myexe.exe,其它都是资源和依赖文件

%26nbsp;

%26nbsp;

%26nbsp;

=======================================================================

二 Inno%26nbsp;

%26nbsp;

%26nbsp;

%26nbsp;

1下载 安装 Inno%26nbsp;%26nbsp; 地址:http://www.jrsoftware.org

%26nbsp;

%26nbsp;

2启动 新建项目,基本很简单就是一直点next

%26nbsp;

%26nbsp;

%26nbsp;

3选择exe和依赖的资源注意在添加其它资源时,如果是整个资源文件夹那么,添加后系统只会添加子文件和子文件夹,%26nbsp;%26nbsp;%26nbsp;%26nbsp;所有如果要保留整个文件结构,则需要将这个文件再放到一个新文件夹中,就是再多一层嵌套,%26nbsp;%26nbsp;%26nbsp;%26nbsp;这个新文件夹名无所谓,随便起%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;

%26nbsp;

%26nbsp;

%26nbsp;

%26nbsp;

%26nbsp;

%26nbsp;

%26nbsp;

4确认,生成脚本并保存,一直确认YES,到结束

%26nbsp;

%26nbsp;

%26nbsp;

5查看生成的Installer可以进行安装测试,整体结束

%26nbsp;

%26nbsp;

三 注意和问题

%26nbsp;

%26nbsp;

%26nbsp;

%26nbsp;

jsmooth 需要讲ec.jar 嵌入到exe中去,所以在打安装包的时候就不需要ec.jar了 也是安全%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;jsmooth 在选择可执行的二进制文件时 一定要自己命名 比%26nbsp;如 xxx.exe%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;保存的脚本格式例如 abc.jsmooth%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;inno 坑%26nbsp;%26nbsp; 在添加资源的时候 如果是folder%26nbsp; ,在安装后会进到子文件里 所有 要多加一层%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;myexe.exe要运行起来 必须有个 jre 文件夹 其中包括了 运行时环境(可以自带jre独立),Data 和相关的DLL都放到该目录中。%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;两个问题%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;1%26nbsp; icon 不识别 需要弄个%26nbsp; png格 式%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;2%26nbsp; dll的注册与注销%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;

%26nbsp;

%26nbsp;

0 0
原创粉丝点击