My 2019 Mac App works on Sonoma… Install?

So I have an app that works on Mac and windows, and they have some coding differences mainly due to the audio systems.
I had abandoned the mac version since sonama came out as it probably broke my Mac app.
I now have a redone my app, dragged its Extra files into user – library – application support by hand and It works! Before, packages installed my extra folder into application support in the root library. No wonder that my app Keep crashing.
I tried creating a deployment package using packages. There seems to be no way to place my folder in application support for the user in packages. The custom fonts and the app is good. I thought had managed it, but then packages presented me with an error saying there was a permission error when I attempted a build.
Should I stay with packages are is there a better installer that will install fonts, my app, in my folder in the user/library/application support folder?
You may be surprised to learn that I am using a 2019 version Xojo, And some old MBS Plug-ins. The fact that I made it work on Sonoma while so many other apps are used to buy Is a testament to the Xojo company and their coders!

You got enough information on the other thread on how to update your app for modern versions of macOS. Have you at least updated something?

Of course, you can add something to the application support folder with Packages. But you don’t need to. This can be done by the app.

Beatrix is right. Probably the installer doesn’t need to copy the stuff into the Application Support folder, but the app can do.

On app start, just check if your Applications Support folder (and its content?) exists, and if not, let your app copy the files accordingly.

1 Like

Is there a way to move the folder so that the app doesn’t go forward until it’s finished copying?
asynchronously?

My CheckSpecialfolders method, called from the app’s Open event, reads as follow:

f=SpecialFolder.ApplicationData //Users/Username/Library/Application Support
If f <> Nil and f.Exists then
    if f.IsWriteable then
    f1=f.Child("com.classics-for-x.dapplegrey")
      if f1<> Nil then
        if f1.Exists then
        else
         f1.CreateFolder //"Library/Application Support/com.classics-for-x.dapplegrey/"
        end if
      end if
    end if
end if

Above, this is the check if your Specialfolder.Applicationdata sub folder exists. Then:

Method "CheckForYourContentinAppPackageMethod:

f1=App.ExecutableFile.Parent.Parent.Parent.Child("Contents").child("YourFolder")
if f1 <> nil then
  if f1.Exists then
    YourFldrString=f1.NativePath
    YourFldrinAppisPresent=true
  end if //f1
end if //f1

Check whether your stuff is already available in Applicationdata:

f1=SpecialFolder.ApplicationData.Child("com.yourwebseitename.yourapplication")
if f1 <> nil then
  if f1.Exists then
    YourFldrinAppData = f1.NativePath
    YourFldrinAppDataisPresent = true
  else //f1.exists = false
    CopyFileOrFolder
  end if //f1
end if //f1

Then, the documentation contains “The CopyFileOrFolder Method is as follows”, which I’ve edited for my needs.
The methods are also called from the app’s Open event.

Nice to see my thoughts are working for you. :wink:

From time to time, after a major update, my users need to have a new resource folder. A minor update is usually just the app.
I heard that if I add anything like copying my folder to the appdata folder and then deleting it from the resource folder will do something with check sum and gatekeeper will get involved. I prefer to move the folder as that will achieve getting the folder to the right place, and then the app checks when restarting if there is a folder available and if it is no longer there, then it goes ahead.
Questions:. Can I move the folder from the resource folder in appdata without problems or do I need to copy the folder into appdata and then delete it from resources.
Packages is very mysterious in where it puts it installs folders. I did try installing the same folder to the application folder but as I have some helper apps connected to the main app, they turned up in launchpad. I’ve even thought of packages installing it into the fonts folder (and moving it when the software is run).

In the windows app, innosetup makes all of this an absolute breeze.

Oh Detlef, Yes, you are super helpful!

Yes, so don’t do that.

What I do is (a) check if the bare folder structure exists (checking for each folder), and then create them if not. Then (b), each database has a globals table, with a version number column. If any database needs to change (such as new column), I alter the table def in the code, so a future new install will create the new table. I also bump the version number in the code. Then finally check this version number against that stored in each database, and if it’s increased, run code to update any affected tables, including to update the version number.

