ltapilot commented on a change in pull request #178: Created Windows MSI 
installer package.
URL: https://github.com/apache/incubator-daffodil/pull/178#discussion_r256137772
 
 

 ##########
 File path: daffodil-cli/build.sbt
 ##########
 @@ -71,3 +78,165 @@ rpmRelease := {
 rpmLicense := Some(licenses.value.map { case (n: String, _) => n }.mkString(" 
and "))
 
 rpmPrefix := Some(defaultLinuxInstallLocation.value)
+
+//
+// Windows configuration
+//
+
+//
+// Here we set the variables that are supported by the SBT WiX plug-in.
+// We also get fairly aggressive in editing/modifying the XML in order
+// to control and use some specific features that are supported by WiX
+// but which are not properly suported by the SBT plug-in. The changes
+// range from deleting an incorrect UI reference to adding whole files
+// to the body of code that is fed to the WiX compiler (candle) and
+// linker (light). We also change some attributes and such with a
+// ReWriter at the end. The comments should, at the very least, allow
+// you to follow the intent of each channge.
+//
+
+// Map variables from Universal as a starting point (default).
+mappings in Windows := (mappings in Universal).value
+
+// Force the correct installation directory name. This overwrites
+// 'daffodil-cli', which is the directory that we invoke sbt in.
+// The SBT WiX plug-in incorrectly assumes that the directory of
+// invocation is the same name as the direcotry you eventually
+// want to install into.
+name in Windows := "Daffodil" 
+
+// The Windows packager SBT plug-in maps the maintainer variable into
+// the WiX ManufacturerFullName field. This is a very strange choice.
+// It also maps it to the manufacturer name in the installation
+// directory heirarchy. Among other things, this means it needs to be
+// short so as to not blow out the path length.
+maintainer in Windows := "Apache"
+
+// The Windows packager SBT plug-in maps the packageSummary variable
+// into the WiX productName field. Another strange choice. 
+packageSummary in Windows := "Daffodil"
+
+// The Windows packager SBT plug-in limits the length of the
+// packageDescription field to a single line. Originally this was a
+// full paragraph, as seen in the RPM section, above.
+packageDescription in Windows := """Apache Daffodil (incubating) is the open 
source implementation of the Data Format Description Language (DFDL)""".trim
+
+// Calculate the version number dynamically and pass it in.
+version in Windows := {
+  val parts = version.value.split("-", 2)
+  val ver = parts(0) // removes snapshot if it exists
+  ver + ".0"
+}
+
+// Required and critical GUIDs. Ironically the ProductId is unique
+// to a given release, but UpgradeId must NEVER change! This may
+// seem conter-intuitive, but the UpgradeId is actually what ties
+// the product to it's upgrades and the product is actually unique
+// each time it is released, so there is some semblance of logic
+// to this scheme.
+wixProductId := "F803A6CD-3008-4979-86BB-C6094AE57CD2"
+wixProductUpgradeId := "4C966AFF-585E-4E17-8CC2-059FD70FEC77"
+
+// Light options. Bring in standard dialog boxes and localization.
+// The suppression of ICE61 is required as we *DO* permit
+// re-installation of the same version. Despite the presence of
+// specific XML to enable this, the WiX compiler and linker
+// complain about it unless you specifically suppress the warning.
+lightOptions := Seq("-sice:ICE61", "-ext", "WixUIExtension", 
"-cultures:en-us", "-loc", sourceDirectory.value + 
"\\windows\\Product_en-us.wxl")
+
+// Point to the RTF license file so it will appear in the license
+// acceptance dialog box. BTW, this file was hand-sweetened to permit
+// flexible line/word wrap in support of variable display width as the
+// file will be rendered in both the (relatively narrow) dialog box
+// and ()optionally) sent to the (relatively wide) printer when the
+// user asks for hard copy.
+wixProductLicense := Option(file("daffodil-cli/src/windows/LICENSE.rtf"))
+
+// Use the wixFiles variable to add in the Daffodil-specific dialog
+// boxes and sequence.
+wixFiles ++= Seq(
+  file(sourceDirectory.value + "\\windows\\WixUI_DFDL.wxs"),
+  file(sourceDirectory.value + "\\windows\\DisclaimerDlg_DFDL.wxs")
 
 Review comment:
   Okay now. Changed how this is done so that it works.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to