Deploy Console with Desktop on macOS

Hi

I want to take advantage of multi-core when I can - Does anyone know of the best way to deploy Console apps with the DeskTop for the end user (ie. on an installer)

Thanks

Simply import the built console app folder with a build script into your resources folder and launch it from there in a shell. Like here in a thread to keep it alive and responsive:

Dim helperpath As FolderItem = SpecialFolder.Resources.Child("HelperAppFolder").Child("HelperApp.exe") // macOS without ".exe" If helperpath <> Nil And helperpath.exists Then Dim sh As New shell sh.mode = 1 sh.TimeOut = 60 sh.Execute join(Array (helperpath.ShellPath, ListOfAnyOtherVariablesYouWantToPass), " ") While sh.IsRunning t.Sleep 50 Wend End If

Thanks very much Ulrich!

See http://www.tempel.org/RB/MultiProcessing

Thanks Markus, Paul Lefebvre has a pretty good post here to:

In order to debug such helper apps I use the remote Debugger in a virtual machine, and tell the remote Debugger not to start the application. You can then start the apps manually and your main app can start the helper app with activated remote debugger.

Not the “Resources” folder, only non-executable items should be stored there.
https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19

Executable code should be in either “MacOS”, “Frameworks” or “Helpers” folders.

I’ve been assisting an App Wrapper customer, who’se having problems once his application is “Hard”, and one of the problems is trying to access a dylib stored in the “Resources” folder of his application.

Thanks Sam - Thought Ulrich had found me a way :slight_smile:

So could you include the helper and dylib files in the project as files and then do something like this:

[code]dim f as FolderItem=SpecialFolder.ApplicationData.Child(“Test”)
if f.Exists=False then
f.CreateAsFolder
end if
if f.Child(“Shell Libs”).Exists=False then
f.Child(“Shell Libs”).CreateAsFolder
end if

dim op as TextOutputStream=TextOutputStream.Create(f.Child(“Helper”))
if op=nil then Return
op.Write shell1
op.Close

op=TextOutputStream.Create(f.child(“Shell Libs”).Child(“rbframework.dylib”))
if op=nil then Return
op.Write rbframework
op.Close

[/code]

And launch helper when required?

You could also just change the build script to move the app into the frameworks folder.

May I ask what you’re trying to accomplish?

How I choose to do it with HDRtist NX, is to include the console applications in the “/Contents/MacOS/” folder.

Then when it’s time, I launch it from there. Search the forum for TPSF (Tim’s special folder extensions) as this module should help you find the executables in your bundle.

Also note, that you if you want to ship this application on the mac App Store, you have to use a NSTask instead of the shell to launch the helpers.

Thanks Sam. Basically I have some DB housekeeping that needs to be done after users do certain tasks, but is not time critical so doing them asynchronously is grand. I’m trying to avoid having a server app to do these as it complicates deployment.

I’ll give your suggestion a go…

Thanks for your time.

Chris