App Wrapper question

My app has a spellcheck dictionary folder that normally lives in the same folder as the application. When I use App Wrapper, is there a way of wrapping this folder with the app somehow to create the installer pkg? There is also a troubleshooting html file there too I’d like to keep with it.
So, once installed, the application’s folder will have the app, a spell check folder, and an html file all in the same folder.

Add the dictionary, the file and whatever else you need to the package after your app is built. Right click on the app and select “show package contents.” You will need to code your app to look for those files there.

Will these files ever change? On a Mac couldn’t you simply drop them into your project window and call them from the resource folder as a resource fork?

Use a copy files step to copy the dictionary and help html into the app resource folder. You can then load it with:

f=GetFolderitem("").Child(App.ExecutableFile.Name + ".app").Child("Contents").Child("Resources").Child(FILENAMEHERE)

where f is the dictionary file you use in the app.

[quote]On a Mac couldn’t you simply drop them into your project window and call them from the resource folder as a resource fork[/quote]?
No. I believe that when dropped into your project in that way, the file no longer retains its characteristics. You could drop a text file and refer to it as a string, but an HTML file will just be a text string, not an html file.

The user has the option of adding words to the dictionary and can even add new language dictionaries. I guess they could probably do that if they right-click and show contents. I’ll try adding it that way Jason. Thanks for all the help. I’ll let you know how i make out.

Mac Apps are signed and you cannot modify the contents of Application.app without breaking it or seeing an error message I thought? Even changing an image file will break an application (people tried replacing the toolbar images with the beta of Xojo in the beginning because the original toolbars were too dark to see anything.) Which is why the Xojo Developer’s Library was recompiled and all resources were moved to the user documents after Mac 10.6. The software would simply crash and burn as soon as an internal database was modified. On a developer platform you can disable the securities and make it “ok”… but a developer will always have more control over their system than the standard user who leaves everything “locked down.” Modifying or allowing the contents of Application.app to change for an unsigned application is ok…but once it’s signed, modifying the contents will break it. Thus why Mac prompts to start “unsigned” applications (in case they’ve been maliciously manipulated).

Extending what Matthew said… If you plan on allowing the user to update the dictionary, I think you will need to look into storing the dictionary in the Application Support folder. That folder can be accessed and modified by a sandboxed app and the code signature would not break if the dictionary is stored and edited there. I didn’t know you were going to be allowing edits to the dictionary so sorry if I misguided you. Definitely let us know how it turns out either way. Good luck.

Certainly store your data file in the application resources folder. Then when the app opens check to see if the dictionary exists in the application support folder.

If it doesn’t exist, copy it from the resources into the app support folder and then you can read/write the file.

User accessible files should definitely be stored, as others have indicated, in SpecialFolder.ApplicationData. The fact that these files were to be user altered was not clear in the OP.
To clear up misinformation in this thread, the correct path to access the Resources Folder within the App Package is…

dim f As FolderItem = app.ExecutableFile.Parent.Parent.Child("Resources").Child(yourFile)

Did you try the code I gave? I use it in my apps, and it does access a file in the Resources folder. There was no “misinformation.”

I would try to dissuade you from using this form

Someone could remove the “.app” and your code would break but Roger’s would not
And they could rename the bundle & your code would break (the exe in the bundle does not have to have the same name as the bundle) - again your code would break.

And yes people do that - i have about 10 copies of REALStudio / Xojo installed& I renamed nearly every one with the specific version # so I can tell which is which

[quote=56538:@Norman Palardy]I would try to dissuade you from using this form

Someone could remove the “.app” and your code would break but Roger’s would not
And they could rename the bundle & your code would break (the exe in the bundle does not have to have the same name as the bundle) - again your code would break.

And yes people do that - i have about 10 copies of REALStudio / Xojo installed& I renamed nearly every one with the specific version # so I can tell which is which[/quote]
Ok thats a good point. Since I haven’t been changing the names of my bundles I didn’t realize that. Thanks for letting me know.