This means that any version of my app can update (to its current) any version of the table structure. An older app running on newer tables will do no updating, and will ignore any column it knows nothing about. A latest version running on very old tables will do a lot of updating, but the old app version will continue to run just fine on the updated tables.

Thanks for the reply…
The reason the user needs to install a new resource folder is because I’ve added new tool. This new folders and these contain presets. I’ve also added new useful presets to number of tools (I have about 30+ high powered tools in my software). my app is actually huge. I think that I need for packages to install the resource folder to a folder where it can sit until I move it codally into appdata when the app first runs.
The question is which folder could I install it

You’d think that packages would be able to create packages that install straight into the users library application support folder… sadly with all the looking online and reading through the help page I can’t see how to do it.
If anybody has a step by step way to do that I’d be extremely grateful.

Packages knows a folder “/Users/Shared user/” - this might be a place to put your folder/files…

Ok - I totally reinstalled my computer with sonoma - running high sierra on parallels.
Packedes… I created new installer filer from scratch. The shared folder installed (using /Users/Shared user/ - which is found by
f=specialfolder.SharedDocuments.child(“My Resource folder”)
the app is in applications… so far so good!
The problem is replacing “My Resource folder” the appdata with the “My Resource folder” from the shared documents folder. My app sees it.
I tried changing the name of the older folder in appdate by adding “old” to the end. And moving the other one. It doesn’t move (and I am using exactly the correct syntax). I tried copying it - it’s a massive file and it takes quite a while until it’s actually completely finished copying - rendering my app head-smacking into a crash.
So… Which of these is more likely to work?
A) Can I use a shell command to asynchronously move the folder?
B) Can I make a installer with Xojo - putting files in the correct places?
C) What about the packages post installation script feature - is there a way to use this to put my resource folder in adddata - overwriting the previous folder?
Cheers and thank you!
I’m so close - all my databases are working - Sonoma looks gorgeous.

[quote=“Sean Clancy, post:12, topic:81169, username:Sean_Clancy”]
And moving the other one. It doesn’t move (and I am using exactly the correct syntax).

Which one?

I tried copying it - it’s a massive file and it takes quite a while until it’s actually completely finished copying - rendering my app head-smacking into a crash.

Thats not a crash. it’s not being able to respond while something is grabbing the main thread.
You could copy files one by one, you could unzip them and use a thread to update the display with progress.

Remember if the support folder exists, there is no point renaming it and copying a whole new set of stuff. You only need to copy over the things that have changed, if indeed anything has.

You could engage a worker app but I don’t recommend it.
A shell command might work async but I don’t know how to do that myself.

Yes. Hence why all my databases contain a version number. Updates? Bump the version number and then when app startup checks each file, it can tell whether it needs updating or not.

