Class InnoSetupTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
io.github.intisy.gradle.inno.InnoSetupTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

public class InnoSetupTask extends org.gradle.api.DefaultTask
Gradle task that builds a Windows installer using Inno Setup.

Required: fileName, name, jrePath. Optional: icon, version, parameters, autoStartParameters, autoStart, debug. Produces an installer executable under the project's build directory.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Task

    org.gradle.api.Task.Namer
  • Field Summary

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executes the task to build the Windows installer via Inno Setup.
     
     
     
     
    @NotNull String
     
     
     
     
    boolean
     
    boolean
     
    void
    setAutoStart(boolean autoStart)
    Enables or disables creation of a Startup shortcut.
    void
    setAutoStartParameters(List<String> autoStartParameters)
    Sets parameters passed when launching from the Startup shortcut.
    void
    setDebug(boolean debug)
    Enables debug logging for the build process.
    void
    Sets an optional icon file path (relative to project dir) for the installer and shortcuts.
    void
    setInfile(String infile)
    Sets the file name of the application executable to package.
    void
    setJrePath(String jrePath)
    Sets the path to the JRE directory to bundle in the installer.
    void
    Sets the application display name.
    void
    setOutfile(String outfile)
    Sets the file name of the application executable to package.
    void
    setParameters(List<String> parameters)
    Sets parameters passed when launching the app after installation.
    void
    setVersion(String version)
    Sets the application version recorded in the installer metadata.

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, getConvention, notCompatibleWithConfigurationCache
  • Constructor Details

    • InnoSetupTask

      public InnoSetupTask()
  • Method Details

    • setInfile

      public void setInfile(String infile)
      Sets the file name of the application executable to package.
      Parameters:
      infile - executable file name under build/libs
    • setOutfile

      public void setOutfile(String outfile)
      Sets the file name of the application executable to package.
      Parameters:
      outfile - executable file name under build/libs
    • setName

      public void setName(String name)
      Sets the application display name.
      Parameters:
      name - human-readable application name
    • setIcon

      public void setIcon(String icon)
      Sets an optional icon file path (relative to project dir) for the installer and shortcuts.
      Parameters:
      icon - relative path to an .ico file
    • setVersion

      public void setVersion(String version)
      Sets the application version recorded in the installer metadata.
      Parameters:
      version - version string (e.g., 1.2.3)
    • setAutoStartParameters

      public void setAutoStartParameters(List<String> autoStartParameters)
      Sets parameters passed when launching from the Startup shortcut.
      Parameters:
      autoStartParameters - list of parameters or null
    • setParameters

      public void setParameters(List<String> parameters)
      Sets parameters passed when launching the app after installation.
      Parameters:
      parameters - list of parameters or null
    • setJrePath

      public void setJrePath(String jrePath)
      Sets the path to the JRE directory to bundle in the installer.
      Parameters:
      jrePath - path to a JRE folder
    • setAutoStart

      public void setAutoStart(boolean autoStart)
      Enables or disables creation of a Startup shortcut.
      Parameters:
      autoStart - true to add Startup shortcut
    • setDebug

      public void setDebug(boolean debug)
      Enables debug logging for the build process.
      Parameters:
      debug - true to enable verbose logging
    • getOutfile

      @Optional @Input public String getOutfile()
      Returns:
      the executable file name to package
    • getInfile

      @Optional @Input public String getInfile()
      Returns:
      the executable file name to package (preferred over outfile if set)
    • getName

      @NotNull @Input public @NotNull String getName()
      Specified by:
      getName in interface org.gradle.api.Task
      Overrides:
      getName in class org.gradle.api.DefaultTask
      Returns:
      the application display name
    • getIcon

      @Optional @Input public String getIcon()
      Returns:
      the optional icon path relative to the project, or null
    • getVersion

      @Optional @Input public String getVersion()
      Returns:
      the application version string
    • getAutoStartParameters

      @Optional @Input public List<String> getAutoStartParameters()
      Returns:
      parameters for Startup shortcut or null
    • getParameters

      @Optional @Input public List<String> getParameters()
      Returns:
      parameters passed when launching after install or null
    • getJrePath

      @Optional @Input public String getJrePath()
      Returns:
      the JRE folder path to bundle
    • isAutoStart

      @Input public boolean isAutoStart()
      Returns:
      true if a Startup shortcut should be created
    • isDebug

      @Input public boolean isDebug()
      Returns:
      true if debug logging is enabled
    • createExe

      public void createExe()
      Executes the task to build the Windows installer via Inno Setup.

      Validates required properties, configures the InnoSetup helper, and triggers the build process.