Switch to full style
About BasiliskII, a 68k Mac emulator for Windows, MacOSX, and Linux that can run System 7.x through MacOS 8.1.
Post a reply

Re: Self-contained Basilisk II VM for OSX (cool!)

Sat Nov 22, 2014 9:18 pm

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

Re: Self-contained Basilisk II VM for OSX (cool!)

Fri Jul 06, 2018 1:28 pm

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.

Re: Self-contained Basilisk II VM for OSX (cool!)

Wed Aug 08, 2018 7:40 pm

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
Last edited by gingerbeardman on Wed Aug 08, 2018 10:02 pm, edited 1 time in total.

Re: Self-contained Basilisk II VM for OSX (cool!)

Wed Aug 08, 2018 7:57 pm

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.

Re: Self-contained Basilisk II VM for OSX (cool!)

Wed Aug 08, 2018 8:37 pm

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 :)

Re: Self-contained Basilisk II VM for OSX (cool!)

Wed Aug 08, 2018 9:17 pm

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...!

Re: Self-contained Basilisk II VM for OSX (cool!)

Wed Aug 08, 2018 9:29 pm

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)
Last edited by gingerbeardman on Thu Aug 09, 2018 7:06 am, edited 2 times in total.

Re: Self-contained Basilisk II VM for OSX (cool!)

Thu Aug 09, 2018 6:59 am

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.

Re: Self-contained Basilisk II VM for OSX (cool!)

Thu Aug 09, 2018 9:03 am

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.

Re: Self-contained Basilisk II VM for OSX (cool!)

Thu Aug 09, 2018 9:41 am

I'm not sure what you're asking?

What isn't clear from my example?

Re: Self-contained Basilisk II VM for OSX (cool!)

Thu Aug 09, 2018 10:48 am

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...

Re: Self-contained Basilisk II VM for OSX (cool!)

Thu Aug 09, 2018 2:21 pm

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

Re: Self-contained Basilisk II VM for OSX (cool!)

Thu Aug 09, 2018 7:35 pm

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

Re: Self-contained Basilisk II VM for OSX (cool!)

Thu Aug 09, 2018 10:48 pm

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?

Re: Self-contained Basilisk II VM for OSX (cool!)

Fri Aug 10, 2018 6:12 am

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.

Re: Self-contained Basilisk II VM for OSX (cool!)

Fri Aug 10, 2018 6:39 am

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.

Re: Self-contained Basilisk II VM for OSX (cool!)

Fri Aug 10, 2018 10:36 am

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

Re: Self-contained Basilisk II VM for OSX (cool!)

Fri Aug 10, 2018 10:03 pm

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!

Re: Self-contained Basilisk II VM for OSX (cool!)

Fri Aug 10, 2018 10:11 pm

https://github.com/adespoton/macosemushells

Re: Self-contained Basilisk II VM for OSX (cool!)

Fri Aug 10, 2018 10:22 pm

Thanks both

Re: Self-contained Basilisk II VM for OSX (cool!)

Sat Aug 11, 2018 3:39 am

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

Re: Self-contained Basilisk II VM for OSX (cool!)

Mon Aug 13, 2018 9:52 am

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.

Re: Self-contained Basilisk II VM for OSX (cool!)

Mon Aug 13, 2018 12:59 pm

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

Re: Self-contained Basilisk II VM for OSX (cool!)

Mon Aug 13, 2018 1:33 pm

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.)

Re: Self-contained Basilisk II VM for OSX (cool!)

Mon Aug 13, 2018 5:34 pm

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