E-Maculation
https://www.emaculation.com/forum/

Self-contained Basilisk II VM for OSX (cool!)
https://www.emaculation.com/forum/viewtopic.php?f=6&t=8020
Page 2 of 3

Author:  emendelson [ Sat Nov 22, 2014 9:18 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

EDIT: Better error-handling

Code:
set myRes to (path to me as text) & "Contents:Resources:"

set posixRes to (POSIX path of myRes)

tell application "Finder"
   try
      set myAlias to (path to desktop folder as text) & "Pass-Through Drive" as alias
   on error
      make new alias to folder (myRes & "Pass-Through Drive") at desktop
   end try
end tell

do shell script "cd" & space & quoted form of posixRes & space & "&&" & space & "./BasiliskII" & space & "--config" & space & "basilisk_ii_prefs"


tell application "Finder"
   try
      delete file "Pass-Through Drive" of desktop
   end try
end tell

Author:  emendelson [ Fri Jul 06, 2018 1:28 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

kanjitalk755's 64-bit SDL2 build of Basilisk works perfectly in this kind of self-contained VM (you need to add the Frameworks folder to the bundle). So here's one question:

Is there a way to make this bundle display a credits.rtf file when you click About BasiliskII? I'm going to put together a modern self-contained 68K-emulation package, and I would like to give credit where credit is due.

Author:  gingerbeardman [ Wed Aug 08, 2018 7:40 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

emendelson wrote:
Is there a way to make this bundle display a credits.rtf file when you click About BasiliskII? I'm going to put together a modern self-contained 68K-emulation package, and I would like to give credit where credit is due.

Yes, there is. Here's an example app where I have made the necessary changes.

http://www.mediafire.com/file/6dc9rnf5q ... p.zip/file

If you use macOS Script Editor to create a simple AppleScript and then save it as an Application, you'll see the structure you need to have extra information shown in the About this app dialog. I've gone one further and added more to enable a Credits scroll and custom icon.

Image

Author:  adespoton [ Wed Aug 08, 2018 7:57 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

Let me know if you get stuck; My self-contained bundles use a mix of applescript and shell script. Using AppleScript to open /bin/sh with a parameter should do what you need.

Author:  gingerbeardman [ Wed Aug 08, 2018 8:37 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

Ah, the way to do it is already in the OP and in the "Self-contained Basilisk II VM"

So I'll leave it as it is so I don't confuse things :)

Author:  emendelson [ Wed Aug 08, 2018 9:17 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

gingerbeardman wrote:
Yes, there is. Here's an example app where I have made the necessary changes.


I admit I'm puzzled. How would this work with the BasiliskII setup described in this thread? You're using my System761 app. How would you add a credits box to the BasiliskII executable that it's in there? I'm genuinely puzzled...!

Author:  gingerbeardman [ Wed Aug 08, 2018 9:29 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

Are your files in source control anywhere? I'll happily do it for you.

But, short version, you don't add it to BasiliskII executable. The information to enable the About box is in the other files in the app package. You'd add them to /Applications/Parent.app/Contents/Resources/Child.app/... if you get what I mean?

Right click the app and Show Contents, there is the minimum contents in this demo App to show you how to do the thing you wanted.

Summary... (* denotes essential requirement for About box customisation)

Info.plist:
* NSHumanReadableCopyright (string) "Created by..."
* CFBundleShortVersionString (string) "1.0"
* CFBundleVersion (string) "1234a"
* CFBundleExecutable (string) "applet"
CFBundleName (string) "AppName" [app name of parent]

MacOS:
* applet (launches main.scpt)

Resources:
* applet.rsrc (contains information required by the applet binary, see here)
* Credits.rtf (rich text file containing credits text, can contain hyperlinks)
description.rtfd (leave this, no need to edit it)
Classic.icns (classic happy mac iconset)
Finder.icns (classic finder mac iconset)

Scripts:
* main.scpt (this should launch the shell script that in turn launches BasiliskII)

Author:  gingerbeardman [ Thu Aug 09, 2018 6:59 am ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

Thinking about your question a little bit more....

Basically the applet binary checks for the presence of various things in the app package and enables or disables features depending on the the result.

So, yes, it might seem puzzling or akin to magic.

Author:  emendelson [ Thu Aug 09, 2018 9:03 am ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

gingerbeardman wrote:
But, short version, you don't add it to BasiliskII executable. The information to enable the About box is in the other files in the app package. You'd add them to /Applications/Parent.app/Contents/Resources/Child.app/... if you get what I mean?


That works! Thank you! It does seem like magic, as you say, but I'm delighted to know the magic spell.

EDIT: Actually, with a main script that launches a shell script, the contents of credits.rtf display in the About box, but I can't get the custom icon to appear in the About box, no matter what name I apply to the icon in the info.plist. Can you try your AppName applet with an executable that runs a shell script and let us know if it works? If it does, could you post that app? Thanks again.

Author:  gingerbeardman [ Thu Aug 09, 2018 9:41 am ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

I'm not sure what you're asking?

What isn't clear from my example?

Author:  emendelson [ Thu Aug 09, 2018 10:48 am ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

Ignore my question - apologies. I wasn't able to get my app to display the correct icon in the about box when the script launched a shell script, but I tried rewriting your app to run a shell script, and the icon displayed correctly, so the method clearly works, and I'll have to figure out what I'm doing wrong here...

Author:  gingerbeardman [ Thu Aug 09, 2018 2:21 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

You may be doing nothing wrong... macOS caches icons!

The best way I have found of refreshing them during this sort of back-and-forth is to, in Terminal:

Code:
touch Parent.app
touch Parent.app/Contents/Resources/Child.app


You might also need
Code:
touch Parent.app/Contents/Resources/Icon.icns
touch Parent.app/Contents/Resources/Child.app/Contents/Resources/Icon.icns

Author:  emendelson [ Thu Aug 09, 2018 7:35 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

I think I may give up on this question for two reasons:

1. When I use an AppleScript script to launch a shell script that then launches BasiliskII, I end up with two icons in the dock: The custom icon of the AppleScript app and the generic icon of the BasiliskII executable. This doesn't happen when I use the method presented earlier in this script, where there's no AppleScript, just a shell script, that launches BasiliskII.

2. I still can't get the custom icon to appear in the About box when I launch the BII executable. I can get the credits.rtf to display but not the icon. The Touch command doesn't help; neither does rebuilding launch services. But the custom icon in the About box isn't important, as credits.rtf does display correctly.

I'm on a slow connection right now, but if you're still interested, I'll post an attempt to get this working when I'm able to upload large files

Author:  gingerbeardman [ Thu Aug 09, 2018 10:48 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

Don't give up!

1. I can fix this. I set the demo app to stay open after launch so you could click the about menu.

2. I'll do this one also.

I'd encourage you to put your package on GitHub. Then it's easier for people to contribute.

Why have the nested apps? Was it not possible to get it working well enough with one?

Author:  adespoton [ Fri Aug 10, 2018 6:12 am ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

He's done nested apps because he wrote the Applescript wrapper around the existing build.

I went a different route and modified the BII build to point to the applescript instead of the main binary, and the applescript then eventually launches the original binary in the same package. Both methods have their benefits; I can add menus etc. with little difficulty, but emendelson's method means that you can drop-in a new BII build and everything still works; mine needs surgery with each new build.

Good point on Github; I'll get my frameworks up on my github repo sometime soon; bug me in a week if I haven't done it yet.

Author:  emendelson [ Fri Aug 10, 2018 6:39 am ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

gingerbeardman wrote:
Don't give up!

1. I can fix this. I set the demo app to stay open after launch so you could click the about menu.

2. I'll do this one also.

I'd encourage you to put your package on GitHub. Then it's easier for people to contribute.

Why have the nested apps? Was it not possible to get it working well enough with one?


Excellent - but for the next few weeks I'm on a metered connection that someone else is paying for, so I won't be able to upload anything substantial.

I use the AppleScript wrapper to do many things - in the WPMac version, it parses a dropped file and sends it to a folder where a background script in Basilisk II is waiting to open it in WP. In both the WPMac and System761-only versions it builds and runs a launch daemon that watches for print files, etc., sent from Basilisk and processes them in macOS. That's how I can print/create PDFs in macOS from BasiliskII.

Author:  gingerbeardman [ Fri Aug 10, 2018 10:36 am ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

I'll take a look this weekend and get a new test app up.

Author:  emendelson [ Fri Aug 10, 2018 10:03 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

I realized that I could upload a small archive by leaving out the disk image file, so here it is:

https://github.com/emendelson/Basilisk-Icon-Test

If you can figure out how to get the custom icon to display in the About box and how to avoid two icons in the dock, I'll be very grateful!

Author:  adespoton [ Fri Aug 10, 2018 10:11 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

https://github.com/adespoton/macosemushells

Author:  gingerbeardman [ Fri Aug 10, 2018 10:22 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

Thanks both

Author:  adespoton [ Sat Aug 11, 2018 3:39 am ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

Also, I stuck https://github.com/adespoton/sparserbundler on there for people who want sparser sparsebundles.

Author:  emendelson [ Mon Aug 13, 2018 9:52 am ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

adespoton wrote:
Also, I stuck https://github.com/adespoton/sparserbundler on there for people who want sparser sparsebundles.


Something seems wrong with the 7z file - it won't extract either in macOS (with BetterZip) or Windows (using the 7zip utility). Could you take a look? It may be my incompetence that's at fault here.

Author:  gingerbeardman [ Mon Aug 13, 2018 12:59 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

Just noticed this during testing:

Code:
# eval "echo \"keycodefile ${RES_PATH}/BasiliskII_keycodes\" >> ${RES}/biiprefs"


This prevents my keyboard (A1243; alu wired with numeric pad) cursor up and down from working. Therefore I can't do Cmd+Alt+Up/Down to traverse Finder keeping only one window open.

FYI

Author:  Ronald P. Regensburg [ Mon Aug 13, 2018 1:33 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

gingerbeardman wrote:
Just noticed this during testing:
Code:
# eval "echo \"keycodefile ${RES_PATH}/BasiliskII_keycodes\" >> ${RES}/biiprefs"

This prevents my keyboard (A1243; alu wired with numeric pad) cursor up and down from working. Therefore I can't do Cmd+Alt+Up/Down to traverse Finder keeping only one window open.

I do not know what the difference could be with a regular BasiliskII setup, but this works fine here in a regular setup with the same keyboard and (I presume) the same BasiliskII keycodes file. (As far as I am aware, there is only one BasiliskII keycodes file, sometimes with a different file name, but always with the same content.)

Author:  gingerbeardman [ Mon Aug 13, 2018 5:34 pm ]
Post subject:  Re: Self-contained Basilisk II VM for OSX (cool!)

My macOS input source (keylayout) is "British - PC" which is British with " and @ swapped (amongst others)

Page 2 of 3 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/