当前位置: 首页 > news >正文

java程序打包成exe,再打成安装包,没有jdk环境下可运行

一、前提条件准备:

	1、要被打包的程序文件:rest_assistant-1.0-SNAPSHOT.jarapplication.yml2、图标文件tubiao123.ico3、jre4、打包成exe的软件 config.exe4j5、打成安装包的软件 Inno Setup Compiler

在这里插入图片描述

二、config.exe4j 的 exe打包配置步骤

按照以下图进行配置
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

三、用Inno Setup Compiler打成安装包

没打包过创建新的打包配置文件,打包过的用之前的配置
在这里插入图片描述
具体打包配置如下:

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!#define MyAppName "restfz"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "restfz.exe"[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{10C48B0B-0D38-4AE2-9409-E44E1DBCB7D3}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputDir=C:\Users\Administrator\Desktop\rest_zuixin
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "startupicon"; Description: "开机启动"; GroupDescription: "{cm:AdditionalIcons}";[Files]
Source: "C:\Users\Administrator\Desktop\rest_bin\restfz.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Administrator\Desktop\rest_bin\application.yml"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Program Files\Java\jdk1.8.0_202\jre\*"; DestDir: "{app}\jre"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon[Registry] 
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run";ValueType: string; ValueName: "testrun";ValueData: "{app}\{#MyAppExeName}" [Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

运行run可打包完成
在这里插入图片描述

四、以上打包完成,其他打包步骤如下图

在这里插入图片描述

http://www.dtcms.com/a/333049.html

相关文章:

  • 【完整源码+数据集+部署教程】孔洞检测系统源码和数据集:改进yolo11-RetBlock
  • 金刚石基植入体新突破!Adv. Funct. Mater. 报道首例增材制造固态摩擦电能量收集器
  • 【FastGTP✨】[01] 使用 FastGPT 搭建简易 AI 应用
  • 部署Qwen-Image,通过API返回可访问的图像URL
  • 以下是对智能电梯控制系统功能及系统云端平台设计要点的详细分析,结合用户提供的梯控系统网络架构设计和系统软硬件组成,分点论述并补充关键要点:
  • 一文打通 AI 知识脉络:大语言模型等关键内容详解
  • 铨林接纸机学习记录1
  • AI智能文档生成系统需求规格说明书
  • Linux 进程、线程与 exec/系统调用详解
  • MySQL中的字符串函数
  • PowerShell 格式化系统完全掌握(下):自定义列/格式字符串/对齐与宽度 + 实战模板
  • 抗日胜利80周年 | HTML页面
  • 智和信通全栈式运维平台落地深圳某学院,赋能运维管理提质提效
  • TCP传输层协议(4)
  • 微信实名认证组件
  • 二十四、Mybatis-基础操作-删除(预编译SQL)
  • SAP ALV导出excel 报 XML 错误的 /xl/sharedStrings.xml
  • Android协程的用法大全
  • 汽车电子:现代汽车的智能核心
  • Unity_数据持久化_Json
  • 使用原生css实现word目录样式,标题后面的...动态长度并始终在标题后方(生成点线)
  • 第七十章:告别“手写循环”噩梦!Trainer结构搭建:PyTorch Lightning让你“一键炼丹”!
  • Codeforces Deque工艺
  • 用 FreeMarker 动态构造 SQL 实现数据透视分析
  • STM32学习笔记12-串口数据包收发FlyMcuST-LINK Utility
  • Shortest Routes II(Floyd最短路)
  • 管家婆辉煌系列试用版/期限说明
  • Shader开发(十三)理解片元插值
  • 淘米自动签到脚本
  • 大气负氧离子自动监测站:解密空气的科技密码