-
Notifications
You must be signed in to change notification settings - Fork 194
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
After Package; Shouldn't path/"pwd" be in resources? path/"pwd" is currently home directory. #1422
Comments
Hi @MichaelDimmitt! So I'm working on packaging at the moment, so thanks for the report. I haven't had a chance to try and replicate what you're describing in the main issue yet, but I've added it to the backlog I'm trying to tackle in the next month and will chime back with what I find. Will chat more about |
You're right about the working directory not getting set. Before we push on that, though, it sounds like your concern there is locating images. Is that right? Rather than putting things in the Mac app But, we have a bug with #676 which is that basically you can't actually get a sensible path to that file. This is my next bug to squash, and I think once I get that, I'll be able to provide you a nice clean way to reference images that works both inside the package and outside. Does that make sense and cover what you're looking for? |
@jasonrclark glad your fixing the image's and path, nice! 👍 🥇
There is a 3rd thing (not sure if possible) relates to (#1184 Bundler.with_clean_env) I made two practical repositories that I think when new shoes4 changes are applied will serve as examples as something shoes4 being shippable and useful. relates to #1415 let me know it you have any questions; Hope you enjoy the install_uninstall_shoes4 repo! |
@MichaelDimmitt generally speaking, focussed smaller issues often make for easier management and more a feeling of "yes I accomplished something, it can be closed" + stuff tends not to get lost, e.g. this issue might get closed once we fix the path stuff and if we're not careful enough to open follow up tickets other stuff might get lost :) |
I was thinking of this as a workaround. Hoping it will not be needed with pre 10 shoes. 😄 Inside the ruby file: Neither were working when I packaged. If the result of that script could be passed to the .rb file that I am packaging. (Which I am not sure how to do) that could be a potential workaround gaining sensible paths to files. |
Hey @MichaelDimmitt! So In https://github.com/MichaelDimmitt/install_uninstall_shoes4, I found that you can just replace those image calls with As far as the working directory, there isn't a consistent place for us to point with packages, especially cross-OS. The reason is that the spot we should point is where your Ruby code lives... but that isn't actually in a normal directory. It's embedded inside of a JAR file that JRuby knows how to work inside of. Even where that JAR is placed differs from Mac to Windows to Linux, so there's no one place we can point at startup that would be the same across apps. That said, we can still get to what you're looking to accomplish with executing scripts. To achieve that install/uninstall behavior, here's what you can do:
(As a side-note, there's also a new value available at Hope that makes sense and happy to follow up if any of it isn't clear. FWIW, I'm not seeing other reasonable changes Shoes can make to simplify this now, so hoping that if this path works for you we can close this issue out. Thanks again for the report and the repos! |
@jasonrclark, Awesome feedback. Thanks for the work on pre 10. 😸
When complete, I will update the example repositories to incorporate the change. |
@jasonrclark, If I convert from shell script to a ruby script. then ... inside the Shoes.rb upon a decision, With that addition my packaged application can run ruby scripts, but that is fine for my purposes. Scripts in other languages and executables I was unable to program the solution suggested.. Example that contains my solution (ruby scripts) for packaging:https://github.com/MichaelDimmitt/install_uninstall_shoes4 |
Hey @MichaelDimmitt! Wanted to make sure I knew what I was talking about, so cooked up a small sample over in this repo. Since you've worked around things for now and have that sample you could look to, I'm going to close this out at this point. Feel free to open other issues if you hit specific problems proceeding, though, and thanks for all the reports and help! ✨ |
@jasonrclark, Much thanks on the code assist 🔥 🔥 🔥
I ran into trouble opening a mac application. Example 1: the commit where install_uninstall_shoes4 scripts work correctly, Example 2: Repository containing solely the packaged project. The project changes mac desktop background. It clones and runs the executables from another github repository. It does not contain any of the packaging code. Example 3: Same as example 2 with packaging code and without the packaged project, Did you enjoy any of these examples? Would you like for me to contribute any thing to shoes4? Would be happy to update these examples in anyway or further add functionality in this area. I am going to look into the Shoes4 size issue next. The packaged app referenced in this comment... example2 is super generic. It clones all of the files it needs from another repository on github and app.jar is 62 mb. I have a few ideas on how to cut it down. Thanks for the great support as I progressed to where I have finally reached my finish line. It may be slow to clone a foreign repository down. But it does seem the simplest solution. Since I do not have to rewrite all 4 of my mac applications and the scripts related to them from the packaged jar file. Would appreciate your thoughts. What does the shoes4 community think the better practice for installing and uninstalling? A script that clones down and then executes the code or converting the code out of the jar file and then executing it? |
I know this shouldn't be here but I wanted to mention it. @jasonrclark @PragTob |
When I make a package "pwd" is the home directory.
"pwd" is not Resources or app's Current location.
code: simple test.rb
Example when I click the "go" button:
When I do not make a package it tells where I ran the script from, which is fine:
When I make the package it does not tell where I ran the .app from.
The program also does not move images to resources folder.
However, I should be able to manually move them to resources folder.
I just need the path to be at Resources inside the Test.app or the path to Test.app.
Having the app be a self contained entity will allow me to run it from other people's computers.
I am aware there are open issues on Packaging.
I did not see an issue solely committed to path location.
If I find the solution to my problem I will comment below.
Thanks for your time reading this issue.
Let me know if you need any further details.
The text was updated successfully, but these errors were encountered: