Bundle name?
Bundle name?
When running or debugging it names the file always PureBasic.0.app or similar with no option to specify your own name. Only with Create executable you can set the name. Which is subsequently ignored when debugging again. Can this be changed?
Debug Created Bundle
Code: Select all
-- Save this AppleScript as an app; do not use "purebasic." (with a dot) in your PB app name
-- Drag it into a folder containing your PB app and the PB debugger temp app (…and your source…)
-- There must be NO other apps! (set PB prefs to "create temporary exe in source folder")
-- Run it and Debug! (It will ask for permissions; be sure to grant!)
-- NOTE: You can use it to create the executable only once, and then always use compile/run, with or without Debugger…
property deb : "/Applications/PureBasic.app/Contents/Resources/compilers/pbdebugger.app/Contents/MacOS/pbdebugger " -- space on end
property pb : "purebasic." -- PB temp contains (begins with) this
try
tell application "Finder"
set dir to container of (path to me)
set nf to name of (path to me)
set myapp to 1st item of dir whose name ends with ".app" and name is not nf and name does not contain pb
set pbapp to 1st item of dir whose name ends with ".app" and name is not nf and name contains pb
set nmyapp to characters 1 thru -5 of (name of myapp as text) as text
set npbapp to characters 1 thru -5 of (name of pbapp as text) as text
set pbapp to POSIX path of (pbapp as text) & "/Contents/MacOS/" & npbapp
set myapp to POSIX path of (myapp as text) & "/Contents/MacOS/" & nmyapp
set cp to "cp -f " & quoted form of pbapp & " " & quoted form of myapp
display dialog "Copy —> Replace:" & linefeed & linefeed & pbapp & "\n\n" & myapp with title "Replace " & nmyapp & "?" -- cancel?
do shell script cp -- copy/replace executable
display dialog "Debug?" with title "Standalone Debugger"
do shell script deb & quoted form of myapp -- open with debugger
end tell
on error e number n
if n is -128 then return -- cancelled
display dialog e buttons "OK" default button 1
end try
Last edited by Piero on Sun Sep 21, 2025 12:35 pm, edited 1 time in total.
Re: Bundle name?
Are you using Projects? You can setup different targets and specify a filename for the output executable, then build them at the bottom of the "Compiler" menu.
Re: Bundle name?
Just out of curiosity, do you have a Mac? It seems you dunno Mac apps are packages; you must be very cautious about them not to get overwritten after your careful crafting…


Re: Bundle name?
I do, yes. I like to create a program to be launched after build to handle adding things to the app bundle.
Re: Bundle name?
You can already do this with IDE tools.
I do it this way because I simply copy all the necessary files after compiling and before starting them into the APP.
Link: viewtopic.php?t=61638
I do it this way because I simply copy all the necessary files after compiling and before starting them into the APP.
Link: viewtopic.php?t=61638
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
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Bundle name?
Well, this script just replaces the binary into the package, so it leaves the rest of your app bundle untouched, and if you compile/run without debugger, you can also save the "final version"…
Does PB overwrite only (icons) binary and Info.plist on "create executable"? That's what it seems to me until now
Does PB overwrite only (icons) binary and Info.plist on "create executable"? That's what it seems to me until now
Re: Bundle name?
You can also edit the plist.info yourself with Xcode or with another editor and replace them.
With my tool MyAppData I have integrated a simple plist editing (not quite perfect but sufficient)
Thus, the BundleName in the plist.info is customised.
With my tool MyAppData I have integrated a simple plist editing (not quite perfect but sufficient)
Thus, the BundleName in the plist.info is customised.
Code: Select all
;-TOP
; Info.plist
;
; PLIST <key>CFBundleName</key>
; PLIST <string>MyApp</string>
; PLIST <key>CFBundleShortVersionString</key>
; PLIST <string>1.01.1</string>
; PLIST <key>NSHumanReadableCopyright</key>
; PLIST <string>©2025 mk-soft. All rights reserved.</string>
Procedure UpdateWindow()
Protected dx, dy
dx = WindowWidth(0)
dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
; Resize Gadgets
EndProcedure
Procedure Main()
Protected dx, dy
#WinStyle = #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget
If OpenWindow(0, #PB_Ignore, #PB_Ignore, 600, 400, "Test Window", #WinStyle)
; MenuBar
CreateMenu(0, WindowID(0))
MenuTitle("&File")
MenuItem(99, "E&xit")
; StatusBar
CreateStatusBar(0, WindowID(0))
AddStatusBarField(#PB_Ignore)
; Gadgets
dx = WindowWidth(0)
dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
; Bind Events
BindEvent(#PB_Event_SizeWindow, @UpdateWindow(), 0)
; Main Loop
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Select EventWindow()
Case 0
Break
EndSelect
Case #PB_Event_Menu
Select EventMenu()
Case 99
PostEvent(#PB_Event_CloseWindow, 0, 0)
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ForEver
EndIf
EndProcedure : Main()
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
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive