PB IDE Tool MyAppData

Mac OSX specific forum
dibor
Enthusiast
Enthusiast
Posts: 160
Joined: Wed May 20, 2020 5:19 pm
Location: The 3rd planet in the Solar System
Contact:

Re: PB IDE Tool MyAppData

Post by dibor »

Hello.
I can not to create my application :(
I have create MyAppData as console executable format.
And add it to PB's tools (2 times).
Added to my project folder named MyAppData, Library and Resources folders inside it.
Copy lib to Library folder.
Did simple info.plist file as U asking ; PLIST <>...........


While creating executable applications I got application with lib inside a.app/Contents/Library
All looks good, but I do not see any my info that was in the info.plist file, looks like this data do not copied.
Application do not runs, crashed.

What I do wrong?
Mac Studio M1Max, PB 6.12 Arm64 and x64.
Macbook Air M2, PB 6.12 Arm64 and x64.
Windows 10, PB 6.12 x64 and x86.
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB IDE Tool MyAppData

Post by mk-soft »

No info.plist is created, but the existing info.plist is edited

Remove the comment lines with "; PLIST xyz" from your code so that nothing is changed in the info.plist
Perhaps something has changed in the structure.

Once again tested ...

This belongs in your Main.pb file. But it does not have to.

Code: Select all

; Info.plist
;
; PLIST <key>CFBundleSignature</key>
; PLIST <string>PB-APP</string>
; PLIST <key>CFBundleShortVersionString</key>
; PLIST <string>1.1.0.0</string>
; PLIST <key>CFBundleName</key>
; PLIST <string>MyTestApp</string>
; PLIST <key>NSHumanReadableCopyright</key>
; PLIST <string>©2025 mk-soft. All rights reserved.</string>
You can also customise the info.plist with Xcode after creating the APP
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
dibor
Enthusiast
Enthusiast
Posts: 160
Joined: Wed May 20, 2020 5:19 pm
Location: The 3rd planet in the Solar System
Contact:

Re: PB IDE Tool MyAppData

Post by dibor »

Hi.
Looks like I am absolutely stupid!
Ur tool named MyAppData 1.04.0, I need to compile it as console program and use it as IDE tool.
But what is it PathHelper v1.05.2 ???
U use it in the same thread and I do not understand.
This is module that I should to use it(include it) in the my project for getting MyAppData tools work?
I do not saw where U are explaining this :(
Please give small instruction for stupids like me.

Thank U
Mac Studio M1Max, PB 6.12 Arm64 and x64.
Macbook Air M2, PB 6.12 Arm64 and x64.
Windows 10, PB 6.12 x64 and x86.
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB IDE Tool MyAppData

Post by mk-soft »

This Tool is not for console programmes.
An app under macOS is a folder with a defined structure.
In order to get the file resources into the correct folders when compiling the app, I have written these tools.
For example images or libraries to be included.

The include file PathHelper are the help functions to have the path to the app resources and correct user data path.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
dibor
Enthusiast
Enthusiast
Posts: 160
Joined: Wed May 20, 2020 5:19 pm
Location: The 3rd planet in the Solar System
Contact:

Re: PB IDE Tool MyAppData

Post by dibor »

Hi.
Looks like all files inside right folders but application doesn't work.
Please look video: https://skr.sh/vVCRDYiExAO.mp4

How to use PathHelper?
Simple include it to the project?

Thank U
Mac Studio M1Max, PB 6.12 Arm64 and x64.
Macbook Air M2, PB 6.12 Arm64 and x64.
Windows 10, PB 6.12 x64 and x86.
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB IDE Tool MyAppData

Post by mk-soft »

I have watched your video.
I assume that you have compiled my tool as a console and I see that you have configured it correctly in the IDE tools.

The tool is only called after compiling and only copies the contents of the MyAppData folder into the APP. (CopyDirectory)
It looks like the files were also copied.

The path to your dylib is then the PathHelper function GetLibraryPath()
Is the libray compiled with the correct compiler?

How does it look if you insert the folders and files into the APP yourself after compiling.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
dibor
Enthusiast
Enthusiast
Posts: 160
Joined: Wed May 20, 2020 5:19 pm
Location: The 3rd planet in the Solar System
Contact:

Re: PB IDE Tool MyAppData

Post by dibor »

Hello.
Thanks for ur help.
Lib is for correct compiler x64, application is runs from IDE
If I make application without ur tool and copy Library folder(including lib) into APP - I get some error :(

Looks like executable cannot get functions from lib because wrong path.
Mac Studio M1Max, PB 6.12 Arm64 and x64.
Macbook Air M2, PB 6.12 Arm64 and x64.
Windows 10, PB 6.12 x64 and x86.
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB IDE Tool MyAppData

Post by mk-soft »

Check the path to your dylib in your program. (debug with my tool)

Code: Select all

path.s = GetLibraryPath()
lib.s = path + "libchilkatPB-9_5_0.dylib
debug lib
Do you use the X64 compiler or the M1 compiler. It must also fit lib.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
dibor
Enthusiast
Enthusiast
Posts: 160
Joined: Wed May 20, 2020 5:19 pm
Location: The 3rd planet in the Solar System
Contact:

Re: PB IDE Tool MyAppData

Post by dibor »

Looks right: /tmp/PureBasic.0.app/Contents/Library/libchilkatPB-9_5_0.dylib
File PureBasic.0.app runs good from IDE but doesn't work if I try to run it from /tmp folder :(
Mac Studio M1Max, PB 6.12 Arm64 and x64.
Macbook Air M2, PB 6.12 Arm64 and x64.
Windows 10, PB 6.12 x64 and x86.
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB IDE Tool MyAppData

Post by mk-soft »

What does your code look like at OpenLibrary?
Do you use GetLibrayPath for this?

Compiler option: Create temporary executable in the source Directory ...
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
dibor
Enthusiast
Enthusiast
Posts: 160
Joined: Wed May 20, 2020 5:19 pm
Location: The 3rd planet in the Solar System
Contact:

Re: Инструмент PB IDE MyAppData

Post by dibor »

Hello.
I found a solution :)

We have talk about this problem before: https://www.purebasic.fr/english/viewtopic.php?t=80094

I have change version of chilkat modules and forgot that I have made changes inside them.

So I add UseModule PathHelper and GetLibraryPath() while opening lib

Code: Select all

  
UseModule PathHelper

CompilerIf #PB_Compiler_ExecutableFormat = #PB_Compiler_DLL
   Procedure ckInitGlobal()
CompilerEndIf

  CompilerSelect #PB_Compiler_OS
    CompilerCase #PB_OS_Windows
      CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
        CkGlobalLibId.i = OpenLibrary(#PB_Any, "chilkatPb32-9_5_0.dll")
      CompilerElse
        CkGlobalLibId.i = OpenLibrary(#PB_Any, "chilkatPb-9_5_0.dll")
      CompilerEndIf
    CompilerCase #PB_OS_MacOS
      CompilerIf #PB_Compiler_Processor = #PB_Processor_Arm64
        CkGlobalLibId.i = OpenLibrary(#PB_Any, "libchilkatPbM1-9_5_0.dylib")
      CompilerElse
        CkGlobalLibId.i = OpenLibrary(#PB_Any, GetLibraryPath() + "libchilkatPb-9_5_0.dylib")
      CompilerEndIf
Thank you very much for your help.
Mac Studio M1Max, PB 6.12 Arm64 and x64.
Macbook Air M2, PB 6.12 Arm64 and x64.
Windows 10, PB 6.12 x64 and x86.
Post Reply