Running wix from build.gradle using .execute()

(John Scarrott) #1

I have a build.gradle that compiles my project, runs test creates a jar then packages that with launch4j. I want to be able to use wix to create a installer as well, however I seem to be having a lot of trouble launching it from .execute().

The files necessary for candle and light are held in \build\installer. However trying to access those files by calling execute in the build file is always met with failure.

I have made a second build.gradle in /build/installer that does work. It is:

task buildInstaller {
  def command = project.rootDir.toString() + "//" +"LSML Setup.wxs"
def candleCommand = ['candle', command]
    def candleProc = candleCommand.execute()
def lightCommand = ['light' , '-ext', 'WixUIExtension', "LSML Setup.wixobj"]
def lightProc = lightCommand.execute()

Is there some way I can run the second build file from the main one and have it work or is there a way to call execute directly and have it work?