I am not worrying so much about databases…I’m dealing with a resource folder that is 770.7 MB in size. I need to move this folder into the appdata folder - or come up with a real way to do it when installing from packages (which is preferable - but the documentation is really obfuscated and hard to read and find out how to do things. Is there a better package installer out there that is friendlier?

I have done some stuff with shell commands
i.e

dim Filename as string ="SReader"
sh.Mode = 0
sh.Execute(chr(34) + f2.AbsolutePath + chr(34) + " " + chr(34) + f2.Parent.AbsolutePath + chr(34) + " " + chr(34) + FileName + chr(34))
sh.Close

This is done before the app can continue… maybe this is the way?
Maybe i need to stick on of these in
chmod 755

I’ve no idea further. Maybe make parts of the ApplicationSupport stuff of your application and check the parts one by one, based on my code lines listed above - if an update is required, then only copy the required part.

Before code-signing, at some point I started to offer Updaters for my applications that replaces stuff within the application - that’s done with code-signing and notarizing now.

Thank You - all of you. I have solved it. For anybody else out there who is tearing their hair out, I will now give the exact steps. For exclaimer, my software is a killer set of tools for guitar and bass players. It’s called Guitar SightReader Toolbox - so just replace your appnames appropriately.

My resource folder is called “Guitar SightReader Toolbox” (same as the app). To do a fresh install for this folder, I am changing the name to “GSRT” and putting it in the contents folder of my app.

In my application (the very top level)… I have this code

dim f1 as folderitem
f1=App.ExecutableFile.Parent.Parent.Parent.Child("Contents").child("GSRT")
if f1 <> nil then
  if f1.Exists then
    folderup
  end if //f1
end if //f1

This sends it to a method in my General module called Folderup. The first window my app opens a window called splasher. In the open command I have this:

dim f1 as folderitem
f1=App.ExecutableFile.Parent.Parent.Parent.Child("Contents").child("GSRT")
if f1 <> nil then
  if f1.Exists then
    folderup
  else
    StepOne
  end if //f1
else
  StepOne
end if //f1

StepOne is just the next method in the Splasher if it doesn’t find my resource folder…Now obviously, I’ve done it twice here… and Probably, I really only need this once. However, outting it here means that I get to see the splasher while it doing the mechanics of copying.

Folderup opens a window called mover. This is where the ‘Magic’ happens.
In the open event in mover we have

dim f, f1 as folderitem
dim i as integer
f=specialfolder.ApplicationData.child("Guitar SightReader Toolbox")
if f.exists and f<>NIL then 
  f.name="Guitar SightReader Toolbox Old"
End If
putter

This above, see if there is a folder to be replaced. it then adds “Old” to its name. Then it goes to the method in Mover called “putter”

This is the code for putter:

dim i,j as integer
dim f, f1,f2 as folderitem
f=App.ExecutableFile.Parent.Parent.Parent.Child("Contents").child("GSRT")
i=f.Count
if f.exists and f<>NIL then 
  f1=specialfolder.ApplicationData
  CopyFileorFolder(f,f1)
End If
f2=specialfolder.ApplicationData.child("GSRT")
while f2=Nil
Wend
While f2.count<i
Wend
f2.name="Guitar SightReader Toolbox"
f=App.ExecutableFile.Parent.Parent.Parent.Child("Contents").child("GSRT")
f.name="GSRT Old"

f1=specialfolder.ApplicationData.child("Guitar SightReader Toolbox Old")
i=DeleteEntireFolder(f1,false)

Splasher.StepOne

So, It gets the location of the GSRT folder (I dragged it into the contents folder in my App).
i is for how many items are in the folder. It checks that the folder exists and then copies it into the appdata folder. My dirty coding stops the app until my folder GSRT" exists (using While and Wend). Then I do the same thing with halting the app until the item count in the copied folder = i.
Then I change the name of the copied “GSRT” to “Guitar SightReader Toolbox” and then delete “Guitar SightReader Toolbox Old” and then go to StepOne to go back into the software.

I discovered that using a package doesn’t really work for istalling the app. I tried it and I could not change the name of my folder “GSRT” to “GSRT old” because it was in the app.
However, because now it’s fully sandboxed (I hope I used that correctly) and is really a 1 file app, I don’t need packages!

I was able to create a pretty cool dmg installer without using any bought tools (except photoshop) and a free AI microsoft image prompt, using the video link I’ve included below.
https://www.youtube.com/watch?v=IadcKngK3A4

If you have any questions please ask. Once again, I was incredibly helped by all the people above - and I couldn’t be happier about that.
Feel free to check out my software (10 day free trial). If you play Guitar or Bass, you’ll come across some of the best workout and reference tools!
Cheers,
Sean Clancy

Which will fail if such a folder already exists.
I know you delete it later, but that deletion may not work if any of the files inside it are in use.

App.ExecutableFile.Parent.Parent.Parent.Child(“Contents”).child(“GSRT”)

Ouch.
That gives different folders depending upon whether you are in debug or release code.

I am changing the name to “GSRT” and putting it in the contents folder of my app

Why not Contents/Resources folder where everything else is?
What would then be wrong with SpecialFolder.resources.child()

And again, do you really need to copy the whole folder every time the app opens?

while f2=Nil
Wend

That will be an infinite loop if f2 is nil

While f2.count<i
Wend

That will be an infinite loop if the file count is different.

1 Like

What’s this all about?