SetupBuilder icon indicating copy to clipboard operation
SetupBuilder copied to clipboard

DSL-extension for MSI installation directory?

Open mithomas opened this issue 6 years ago • 6 comments

When using SetupBuilder for packaging MSIs we almost always have the requirement of specifying the installation directory by directly specifying <Property Id="INSTALLDIR" Value="C:\PathToInstall"/>.

I propose the addition of a parameter installDir for the MSI task to set this directly in build.gradle.

Usage would then be like so:

msi {
  from "bin"
  include "**/*"

  installDir = 'C:\PathToInstall'
}

If this proposal is accepted, I would take care of the implementation.

mithomas avatar Jun 11 '18 08:06 mithomas

Another viable option would be to generalize this to allow any property:

msi {
  property {
    name = "name"
    value = "value"
  }
}

mithomas avatar Jun 11 '18 11:06 mithomas

Why you want not use the default install path? It is not recommended to install in the disk root.

I think the follow syntax is simpler:

msi {
  property 'name', 'value'
}

or

msi {
  properties = ['name': 'value', 'name2': 'value2']
}

internally its should be saved in a map.

And which problem do you have with the WXS template file? The target of SetupBuilder plugin is to create a simple native installer for different platforms. It was never the target to handle all the features of WIX.

To understand which properties a user can set he must understand WIX. But then he can use the template self. The properties in a Gradle script should be understandable without WIX. If we add it then I prefer a directly property "installDir".

Horcrux7 avatar Jun 12 '18 19:06 Horcrux7

I am quite aware of the original mission of the plug-in, and yet it is by far the most sophisticated way of using WIX from Gradle and to my knowledge the only one mapping any of the complexity of WXS files to a Gradle DSL. From various discussions on the net I also notice that a lot of people do not use it to generate installers for cross-platform applications but specifically for building MSIs. Both points led me to make my proposal here, since those folks (including myself) might benefit from it.

I am also aware that this proposal does not benefit the other platforms (then again, neither do the settings for languages, signtool or architecture), so if you choose to reject it for not fitting the overall vision of this plug-in, I completely understand - still I thought I'd ask at the place I deemed most fitting :-). (In this case, factoring out the WIX part to a separate plug-in might not be the worst idea from an architectural point of view - then however the SetupBuilder plugin should probably depend on that to avoid duplication of functionality.)

My driver for getting rid of the WXS file is that we have a rather large number of small projects each one generating an MSI package for a specific embedded system and the only reason to keep a WXS file around for most of them is a custom default installation directory (required due to the nature of said embedded system). Moving that into the build file itself would ease maintenance since all relevant info is in one place and avoid repeating the WXS boilerplate code in each project.

mithomas avatar Jun 13 '18 07:06 mithomas

Can values be maps them selves? If you could provide a PR we'd happily review and merge it. I think it should be as transparent as possible which values are allowed and valid. The drive for the SetupBuilder is to take complexity away.

gamma avatar Jul 09 '18 09:07 gamma

Any progress on this?

tlf30 avatar Nov 24 '20 03:11 tlf30

There is no progress.

It is currently recommended that you use the WXS template file for all the Wix-specific settings. There are thousands options possible. If this is not possible or not acceptable for you then you can make a pull request.

Horcrux7 avatar Nov 24 '20 19:11 Horcrux7