macOS app wrappers for Mini vMac - help requested

About Mini vMac and all other 68k emulators, including SoftMac, Executor, and MESS.

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
almeath
Mac Mechanic
Posts: 170
Joined: Mon Jul 18, 2005 5:42 am
Location: Australia

macOS app wrappers for Mini vMac - help requested

Post by almeath »

I worked out a way to make some self-contained macOS app "wrappers" for custom builds of Mini vMac. This allows me to adjust each build for a specific game or application and then conveniently run them as individual apps on my iMac, with custom icons and all that.

I use the Platypus app to put the ROM, DSK image and precompiled Mini vMac executable in a resources folder, with a shell script to launch the executable contained within the app wrapper. The form of the script that I enter in Platypus is (with "name of executable" being the name of the individual game or app):

#!/usr/bin/osascript

tell application "name of executable" to activate
tell application "System Events"
set frontmost of process "name of executable" to true
end tell


This works well enough on my system, but there are several issues:

1. The name of the Mini vMac executable in each wrapper needs to be different and distinct.

2. I do not know how self-contained these wrappers really are, as Platypus puts *.scpt files for each wrapper in my user/library/application support/platypus folder. However, I have successfully moved the wrappers to another Mac and have been able to launch them.

3. Sometimes my wrappers do not execute anymore when double-clicking their icons. I have to go into the contents/resources/ of each wrapper, launch the Mini vMac executable directly, and then the wrapper will work normally. I am not entirely sure what causes this, but I have noticed it after performing certain system maintenance tasks such as running repair in Disk Utility.

I am just an amateur with this kind of thing, but my end goal is to develop a purely self-contained wrapper that is easily movable between systems and which just needs an appropriate Mini vMac executable placed inside it in order to work. Obviously Mini vMac requires lots of tweaks to be suitable for different systems in terms of speed, display settings etc., so apps of this nature will never be entirely portable between all Mac models without individual customization.

I can share a link to an empty wrapper I created for Prince of Persia 2. In order for it to work you need to put the following files inside contents/resources:

- a ROM file called "MacII.ROM"
- a Mini vMac executable called "Persia2_mac"
- a DSK image containing the operating system and game called "disk1.dsk"
- if you use System 7.1 or higher, place an alias of the game in System Folder/Start Up Items to have it launch automatically when you open the app from macOS

http://userweb.eftel.com/~almeath/mac/app_wrapper.zip

Perhaps there is an entirely better way to to this. If so, I am seeking help and/or suggestions.
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: macOS app wrappers for Mini vMac - help requested

Post by mabam »

osascript is basically Apple Script called from the shell. When first using an application name in Apple Script I often encounter a dialog asking me to point Apple Script to the respective application as it is not able to find it by itself.
I wonder whether this is also the reason for your wrapper to sometimes fail on executing.

You might try using bash instead of osascript and change the script to:

Code: Select all

#!/bin/bash

./"name of executable"
(presuming Contents/Resources/ is also where Platypus puts the shell script).

If, for some reason, you explicitly want to set it as frontmost as well, try adding

Code: Select all

/usr/bin/osascript -e 'tell application "System Events" to set frontmost of process "name of executable" to true'
to the bash script. I don’t think this is necessary though.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: macOS app wrappers for Mini vMac - help requested

Post by adespoton »

There's a better way to do this, posted on Paul's website and discussed between him and I on here.

Paul's already incorporated all this into the design.

Inside the Contents folder, create a new folder called mnvm_dat.

Inside that folder, put your disk image(s) and ROM file. The disk images need to be named disk1.dsk through diskn.dsk, and the ROM needs to be named for the emulator it's for (vmac.rom, macii.rom, etc.).

Change your info.plist file to reflect the bundle ID and window name you want, change the Resources/appicon.icns file to the icon you want, and you're done!

I've got 32 distinct wrappers done this way, for different OS versions and configurations. I can still drop an external disk image on one of them when it's running to mount an image containing more files. The wrappers are also using the Twiggy through Mac II emulation cores, depending on which one works best with each OS version.

If you need help, or need my framework as an example, let me know.
almeath
Mac Mechanic
Posts: 170
Joined: Mon Jul 18, 2005 5:42 am
Location: Australia

Re: macOS app wrappers for Mini vMac - help requested

Post by almeath »

adespoton wrote: If you need help, or need my framework as an example, let me know.
That sounds like exactly what I’ve been looking for. If you can share a sample framework and the link to where this is discussed on Paul’s website that would be brilliant. Thanks!
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: macOS app wrappers for Mini vMac - help requested

Post by adespoton »

The links are here:

https://www.gryphel.com/c/minivmac/hardware.html
https://www.gryphel.com/c/minivmac/options.html

Search for mnvm_dat

An older version of my shells are available at

https://github.com/adespoton/macosemushells

--I need to update those one of these days, as some are quite out of date.
User avatar
BlueBoy
Student Driver
Posts: 11
Joined: Tue Aug 13, 2013 5:12 am

Re: macOS app wrappers for Mini vMac - help requested

Post by BlueBoy »

Also see the extras page:

https://www.gryphel.com/c/minivmac/extras/index.html

Specifically see the AutoQuit, AutoQuit7, DAOpener, DoLaunch and EjctQuit.

These will assist in wrapping.
almeath
Mac Mechanic
Posts: 170
Joined: Mon Jul 18, 2005 5:42 am
Location: Australia

Re: macOS app wrappers for Mini vMac - help requested

Post by almeath »

Thanks for these. I have converted some of my wrappers using the above methods and it works great.
Post Reply