groovy / groovy-wix

A WiX based installer for Groovy
Other
1 stars 1 forks source link

Console and shell won't launch with bat or vbs associated with non-default #2

Open keeganwitt opened 4 years ago

keeganwitt commented 4 years ago

If you have a non-default association with the .bat extension (for example, Notepad++), the console and shell shortcuts won't launch. This can be checked with

>assoc .bat
.bat=Notepad++_file
>assoc .vbs
.vbs=Notepad++_file

This can be fixed with (requires cmd to be run as administrator)

assoc .bat=batfile
assoc .vbs=VBSFile

The .cmd extension (also a batfile) doesn't cause any issues with launching console/shell, but is another one to be aware of.

keeganwitt commented 4 years ago

Still trying to figure out the best solution for this. So far the only options I've come up with are

  1. Bring back in the native launcher.
  2. Let the console window open, but make it minimized in the shortcut (this would fix the vbs issue, but not the same issue with bat, though I'd think that association is less likely to be messed with).

Some of the concerns I had with the native launcher was that it had knowledge of valid parameters (which would need to be updated, as they change in different Groovy versions), and it has logic about locating the Java executable, that I'd prefer be handled by something else, rather than having to maintain that logic.

I'd considered Launch4J, which would abstract the Java executable location stuff for me, but it doesn't support variable expansion, and so I don't know of a way to specify the path to the Groovy jars that get installed without hard-coding it.

keeganwitt commented 4 years ago

Another option I just found is https://github.com/palantir/go-java-launcher. But from a brief reading, I think it will have similar challenges as Launch4J in that the configuration is pretty static.