Class InnoSetup
java.lang.Object
io.github.intisy.gradle.inno.impl.InnoSetup
Orchestrates preparing sources and invoking Inno Setup to build a Windows installer.
Handles copying inputs (executable, JRE, optional icon), generating the Inno Setup script, downloading the tool (cached under Gradle home), and executing the compiler to produce the final installer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBuilds the installer by preparing sources, generating the script, and invoking Inno Setup.voidCopies input executable, JRE, and optional icon into the build source directory.voidcreateInnoSetupScript(File scriptPath) Creates the Inno Setup script file used by the compiler.voidLogs a message if debug mode is enabled.voidsetAutoStart(boolean autoStart) Enables or disables creating a Startup entry to auto-launch the app after login.voidsetAutoStartParameters(List<String> autoStartParameters) Sets optional parameters passed to the app when launched from Startup.voidsetDebug(boolean debug) Enables debug logging of the Inno Setup process output.voidsetIconFile(File iconFile) Sets an optional icon file for the installer and shortcuts.voidsetInnoBuildPath(Path innoBuildPath) Sets the Inno Setup build directory.voidsetInputFile(File inputFile) Sets the application executable to package.voidsetJrePath(Path jrePath) Sets the path to a bundled JRE to include in the installer.voidSets the application display name.voidsetOutputFile(File outputFile) Sets the resulting installer file destination.voidsetParameters(List<String> parameters) Sets optional parameters passed to the app when launched post-install.voidsetVersion(String version) Sets the application version written to the installer metadata.
-
Constructor Details
-
InnoSetup
Creates a new InnoSetup helper bound to the given project build path and inputs.- Parameters:
logger- logger to use for logging messages
-
-
Method Details
-
setName
Sets the application display name.- Parameters:
name- application display name
-
setInnoBuildPath
Sets the Inno Setup build directory.- Parameters:
innoBuildPath- Inno Setup build directory
-
setInputFile
Sets the application executable to package.- Parameters:
inputFile- executable file to package
-
setOutputFile
Sets the resulting installer file destination.- Parameters:
outputFile- installer file destination
-
setAutoStart
public void setAutoStart(boolean autoStart) Enables or disables creating a Startup entry to auto-launch the app after login.- Parameters:
autoStart- true to add a Startup shortcut, false otherwise
-
setIconFile
Sets an optional icon file for the installer and shortcuts.- Parameters:
iconFile- ICO file to use as setup icon
-
setVersion
Sets the application version written to the installer metadata.- Parameters:
version- version string (e.g., 1.2.3)
-
setJrePath
Sets the path to a bundled JRE to include in the installer.- Parameters:
jrePath- path to the JRE directory
-
setDebug
public void setDebug(boolean debug) Enables debug logging of the Inno Setup process output.- Parameters:
debug- true to print logs, false to silence
-
setAutoStartParameters
Sets optional parameters passed to the app when launched from Startup.- Parameters:
autoStartParameters- list of parameters, or null for none
-
setParameters
Sets optional parameters passed to the app when launched post-install.- Parameters:
parameters- list of parameters, or null for none
-
log
Logs a message if debug mode is enabled.- Parameters:
log- message to print
-
buildInstaller
Builds the installer by preparing sources, generating the script, and invoking Inno Setup.- Throws:
IOException- if file operations failInterruptedException- if the external process is interrupted
-
copySourceFiles
Copies input executable, JRE, and optional icon into the build source directory.- Throws:
IOException- if copy operations fail
-
createInnoSetupScript
Creates the Inno Setup script file used by the compiler.- Parameters:
scriptPath- output path for the generated .iss script- Throws:
IOException- if writing the file fails
-