-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
381cd6f
commit acc64fd
Showing
2 changed files
with
18 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
import { pathExists } from "./utils"; | ||
import {pathExists} from './utils'; | ||
import {os} from '@neutralinojs/lib'; | ||
|
||
export async function hasRoblox(): Promise<boolean> { | ||
if (await pathExists("/Applications/Roblox.app/Contents/MacOS/RobloxPlayer")) { | ||
return true | ||
} else { | ||
return false | ||
} | ||
} | ||
if (await pathExists('/Applications/Roblox.app/Contents/MacOS/RobloxPlayer')) { | ||
return true; | ||
} else { | ||
os.execCommand(`osascript <<'END' | ||
set theAlertText to "Roblox is not installed" | ||
set theAlertMessage to "To use AppleBlox, you first need to install Roblox. Would you like to open the download page?" | ||
display alert theAlertText message theAlertMessage as critical buttons {"Cancel", "Open link"} default button "Open link" cancel button "Cancel" giving up after 60 | ||
set the button_pressed to the button returned of the result | ||
if the button_pressed is "Open link" then | ||
open location "https://roblox.com/download" | ||
end if | ||
END`); | ||
return false; | ||
} | ||
} |