Thinking outside the sandbox

One of the things I like about Shoes is you create a prototype gui pretty quickly and that helps me define the problem I’m trying to solve. Do I want radio buttons or checkboxes for this option? Doing that helps me think through the problem. It might help readers to see what I’m intending to do. As always, there are no promises, it’s a mockup, float the witch up the flagpole.

So, if the problem is Shoes packaging what would better look like? packaging-new

The first thing that’s note is the option to download Shoes or include Shoes. That gets us back to what Shoes Raisins could do and my current effort. I still have work to do on that for Linux and OSX but the Windows part is working and the the other stuff just need some “tweaking” to use a download url or two that works. He says. Here’s the Shy dialog to fill out the commentary below.
Shy-screen

Now we can talk about the future beyond parity with Raisins. If you click that Advanced options radio button then 4 options drop down. In case you didn’t know, when you package a shy (like my ytm example above), the shy container is always expanded – the user has to double click it again and it goes through a re-install if needed. Just to run your app. On low end Linux machines like the Raspberry pi, it’s particularly offensive as you suffer watching the marching ants across the terminal. Every time you want to run your app.

There’s another gotcha. anything your write in that “app” directory is going to be wiped out at the next launch. Yes, you should have written the Shoes app to store it’s values in ~/ or $HOME but you probably didn’t think about that. Ytm.rb was a Green Shoes app and has data files to read and write, right next to ytm.rb script. You might be thinking, “Cecil, you’re a lousy programmer if you didn’t think about that! You could have written code in Shoes that behaved better if it detected it was being reinstalled”. Actually, that’s two thoughts. On the first charge I plead guilty — I’m not that smart. (Hold on to that second thought).

If you package an app and select Advanced-> Expand shy in users directory’, a future feature that is not implemented yet, when the app is run by the user, after its does the Shoes existence check and installs Shoes if needed it uses Shoes to pop up a dialog to select a directory to store the shy in and all its data files. Yes, the user would have restart Shoes and pick an app (assume it yours) and if they wanted a menu entry or short cut to that ytm.rb looked like an app, they’d have to do that with what tools and skills they and there platform have.

“Wait a minute, Cecil. What script is run if you don’t run the users script on launch?”

Now you can bring bring out that second thought I asked you bottle up. It runs a simple Shoes installer script supplied by default when you chose ‘advanced packaging’ The default probably won’t or can’t do much more than asking for the directory to expand the .shy in,

Does that “own install script” button make sense, now? It’s a Shoes app. It’s Ruby. It can do any thing Shoes can do – like generate menus for Linux and run ‘sudo’ if you can figure out how. Or create Windows shortcuts somehow or unpack a tar ball of gems to install. Or replace icons. Or download something from you own website. I’d prefer it’s a not licensing key or a virus but I can’t tell you what to do with your custom installer script.

I’ll probably get around to doing the default installer script with ‘expand shy’ option because I want it. Anything beyound that is speculation. Gems can be tough. My thought was to copy binary gems and install them but there are still unsolved cross platform issues, I need to think about. Custom Icons ares even less likely to be done by me.

First, I’ll get the Linux and OSX “download if needed” working with an eye to allow the above crazy talk. Raisins Parity first.

[P.S] Since this is all pure Ruby now, Shoes 4 (jRuby) should be package up a shy into a 3.2 exe or osx tbz or a linux .run. That isn’t crazy talk. I don’t why they’d want to, but they could. Yes, I could also add an option to package for Shoes4 once they settle into a scheme that works for them.

Leave a Reply

Your email address will not be published. Required fields are marked *