shoes / shoes4

Shoes 4 : the next version of Shoes
Other
1.59k stars 194 forks source link

Windows package .bat script doesn't work #1560

Open UsAndRufus opened 6 years ago

UsAndRufus commented 6 years ago

When I try and run the .bat script in the package Windows directory, it flashes up then disappears shortly after and the app doesn't run. This is on my machine with Shoes and a JDK already installed. If I double click on the jar to run it or write my own .bat script with just the run command in it it works fine. Seems like the checking if Java exists is broken.

jasonrclark commented 6 years ago

Hi @UsAndRufus, thanks for the report! I've been off shoes for a bit with some eye problems, but hoping to get back in and this sounds like a big problem for Windows packaging!

Could you provide a few more details. Specifically I'd love to know:

Appreciate the extra details, and hoping to look at this very soon.

UsAndRufus commented 6 years ago

Hi @jasonrclark, no worries, hope you're feeling better :smiley:. Running Windows 10, and neither worked (command line or double click). I ended up just using a .jar instead.

hcann commented 6 years ago

Hi, i encountered this problem a while ago and there is a simple solution. The problem is in this line in the generated bat file: set PATH=%USERPROFILE%.shoes\jdk\bin;%PATH% When you delete ";%PATH%" part, it starts working. But this probably may affect the behavior of the program, at least one may not access installed programs without the full path when execute shell commands within shoes.

ericmathison commented 6 years ago

When I ran into this issue (also on Windows 10 and also clicking the .bat file in explorer), my solution was just to bypass the whole problem and use one of these tools that package a .jar as a .exe file. For what it's worth, I used Launch4j.

jasonrclark commented 6 years ago

That's a cool idea @ericmathison, and a reasonable way workaround for folks fully on Windows. Might be worth writing down somewhere 🤔

The main reason we don't do this already from Shoes itself is cross-OS support--we're aiming that someone on any platform can build a package targeting another OS, and unfortunately everything I found like Launch4j would only run on Windows.

(Oh, and I'm still working toward getting back to non-work computer time regularly, and this is top of my list to investigate once I get there!)

ericmathison commented 6 years ago

Sure, I'll aim for writing up a wiki page.

Yes, Launch4j only targets Windows even though packages can be created from any Win/Mac/Linux machine (I created my .exe package on Linux). I'll keep my eyes out for something that supports more target platforms.

jasonrclark commented 6 years ago

Oh cool, hadn't noticed that Launch4j can run on all the platforms (though only packages for Windows). Neat! Looks like it has a CLI mode... wonder if we could make some sort of integration to it, even if we don't necessarily want to ship it alongside? 💡