mirror of https://github.com/sbt/sbt.git
Added UI to windows MSI.
* Can now select installation directory of SBT. * Can optionally add SBT to the path, instead of required. * Displays a license agreement to the user.
This commit is contained in:
parent
e5a861fdd8
commit
1a2435f746
|
|
@ -86,8 +86,16 @@ object Packaging {
|
||||||
|
|
||||||
// WINDOWS SPECIFIC
|
// WINDOWS SPECIFIC
|
||||||
name in Windows := "sbt",
|
name in Windows := "sbt",
|
||||||
wixConfig <<= (sbtVersion) map { (sv) =>
|
lightOptions ++= Seq("-ext", "WixUIExtension", "-cultures:en-us"),
|
||||||
val version = (sv split "\\.") match {
|
wixConfig <<= (sbtVersion, sourceDirectory in Windows) map makeWindowsXml,
|
||||||
|
//wixFile <<= sourceDirectory in Windows map (_ / "sbt.xml"),
|
||||||
|
mappings in packageMsi in Windows <+= sbtLaunchJar map { f => f -> "sbt-launch.jar" },
|
||||||
|
mappings in packageMsi in Windows <+= sourceDirectory in Windows map { d =>
|
||||||
|
(d / "sbt.bat") -> "sbt.bat" }
|
||||||
|
)
|
||||||
|
|
||||||
|
def makeWindowsXml(sbtVersion: String, sourceDir: File) = {
|
||||||
|
val version = (sbtVersion split "\\.") match {
|
||||||
case Array(major,minor,bugfix, _*) => Seq(major,minor,bugfix, "1") mkString "."
|
case Array(major,minor,bugfix, _*) => Seq(major,minor,bugfix, "1") mkString "."
|
||||||
case Array(major,minor) => Seq(major,minor,"0","1") mkString "."
|
case Array(major,minor) => Seq(major,minor,"0","1") mkString "."
|
||||||
case Array(major) => Seq(major,"0","0","1") mkString "."
|
case Array(major) => Seq(major,"0","0","1") mkString "."
|
||||||
|
|
@ -113,25 +121,34 @@ object Packaging {
|
||||||
<Directory Id='INSTALLDIR' Name='sbt'>
|
<Directory Id='INSTALLDIR' Name='sbt'>
|
||||||
<Component Id='SbtLauncherScript' Guid='*'>
|
<Component Id='SbtLauncherScript' Guid='*'>
|
||||||
<File Id='sbt_bat' Name='sbt.bat' DiskId='1' Source='sbt.bat' />
|
<File Id='sbt_bat' Name='sbt.bat' DiskId='1' Source='sbt.bat' />
|
||||||
<Environment Id="PATH" Name="PATH" Value="[INSTALLDIR]" Permanent="no" Part="last" Action="set" System="yes" />
|
|
||||||
</Component>
|
</Component>
|
||||||
<Component Id='SbtLauncherJar' Guid='*'>
|
<Component Id='SbtLauncherJar' Guid='*'>
|
||||||
<File Id='sbt_launch_jar' Name='sbt-launch.jar' DiskId='1' Source='sbt-launch.jar' />
|
<File Id='sbt_launch_jar' Name='sbt-launch.jar' DiskId='1' Source='sbt-launch.jar' />
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component Id='SbtLauncherPath' Guid='17EA4092-3C70-11E1-8CD8-1BB54724019B'>
|
||||||
|
<CreateFolder/>
|
||||||
|
<Environment Id="PATH" Name="PATH" Value="[INSTALLDIR]" Permanent="no" Part="last" Action="set" System="yes" />
|
||||||
|
</Component>
|
||||||
</Directory>
|
</Directory>
|
||||||
</Directory>
|
</Directory>
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
<Feature Id='SbtLauncher' Title='Sbt Launcher Script' Level='1'>
|
<Feature Id='Complete' Title='Simple Build Tool' Description='The windows installation of Simple Build Tool.'
|
||||||
|
Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR'>
|
||||||
|
<Feature Id='SbtLauncher' Title='Sbt Launcher Script' Description='The application which downloads and launches SBT.' Level='1'>
|
||||||
<ComponentRef Id='SbtLauncherScript'/>
|
<ComponentRef Id='SbtLauncherScript'/>
|
||||||
<ComponentRef Id='SbtLauncherJar' />
|
<ComponentRef Id='SbtLauncherJar' />
|
||||||
</Feature>
|
</Feature>
|
||||||
|
<Feature Id='SbtLauncherPathF' Title='Add SBT to windows system PATH' Description='This will append SBT to your windows system path.' Level='1'>
|
||||||
|
<ComponentRef Id='SbtLauncherPath'/>
|
||||||
|
</Feature>
|
||||||
|
</Feature>
|
||||||
|
|
||||||
|
<UIRef Id="WixUI_Mondo"/>
|
||||||
|
<UIRef Id="WixUI_ErrorProgressText"/>
|
||||||
|
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
|
||||||
|
<WixVariable Id="WixUILicenseRtf" Value={sourceDir.getAbsolutePath + "\\License.rtf"} />
|
||||||
</Product>
|
</Product>
|
||||||
</Wix>)
|
</Wix>)
|
||||||
},
|
}
|
||||||
//wixFile <<= sourceDirectory in Windows map (_ / "sbt.xml"),
|
|
||||||
mappings in packageMsi in Windows <+= sbtLaunchJar map { f => f -> "sbt-launch.jar" },
|
|
||||||
mappings in packageMsi in Windows <+= sourceDirectory in Windows map { d =>
|
|
||||||
(d / "sbt.bat") -> "sbt.bat" }
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue