diff --git a/Makefile b/Makefile index eb54fdc9..d8e931b9 100644 --- a/Makefile +++ b/Makefile @@ -80,6 +80,9 @@ $(warning Set PLATFORM to 2, which is equal to iOS.) else ifeq ($(PLATFORM),3) PLATFORM_NAME := tvos $(warning Set PLATFORM to 3, which is equal to tvOS.) +else ifeq ($(PLATFORM),6) +PLATFORM_NAME := maccatalyst +$(warning Set PLATFORM to 6, which is equal to Mac Catalyst.) else ifeq ($(PLATFORM),7) PLATFORM_NAME := iossimulator $(warning Set PLATFORM to 7, which is equal to iOS Simulator.) diff --git a/Natives/main.m b/Natives/main.m index b0bb677d..abf872b7 100644 --- a/Natives/main.m +++ b/Natives/main.m @@ -300,11 +300,9 @@ void init_setupHomeDirectory() { NSString *homeDir; NSError *homeError; - if ([@(getenv("HOME")) isEqualToString:@"/var/mobile"]) { - homeDir = @"/var/mobile/Documents/PojavLauncher"; - } else { - homeDir = [NSString stringWithFormat:@"%s/Documents", getenv("HOME")]; - } + BOOL isNotSandboxed = [@(getenv("HOME")).lastPathComponent isEqualToString:NSUserName()]; + homeDir = [NSString stringWithFormat:@"%s/Documents%@", getenv("HOME"), + isNotSandboxed ? @"/PojavLauncher":@""]; if (![fm fileExistsAtPath:homeDir] ) { [fm createDirectoryAtPath:homeDir withIntermediateDirectories:NO attributes:nil error:&homeError];