Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows MSI + Play 2.2.0 : CNDL0027 : The Shortcut/@Name attribute's value, '\application.conf', is not a valid long name because it contains illegal characters #43

Closed
laguiz opened this issue Sep 24, 2013 · 6 comments

Comments

@laguiz
Copy link
Contributor

laguiz commented Sep 24, 2013

Trying to build MSI package from sample play 2.2 application forms we get this error :

[info] [...] play\play-2.2.0\samples\java\forms\target\windows\forms.wix(1173) : error CNDL0027 : The Shortcut/@Name attribute's value, '\application.conf', is not a valid long name because it contains illegal characters.  Legal long names contain no more than 260 characters and must contain at least one non-period character.  Any character except for the follow may be used: \ ? | > < : / * ".
java.lang.RuntimeException: Unable to run WIX compilation to wixobj...
        at scala.sys.package$.error(package.scala:27)
        at com.typesafe.sbt.packager.windows.WindowsPlugin$$anonfun$windowsSettings$14.apply(WindowsPlugin.scala:81)
        at com.typesafe.sbt.packager.windows.WindowsPlugin$$anonfun$windowsSettings$14.apply(WindowsPlugin.scala:69)
        at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:35)
        at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:34)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
        at sbt.std.Transform$$anon$4.work(System.scala:64)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
        at sbt.Execute.work(Execute.scala:244)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
[error] (windows:packageBin) Unable to run WIX compilation to wixobj...
[error] Total time: 1 s, completed Sep 24, 2013 5:40:27 PM

It looks like plugin generate wrong wix file. In my case :

<Component Id="shortcut_3dd9158d_540a_4728_b759_11203f352fdc1702832501xxxxxxxxx" Guid="1f4b2895-5d8b-46da-9736-a27cf7c4eccb">
    <Shortcut Id="shortcut_3dd9158d_540a_4728_b759_11203f352fdc1702832501xxxxxxxxx_SC" Name="\application.conf" Description="Edit configuration file: \application.conf" Target="[INSTALLDIR]\conf\\application.conf" WorkingDirectory="INSTALLDIR"/>
    <RemoveFolder Id="ApplicationProgramsFolderRemove" Directory="ApplicationProgramsFolder" On="uninstall"/>
    <RegistryValue Root="HKCU" Key="Software\Company\forms" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>

See Name="\application.conf"

Not sure if it's a bug on play-sbt side or an issue with the sbt-native-packager plugin.

Don't know SBT enough to properly investigate but it seems that it's related to PlayScalaSettings:

https://github.com/playframework/playframework/blob/2.2.0/framework/src/sbt-plugin/src/main/scala/play/Project.scala#L49

Would be great if you can confirm if it's a bug on you side or on the play-sbt side?

Original discussion here : https://groups.google.com/forum/#!topic/play-framework/cMzBuei9C2M

Thank you,

@laguiz
Copy link
Contributor Author

laguiz commented Sep 24, 2013

Could it be a missing call to util method cleanStringForId as indicate here:
http://www.scala-sbt.org/sbt-native-packager/windows.html

Play sbt : https://github.com/playframework/playframework/blob/2.2.0/framework/src/sbt-plugin/src/main/scala/PlaySettings.scala#L235

If the issue is here, then how it could be fixed?

mappings in Windows // ...?

If this is not the good place to post, let me know.

@jsuereth
Copy link
Member

To be clear, this is a bug on our side, with how we do automatic mapping. I'll see if I can create a scripted test for this and get a fix. The downside is that I left my windows box at home, and won't be able to try this out for another 2 weeks (I'm on travel currently).

If you have a chance to dig in and issue a fix, the (still somewhat ugly) code to do the mapping from universal -> windows is here: https://github.com/sbt/sbt-native-packager/blob/master/src/main/scala/com/typesafe/sbt/packager/GenericPackageSettings.scala#L106

@laguiz
Copy link
Contributor Author

laguiz commented Sep 25, 2013

Hi, thank you for your feedback. I will try to take a look if I have time today.

@laguiz
Copy link
Contributor Author

laguiz commented Sep 25, 2013

I tried to fix the issue. To fix the issue it was pretty easy but then I got an other error related to wrong DirectoryRef Id.

Here are my 3 commits : https://github.com/laguiz/sbt-native-packager/commits/master

At least it can inspire you to figure out what is the issue. After these commits I'm now able to generate an msi file. MSI file installation is working as well as the Play Forms application.

However I still see an issue with the Windows Shortcut pointing to application.conf (Start / All Programms / My App / wronglinktoapplication.conf). It seems that the 'cleaned Id' is used instead of the real path to the file.

Hope this helps.

@jsuereth
Copy link
Member

Cool, once I have my windows computer, I"ll pull these commits in and see if I can get things running.

@laguiz
Copy link
Contributor Author

laguiz commented Sep 27, 2013

Great. Let me know if I can help more on this.

jsuereth added a commit that referenced this issue Oct 15, 2013
* Use windows path locations when creating shortcut objects.
* Ensure menu names for shortcut objects don't have invalid characters.
littleRoundaer pushed a commit to littleRoundaer/sbt-native-packager that referenced this issue Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants