Page 2 of 2
Re: PB IDE Tool MyAppData
Posted: Wed Apr 16, 2025 9:13 pm
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?
Re: PB IDE Tool MyAppData
Posted: Thu Apr 17, 2025 2:56 pm
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
Re: PB IDE Tool MyAppData
Posted: Thu Apr 17, 2025 11:16 pm
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
Re: PB IDE Tool MyAppData
Posted: Fri Apr 18, 2025 12:05 pm
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.
Re: PB IDE Tool MyAppData
Posted: Fri Apr 18, 2025 12:19 pm
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
Re: PB IDE Tool MyAppData
Posted: Fri Apr 18, 2025 2:14 pm
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.
Re: PB IDE Tool MyAppData
Posted: Fri Apr 18, 2025 2:52 pm
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.
Re: PB IDE Tool MyAppData
Posted: Fri Apr 18, 2025 3:07 pm
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.
Re: PB IDE Tool MyAppData
Posted: Fri Apr 18, 2025 3:44 pm
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

Re: PB IDE Tool MyAppData
Posted: Fri Apr 18, 2025 3:54 pm
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 ...
Re: Инструмент PB IDE MyAppData
Posted: Fri Apr 18, 2025 4:38 pm
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.