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

About BasiliskII, a 68k Mac emulator for Windows, MacOSX, and Linux that can run System 7.x through MacOS 8.1.

Moderators: Cat_7, Ronald P. Regensburg

emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

EDIT: Better error-handling

Code: Select all

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
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

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.
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

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

Post by gingerbeardman »

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.
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

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

Post by adespoton »

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.
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

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

Post by gingerbeardman »

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 :)
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

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...!
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

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

Post by gingerbeardman »

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.
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

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

Post by gingerbeardman »

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.
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

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.
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

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

Post by gingerbeardman »

I'm not sure what you're asking?

What isn't clear from my example?
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

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...
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

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

Post by gingerbeardman »

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: Select all

touch Parent.app
touch Parent.app/Contents/Resources/Child.app
You might also need

Code: Select all

touch Parent.app/Contents/Resources/Icon.icns
touch Parent.app/Contents/Resources/Child.app/Contents/Resources/Icon.icns
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

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
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

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

Post by gingerbeardman »

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?
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

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

Post by adespoton »

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.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

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.
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

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

Post by gingerbeardman »

I'll take a look this weekend and get a new test app up.
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

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!
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

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

Post by adespoton »

User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

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

Post by gingerbeardman »

Thanks both
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

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

Post by adespoton »

Also, I stuck https://github.com/adespoton/sparserbundler on there for people who want sparser sparsebundles.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

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.
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

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

Post by gingerbeardman »

Just noticed this during testing:

Code: Select all

# 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
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

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

Post by Ronald P. Regensburg »

gingerbeardman wrote:Just noticed this during testing:

Code: Select all

# 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.)
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

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

Post by gingerbeardman »

My macOS input source (keylayout) is "British - PC" which is British with " and @ swapped (amongst others)
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
Post Reply