Page 1 of 1

Problem at Startup of Hauptwerk

PostPosted: Fri May 07, 2021 3:29 am
by hmzeuner
After moving to a new computer (a Mac mini 2018 with MacOS 10.15.7) occasionally I get the following message when Hauptwerk is starting up:
"The Hauptwerk folder ...HauptwerkSampleSetsAndComponents does not exist. Please re-run Hauptwerk's installer to re-pair your installation. Message code 0657"
Since I am certain that this folder exists, I don't follow the suggestion but instead restart Hauptwerk and then everything works finde. But since this is a headless machine I have to use remote desktop from a different computer and so my solution is a little inconvenient.

The folder which Hauptwerk does not find is situated on an external SSD and I assume that this SSD is not yet mounted at the moment when Hauptwerk tries to access it (Hauptwerk is on autostart). Is it possible to tell Hauptwerk to wait a little longer before reading from this folder? I tried to increase (in General Preferences) the Minimum time to wait on start-up by a few seconds, but to no avail.

Hansmartin (in Hamburg).

Re: Problem at Startup of Hauptwerk

PostPosted: Fri May 07, 2021 3:42 am
by mdyde
Hello Hansmartin,

I assume you've told macOS to launch Hauptwerk automatically when macOS boots (i.e. automatically upon log-in).

I think your diagnosis is correct in that macOS is sometimes launching Hauptwerk before macOS has mounted your external SSD, resulting in Hauptwerk not being able to see the files on that SSD.

There's no way within Hauptwerk itself to make the Hauptwerk executable wait upon launch before trying to access any of its files, I'm afraid. (The 'General preferences | Advanced ... | Minimum time to wait on start-up' setting behaves somewhat like that, to give the operating system time to finish loading audio/MIDI interfaces' drivers, but that delay happens after Hauptwerk has read its file structure [not least since user settings, such as that one, are saved within files], so it wouldn't help you in this case.)

You would potentially need to come up with some other means to launch Hauptwerk (instead of macOS' standard right-click option to run it automatically upon log-in). E.g. you could probably write a shell script that implements a delay and then launches the Hauptwerk executable, and then make macOS launch your shell script, instead of launching Hauptwerk directly.

Re: Problem at Startup of Hauptwerk

PostPosted: Fri May 07, 2021 6:26 am
by hmzeuner
Hello Martin,

thanks very much for your prompt (as always) reply, confirming my analysis of the situation. The suggestion to delay the automatic launching of Hauptwerk by a script is a very good idea; I'll try to use AppleScript to achieve that.

Best regards,

Re: Problem at Startup of Hauptwerk

PostPosted: Fri May 07, 2021 7:49 am
by mdyde
Thanks, Hansmartin. You're very welcome. Hope you manage to resolve it easily that way.

Re: Problem at Startup of Hauptwerk

PostPosted: Fri May 07, 2021 8:07 am
by engrssc
Can I assume the problem in this case most likely wouldn't be an issue if the computer were left running 24/7? Plus leaving it running would permit almost instant startup?


Re: Problem at Startup of Hauptwerk

PostPosted: Sat May 08, 2021 3:58 am
by davidfindlay
Hello Hansmartin,

I had exactly this problem. As Martin's suggested, Hauptwerk is starting up before your external disk has mounted.

It turns out that out-of-the-box a Mac does not mount external disks until a user logs in. I addressed the problem by changing this default behaviour -- that is, by getting the Mac to mount the external disks at boot, rather than waiting for a user login -- so that external disks are ready and waiting when Hauptwerk starts up when you log in.

To do this, you need to enter the following command in the Terminal application (all on one line):

sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true

(Note: you'll probably need to enter your password for the command to complete. You can go back to the default state by issuing the same command but with 'true' replaced by 'false'. You can check your current state with 'sudo defaults read /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin': this returns either 0 or 1, corresponding to 'false' or 'true', respectively.)

Of course, writing a script that runs at login, waits a while, and then launches Hauptwerk is an alternative option.