How to Add My Custom C++ Executable in Mac App Contents/MacOS Folder - objective-c

I want to add a C++ Executable file to my App's MacOS Folder. The Executable file needs no plist or anything to run. It runs without any other files support. So i tried adding this file to my Xcode project , when i build my app, the binary resulted in Resources Folder.
The App is running fine, but i want the executable to be in Contents/MacOS folder. How to achieve this ..?

Create 'copy file' phase in your app's target.

Related

Meson: how to copy subproject file to build directory?

I'm using Meson build system to build a simple executable app.
Problem is: the executable needs to have access to file file.txt which is located in the separate utils repository. The executable app reads this file at runtime and can't work without accessing it.
I have pulled in the utils repository as a Meson subproject, but I am not sure how would I copy the subprojects/utils/file.txt to a builddirdirectory where the executable is built. Currently the app is built without problems, but when I run it, it fails to find file.txt.
How do I copy the subprojects/utils/file.txt to builddir?

Get Version from binary inside app directory

I have a helper tool in my bundle that resides in Contents/Library/PriviledgedHelperTools inside my .app. Can I somehow read the version of the info.plist of this program?
The Helper Tool itself is NOT a .app bundle, it is a binary that is embedded in my .app bundle residing in Contents/Library/PriviledgedHelperTools which has its Info.plist embedded inside of the __TEXT section of the binary using the linker flags
-sectcreate __TEXT __info_plist path/to/info.plist
Please note: I am currently not running this program, I just want to check if the currently installed helper tool is older than the one in my bundle and need to check if I have to update the helper tool (e.g. if its comming from a previous version of my program).
Just list all files inside the app dir. There are "version.plist" and "Info.plist" files that you can parse with simple script. If the app has another app inside then its structure is similar to parent.

Auto copy .app to Applications folder

When I click Product -> Archive for a Mac app in Xcode 6, I want the .app file to be automatically copied to the Applications folder replacing the earlier copy.
I've noticed there are post build actions for the Archive scheme but I don't know how to achieve this.
Basically you will want to add a custom shell script phase.
You could do any number of things there.

Include exec files in osx app bundle

Ive looked around a bit and cant find the answer I was hoping for, I am new to OSX dev so forgive me if this is a basic question.
Using NSTask I open up an exec file while my OSX is running that does stuff, I have to set a launchPath for this like so self.execFile.launchPath = #"/usr/local/bin/execFile";. This is fine when I'm running it on just my Mac, however, I would like to distribute this app. I am looking for a way to to save the execFile in, from what I gather so far from Googling, the apps bundle and call it from there, that way I can set the launchPath in the code and it would work on any computer. So far Ive only seen talk on how to access the app bundle but I don't know how to save a file there in the first place.
You must create a Copy Files build phase for your application target and add the exec files to the Copy Files build phase. Select your project from the project navigator to open the project editor. Select your application target from the left side of the project editor. Click the Build Phases button at the top of the editor. Choose Editor > Add Build Phase > Add Copy Files Build Phase to add the Copy Files build phase.
After creating the Copy Files build phase, click the disclosure triangle next to it. From there you can add files to the build phase and choose a location in the app bundle to copy the file. When you build the project, Xcode copies the files in the Copy Files build phase to the app bundle in the location you specified.

How do I run a Flash exe file within a Window/Form in a VB.Net Project?

How do I run a Flash exe file within a Window/Form in a VB.Net Project?
I do not have the SWF file so will have to use the exe file I have.
Maybe you can extract the swf file from the exe flash projector?
There are lots af utils that can do that, like this one.
add flash executable file to your project as embedded resource,
during the run time extract to temp folder run the project. at form closing delete the temp older flash executable file.
hope it helps.