一、前提条件准备:
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可打包完成