Skip to content

Commit 40941cb

Browse files
committed
Merge pull request #33 from ptrbrtz/master
Fixed typo, shortened hash string padding and removed debug printlns
2 parents 756ac36 + b572b79 commit 40941cb

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/main/scala/com/typesafe/sbt/PackagerPlugin.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object SbtNativePackager extends Plugin
2424
windowsSettings ++
2525
universalSettings ++
2626
Seq( // Bad defaults that let us at least not explode users who don't care about native packagers
27-
NativePackagerKeys. maintainer := "",
27+
NativePackagerKeys.maintainer := "",
2828
NativePackagerKeys.packageDescription := "",
2929
NativePackagerKeys.packageSummary := ""
3030
)

src/main/scala/com/typesafe/sbt/packager/windows/WixHelper.scala

+3-5
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,14 @@ object WixHelper {
6565
} yield allParentDirs(file(name))
6666
val filenames = filenamesPrep.flatten.map(_.toString.replaceAll("\\\\","/")).filter(_ != "")
6767
// Now for directories...
68-
def parentDir(filename: String) = {/*println("xxxxxxxxxxx: " + (filename take (filename lastIndexOf '/')));*/ filename take (filename lastIndexOf '/') }
68+
def parentDir(filename: String) = { filename take (filename lastIndexOf '/') }
6969
def simpleName(filename: String) = {
7070
val lastSlash = filename lastIndexOf '/'
7171
filename drop (lastSlash + 1)
7272
}
7373
val dirs = (filenames map parentDir).distinct;
74-
// TODO println("DDDDDDDDDDDDDDD:" + dirs.toString)
7574
// Now we need our directory tree xml?
7675
val dirToChildren = dirs groupBy parentDir;
77-
// TODO println("CCCCCCCCCCCCCCC:" + dirToChildren.toString)
7876
def dirXml(currentDir: String): scala.xml.Node = if(!currentDir.isEmpty) {
7977
val children = dirToChildren.getOrElse(currentDir, Seq.empty)
8078
<Directory Id={cleanStringForId(currentDir)} Name={simpleName(currentDir)}>
@@ -194,7 +192,7 @@ object WixHelper {
194192
<MajorUpgrade
195193
AllowDowngrades="no"
196194
Schedule="afterInstallInitialize"
197-
DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will no exit."/>
195+
DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."/>
198196
<UIRef Id="WixUI_FeatureTree"/>
199197
<UIRef Id="WixUI_ErrorProgressText"/>
200198
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
@@ -235,7 +233,7 @@ object WixHelper {
235233
* 72) so we can safely add a few later.
236234
*/
237235
def cleanStringForId(n: String) = {
238-
n.replaceAll("[^0-9a-zA-Z_]", "_").takeRight(50) + (math.abs(n.hashCode).toString + "xxxxxxxxxxxxxxxxxxx").substring(0, 19)
236+
n.replaceAll("[^0-9a-zA-Z_]", "_").takeRight(60) + (math.abs(n.hashCode).toString + "xxxxxxxxx").substring(0, 9)
239237
}
240238

241239
/** Cleans a file name for the Wix pre-processor. Every $ should be doubled. */

0 commit comments

Comments
 (0)