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

"Save As" does not create an image that is launchable #53

Open
apblack opened this issue Nov 24, 2017 · 11 comments
Open

"Save As" does not create an image that is launchable #53

apblack opened this issue Nov 24, 2017 · 11 comments

Comments

@apblack
Copy link

apblack commented Nov 24, 2017

If I do a "Save As..." from an existing image (that has been launched form the launcher), new image and changes files are created in the existing launcher folder. But this image cannot be launched from the launcher.

This is because the name of the image does not correspond to the name of the folder.

@jecisc
Copy link
Member

jecisc commented Nov 24, 2017

This is already reported in #18

@demarey
Copy link
Contributor

demarey commented Jan 15, 2018

There are now 2 ways to run an image created with "Save As" :

  • if no image is selected in PharoLauncher and you click on launch, then you get a file browser allowing you to open any image on your filesystem
  • you can import an image into pharo Launcher. It will move the imported image to the default image store of Pharo Launcher.

Is it enough to solve this issue?

@VincentBlondeau
Copy link
Contributor

@apblack Can we close the issue?

@apblack
Copy link
Author

apblack commented Jun 11, 2018

I think that you have done everything reasonable as maintainers of the launcher. But I don't think that the issue s solved for the programmer who is using the launcher.

What would solve it would be a variation on "Save As .." in the main menu that will offer to create a "launcher compatible" folder containing the newly-saved image. This would mean that the standard image would have to be able to detect that it was run from the launcher — perhaps by looking to see if the image file is inside a directory of the same name.

So, perhaps the right thing to do is to close this issue, and open one in FogBugz, since this will have to be solved in Pharo itself.

@demarey
Copy link
Contributor

demarey commented Jun 12, 2018

I agree with @apblack : the issue is not yet solved but it will be difficult to implement it. The hard point is indeed: how an image could be aware that it has been launched from the launcher? And yes, that means that we should introduce code in the image => new problem: this code can only be introduced into the development version of Pharo and not past releases. It means this functionality could only work starting Pharo 7.
As for now, I cannot see a reasonable solution to get this functionality working nicely. It requires more thoughts about it.

@philippeback
Copy link

It is the same kind of problem as my image saver.

A solution would be to have a command listing all images in the folder and offer to open one.

@apblack
Copy link
Author

apblack commented Jun 12, 2018

To amplify what @philippeback said: a solution that could be implemented in the launcher itself would be for the launcher to notice when there is more than one pair of .image & .changes files in the directory that it is about to launch, and to ask the user of the launcher to pick one pair from a list.

I think that the right solution is to introduce new functionality into Pharo 7's "Save As …" command, so that, going forward, this ceases to be a problem. And this is an ideal time to do so, because Pharo 7 is under active development. But, as @demarey points out, this cannot solve the problem for older versions of Pharo. Having the launcher offer a list would solve the problem for such systems.

@svenvc
Copy link

svenvc commented Jun 12, 2018

Is it not possible to launch sub images with an additional command line argument ?
Such a command line argument can easily be retrieved at the level of the sub image.
Maybe even an environment variable might work.

@demarey
Copy link
Contributor

demarey commented Jun 19, 2018

@svenvc yes, I think it would be a good idea to use an extra command-line argument. That said, it will still require new code to manage that in the standard Pharo image. But that will solve the problem for Pharo images >= 7.0

@fuhrmanator
Copy link
Contributor

I'm a relatively new person to Pharo (less than 3 years, and much of it was in Pharo 5 with a minimal understanding, so I'm really still quite a newbie). Currently (because of this issue), I don't use Pharo Launcher except when I'm starting with a new image.

In my workflow (on Windows 10), I just run Pharo.exe (from the VM) and select the latest image (done with Save as...) for my project. Windows 10's file system does a great job finding it. Why am I doing "Save as..." with images and not just "Save"? Here are a few reasons:

  1. I don't want to lose my playgrounds (which can't easily be versioned with Git),
  2. I don't want to get stuck with a corrupt image (it happened enough times in Pharo 5 that I am still not trusting things in Pharo 6.1 ;-)).
  3. I want an image to roll back to when I attempt to install some new complex library, e.g., I was trying to get Moose to work with Iceberg, then with OSSubprocess (which doesn't finally work on Windows, etc.).

@fuhrmanator
Copy link
Contributor

As for solutions, I'm a Windows 10 person lately (please forgive me for that), so I know there's a way to have a right-click option in Windows Explorer to say "Open with..." on a file of type .image. Couldn't Pharo Launcher just add its value (i.e., find the right VM for the image) at this level? No need to pass through a GUI.

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

7 participants