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 package .bat script doesn't work #1560

Open
UsAndRufus opened this issue Mar 29, 2018 · 7 comments
Open

Windows package .bat script doesn't work #1560

UsAndRufus opened this issue Mar 29, 2018 · 7 comments

Comments

@UsAndRufus
Copy link

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
Copy link
Member

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:

  • What version of Windows are you running
  • Are you launching the .bat file by clicking in Explorer? Or from a command-line like cmd.exe or Powershell?

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

@UsAndRufus
Copy link
Author

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

@hcann
Copy link

hcann commented May 30, 2018

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
Copy link

ericmathison commented Jul 6, 2018

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
Copy link
Member

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
Copy link

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
Copy link
Member

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? 💡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants