Adobe Air SOL Location for OSX - macos

So I currently have an air app I am working on that I plan on distributing out. One of the features I have is the ability to import other SWF's and record what happens on screen. Now on windows, users are able to take the cookies of the swf that's being imported and place them in a folder so my air app can load them. This folder for windows is:
C:\Users[username]\AppData\Roaming
And inside the roaming folder will be a folder with the app name, and inside is where you would place the cookie files.
However, some of my users are reporting on the OSX end that they can not find this folder anywhere. I just got off a two hour skype call with a friend of mine who uses OSX and we could not find this folder equivalent at all. We went through three pages worth of google results and can not find this. Any help is welcome, thank you very much.

A quick google gave me the next result:
Macintosh HD:Users::Library:Preferences: AIR-App-Reverse-Domain-Name:Local Store:#SharedObjects: flashname.swf\filename.so
NOTE: On Mac OS X 10.7 (Lion) and above (Mountain Lion etc) the
Library folder is hidden...
http://www.adrianparr.com/?p=19
It looks like SharedObject files of an AIR application are located inside of the app-storage folder. And, maybe, it would be esier for you to get the path through the special variable:
File.applicationStorageDirectory + path-to-the-shared-object-directory

Related

Keeping 2 x Versions of Xcode on Mac

I was rooting around for the answer on StackOverflow to the question above, as I had recently updated to Mac Sierra and by doing so Xcode 7 updated to 8 automatically. I couldn't find the answer to what I wanted, so I decided to share my findings.
Of course I'm not quite ready to invest the time just yet in Swift 3.0 so I wanted to know how to keep two instances of Xcode on my machine for the time being.
Therefore below is how I went about doing this...
Login to Apple Developer Downloads and find Xcode 7.3.1 or equivalent version of what you want to maintain on your machine.
Download the file and double click on it to open the installer
DON'T drag it across to Applications just yet
Instead, open a Finder Window and drag it to Desktop/Downloads, to install it there
Control-click on the Xcode file to "Get Info"
Under Name & Extension, in the text field, change this from Xcode.app to Xcode7.app (or equivalent naming convention)
Drag this renamed file into Applications
Restart Mac
Open Xcode7 (or new & renamed application)
Voila! 2 x instances of Xcode on your Mac (Xcode proper & Xcode7)
I gather you should never open both apps at the same time. However here is a solution that really does help you if you are still currently developing in two apps or environments on different versions of Swift. Hope this helps.

Sandboxed Mac OS App, saving files in a shared location?

Have a Sandboxed Mac App. It downloads files to a location, and I want other files to be able to edit and overwrite the files.
Currently, I'm saving to the Documents Container via my App:
let path = manager.URLsForDirectory(NSSearchPathDirectory.DocumentDirectory, inDomains: NSSearchPathDomainMask.UserDomainMask).first!
I then am modifying via Preview and saving the file.
In OSX 10.11 El Capitan, this is fine. However, on Mac OS 10.12 Sierra Beta when the User attempts to save, we get the warning: "The original document can't be changed, so a duplicate with your changes has been created."
The same problem occurs when saving to Application Support.
Of course, this does make sense in that many use cases for Sandboxed Apps is that they won't want other Apps touching their content. Though is there a shared space in which Sandboxed Apps can allow other Apps modify their contents?

Mac .app file no longer working after being served by a webserver

Ok, so I am having a small problem. I have an .app file that was created by the Adobe Air converter. It works fine. However, when the .app file is zipped up on a CENT OS server the app no longer works. You can double click on the icon but the app just never launches.
The only weird thing that is being done by the server is that it is editing an xml file within the .app package, however, this .xml file doesn't even get loaded by the app until after it has launched so I can't see this being an issue?
I bet you (or the Adobe Air converter you used) code-signed your app package, in which case modifying the XML file (after it being built) would break things. I work on an app which requires frequent customization like this and the only way we're getting around it is to use a Macintosh (a MacMini) that's dedicated to building and code-signing unique versions.
The way to know what's going on is to look at your "Console.app" log, which should be logging some kind of error when you double click on your downloaded app.
Another thing you can do is (temporarily) disable the code on the web server that modifies the XML file and see if the downloaded app magically starts to work.

How to tell finder that my application is installed?

I am working on a cocoa application. I see a strange behaviour on Mac OS 10.6.8..!
My Cocoa application has an Automator action inside it. I want it to be listed in Automator as soon as I install it.
The conditions are as follows:
1. After installation, user should not go to the installed path.
2. User should not launch the application.
I mean, I am seeing this bug only for above mentioned situations. If I go to the installed folder, or launch the application, the automator app gets listed.
I didn't see this defect on Mac OS 10.7.5 or Mac OS 10.8.2..
Also I tried touch command via terminal just in case thinking that if any kind of Access updating is required and all. But that wasn't the case.
Any suggestions? Can I run any kind or Shell/Applescript while installing [After installation of the application] so that I can list the automator action in automator?
Any advice or help would be great!!
You can have a .txt file with the below script and then you have to add postflight script when taking .pkg file in Package Maker.
open "/Applications/yourAppName.app"
Try this Terminal command.
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister .../Whatever.app
You shouldn't hard-code the path, though, as users sometimes stick apps in weird locations (citation: I do it :).

How to deploy a FireMonkey Application for Mac OSX?

I can run a FireMonkey Application on Mac OSX with PAServer. But now, I would like to deploy the application Mac OS (something like MSI under Windows). How can I do this?
You'll want to read more about Application Bundles.
Using the application bundle that Delphi creates and deploys via PAServer
Since you're using the PAServer, you'll find that it has already created an application bundle for you. After you run the program via the PAServer, look in the following folder on the Mac for the application bundle:
/Users/[username]/Applications/Embarcadero/PAServer/scratch-dir/[profilename]
If your project is named Project1, you'll see an application bundle in that folder named Project1.
If you read the above wiki article, you'll know that Project1 has a "hidden" extension of .app, and the whole thing is really a folder with all of the required files to run the application.
Go ahead and run this application bundle directly on the Mac. If it complains about missing dylibs, such as libmidas.dylib, simply copy them from the PAServer folder into the application bundle's MacOS folder.
To the Mac OS user, the application bundle appears as a single program file, complete with an icon. The user can double-click the application bundle to run the application, drag it to their dock, etc.
Changing the icon
The application bundle will have the Delphi icon by default, but you can replace it with your own icon. On the Mac, simply right-click on the application bundle in Finder, and select Show Package Contents. In there, look in the Contents/Resources folder for the .icns file.
Use the Icon Composer application that was installed with XCode to create your .icns icon file from existing image files.
Peeking inside the bundle
Peek around inside at the rest of the contents. You'll see the required dylib, your program file, and the Info.plist file, which is a text file with things like application IDs, signatures, and other important things.
More about deployment
If your application can be self contained in an app bundle, the standard method is to put the application bundle inside a disk image .dmg file, which allows the user to drop the application into the applications folder.
If your application requires the installation of additional files, libraries, databases, or frameworks, etc., you should create a package. You can utilize PackageMaker to do this. A package is similar to the "msi" installer on Windows that you mention.
When the user double-clicks the package, it's run by Installer. It has a wizard style interface and walks the user through installing the application. You can also sign the package with your code signing certificate.
If you want to include your application bundle in the app store, you'll need to sign it. You'll also need to sandbox it.
Sandboxing and the Mac App Store - Nov 2, 2011
The vast majority of Mac users have been free from malware and we're
working on technologies to help keep it that way. As of March 1, 2012
all apps submitted to the Mac App Store must implement sandboxing.
Sandboxing your app is a great way to protect systems and users by
limiting the resources apps can access and making it more difficult
for malicious software to compromise users' systems. Learn more by
visiting the App Sandbox page.
You must create an Application Bundle in order to deploy you app on a OSX System .
Check these links for more information
Deploying Your Application (Mac OS X installers )
Application Bundle
Building Fancy DMG Images on Mac OS X

Resources