Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bigger changes #37

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

MaddTheSane
Copy link
Contributor

Let's begin working on having a better OS X version…

The -mmacosx-version-min option will set the MACOSX_DEPLOYMENT_TARGET, as well as properly sets the linker settings.
Store the cases and saves in a static variable.
Add support for having cases in the user's directory.
Move the storage of the data to within the app's contents.
Currently, we just cast down to the 32-bit integer, as I don't see this project needing 64-bit integers.
The only exception to this is the SignatureIsValid function.
Instead, rely on the info.plist file.
Add a special macro for help with autorelease pools.
…ring and CFBundleVersion to the version passed to it.

Pass GetPropertyListXMLForVersionStringOSX the application's info.plist file.
Actually have the project link.
Quiet a warning about an unused function.
(hopefully) Add case opening support for OS X.
*pVersionStringLength = 0;

NSFileManager *defaultManager = [NSFileManager defaultManager];
NSString *pErrorDesc = nil;
//TODO: Save the NSString as, say, a static pointer.
NSString *pProperyListPath = [defaultManager stringWithFileSystemRepresentation:pPropertyListFilePath.c_str() length: pPropertyListFilePath.size()];
NSString *pProperyListPath = [defaultManager
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not your mistake, but while you're here, might as well fix my typo of "propery" (should be "property").

@GabuEx
Copy link
Owner

GabuEx commented Mar 20, 2015

Hey, sorry for taking so long to get to this - I was super busy when this first went up such that I couldn't have a look at it, and then it kind of fell off my radar. This does look pretty good - I just have a few questions and comments based on my look through it:

  1. If I'm reading the changes to localApplicationSupportDirectory, this changes things such that instead of using NSApplicationSupportDirectory, it uses the resources directory inside the .app? If so, that's awesome; that's pretty much exactly what I was thinking of doing (I was considering doing pretty much this, but then you did it before I dove into that) and was curious if that was the correct thing to do.
  2. I see that you've added an additional cases path in the user directory in addition to the global cases path. I'm wondering why that is - it was my intention to have all cases just be global, as it seems like there's no reason to have cases be per-user, and that could result in there being multiple copies of files several hundred MB in size, which seems suboptimal.
  3. Given that you've switched over to just use Info.plist for the version string retrieval (which makes perfect sense), I don't suppose you were able to test WriteNewVersion() in some way with this change? It seems like things should just work since it explicitly retrieves the current contents, replaces the version number, and then writes out the XML representation of the properties, but I'm just wary of that blowing away something in Info.plist. If not, don't worry about it, but I figured I'd ask.

That's about all that I can think of. Thanks so much for doing all this. :) It's really invaluable to get help from someone who knows OS X so much better than I do (which is to say, at all).

@MaddTheSane
Copy link
Contributor Author

1: Yes. Also, many modern OS X games have their contents within the app bundle.
2: I decided to have cases moved to the user's directory because it's generally a bad practice to modify a bundle's contents, one reason is because someone might not have the right permissions to modify it. This won't be a problem with single-user set-ups, but would have issues if multiple users are set up. There is a folder at /Users/Shared which might be a better option. I'll look into using that instead.
3: I have not tested it, but I do know my NSDictionaries.

@GabuEx
Copy link
Owner

GabuEx commented Mar 24, 2015

This all sounds good. Wasn't aware that modifying an .app's contents was considered bad practice, though after thinking about that I can see why. If there is a specific shared folder where cases could go, I'm all for that. I'd say this is pretty much ready to be merged once that's done. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants