Skip to content

Commit

Permalink
even further GShade installer improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
marzent committed Jan 17, 2022
1 parent 9f57f91 commit 1edd1e5
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 14 deletions.
8 changes: 4 additions & 4 deletions XIV on Mac.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
507CFBF62781C780007ADEC9 /* ZIPFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = 507CFBF52781C780007ADEC9 /* ZIPFoundation */; };
507D8F2127766F52000F0CB0 /* dxvk in Resources */ = {isa = PBXBuildFile; fileRef = 507D8F2027766F52000F0CB0 /* dxvk */; };
50BD278727785418002B0D1F /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50BD278627785418002B0D1F /* Notifications.swift */; };
50DF45992795C53300E3D22F /* GShade in Resources */ = {isa = PBXBuildFile; fileRef = 50DF45982795C53300E3D22F /* GShade */; };
50E5387B2779CF5C0038521A /* SettingsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50E5387A2779CF5C0038521A /* SettingsController.swift */; };
50E709672794B61C0042B26D /* install_gshade.sh in Resources */ = {isa = PBXBuildFile; fileRef = 50E709662794B61B0042B26D /* install_gshade.sh */; };
50ED0DB32773C619002E9854 /* Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50ED0DB22773C619002E9854 /* Setup.swift */; };
50ED0DB52773CA8C002E9854 /* FileDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50ED0DB42773CA8C002E9854 /* FileDownloader.swift */; };
/* End PBXBuildFile section */
Expand All @@ -37,8 +37,8 @@
505C0D9A277333920008A344 /* Util.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Util.swift; sourceTree = "<group>"; };
507D8F2027766F52000F0CB0 /* dxvk */ = {isa = PBXFileReference; lastKnownFileType = folder; path = dxvk; sourceTree = "<group>"; };
50BD278627785418002B0D1F /* Notifications.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Notifications.swift; sourceTree = "<group>"; };
50DF45982795C53300E3D22F /* GShade */ = {isa = PBXFileReference; lastKnownFileType = folder; path = GShade; sourceTree = "<group>"; };
50E5387A2779CF5C0038521A /* SettingsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsController.swift; sourceTree = "<group>"; };
50E709662794B61B0042B26D /* install_gshade.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = install_gshade.sh; sourceTree = "<group>"; };
50ED0DB22773C619002E9854 /* Setup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Setup.swift; sourceTree = "<group>"; };
50ED0DB42773CA8C002E9854 /* FileDownloader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileDownloader.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -85,9 +85,9 @@
50ED0DB42773CA8C002E9854 /* FileDownloader.swift */,
2B7C95D1277C6C6000A3CA89 /* SocialIntegration.swift */,
50511EC82770E087003A1E9F /* Assets.xcassets */,
50E709662794B61B0042B26D /* install_gshade.sh */,
50511ECA2770E087003A1E9F /* Main.storyboard */,
50511ECD2770E087003A1E9F /* XIV_on_Mac.entitlements */,
50DF45982795C53300E3D22F /* GShade */,
507D8F2027766F52000F0CB0 /* dxvk */,
5043E36B27728BA300E59127 /* wine */,
);
Expand Down Expand Up @@ -163,8 +163,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
50DF45992795C53300E3D22F /* GShade in Resources */,
50511EC92770E087003A1E9F /* Assets.xcassets in Resources */,
50E709672794B61C0042B26D /* install_gshade.sh in Resources */,
507D8F2127766F52000F0CB0 /* dxvk in Resources */,
50511ECC2770E087003A1E9F /* Main.storyboard in Resources */,
5043E36C27728BA300E59127 /* wine in Resources */,
Expand Down
Binary file not shown.
39 changes: 33 additions & 6 deletions XIV on Mac/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,39 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}

@IBAction func installGShade(_ sender: Any) {
Util.launch(exec: URL(string: "file:///usr/bin/open")!,
args: ["-n", "-b", "com.apple.Terminal",
Bundle.main.url(forResource: "install_gshade", withExtension: "sh", subdirectory: "")!.path,
"--env", "WINEPATH=\( Bundle.main.url(forResource: "bin", withExtension: nil, subdirectory: "wine")!.path)",
"--env", "WINEESYNC=\(Util.esync ? "1" : "0")",
"--env", "WINEPREFIX=\(Util.prefix.path)"])
if #available(OSX 11.0, *) {
Util.launch(exec: URL(string: "file:///usr/bin/open")!,
args: ["-n", "-b", "com.apple.Terminal",
Bundle.main.url(forResource: "install_gshade", withExtension: "sh", subdirectory: "GShade")!.path,
"--env", "WINEPATH=\( Bundle.main.url(forResource: "bin", withExtension: nil, subdirectory: "wine")!.path)",
"--env", "WINEESYNC=\(Util.esync ? "1" : "0")",
"--env", "WINEPREFIX=\(Util.prefix.path)"])
} else {
let alert = NSAlert()
alert.messageText = "Catalina is not supported by the automatic GShade installer"
alert.informativeText = "You can still manually run the GShade Linux install script"
alert.alertStyle = .critical
alert.addButton(withTitle: "OK")
alert.runModal()
}
}

@IBAction func manualGShade(_ sender: Any) {
if #available(OSX 11.0, *) {
Util.launch(exec: URL(string: "file:///usr/bin/open")!,
args: ["-n", "-b", "com.apple.Terminal",
Bundle.main.url(forResource: "manual_gshade", withExtension: "sh", subdirectory: "GShade")!.path,
"--env", "WINEPATH=\( Bundle.main.url(forResource: "bin", withExtension: nil, subdirectory: "wine")!.path)",
"--env", "WINEESYNC=\(Util.esync ? "1" : "0")",
"--env", "WINEPREFIX=\(Util.prefix.path)"])
} else {
let alert = NSAlert()
alert.messageText = "When running Catalina you must have wine or CrossOver installed"
alert.informativeText = "You can also manually add the wine version bundled with the XIV on Mac.app to your $PATH"
alert.alertStyle = .warning
alert.addButton(withTitle: "OK")
alert.runModal()
}
}

@IBAction func fullInstall(_ sender: Any) {
Expand Down
21 changes: 17 additions & 4 deletions XIV on Mac/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,24 @@
<action selector="movieFix:" target="Voe-Tx-rLC" id="Ti0-d7-yh6"/>
</connections>
</menuItem>
<menuItem title="GShade" id="Jyy-2Z-CH0">
<menuItem title="GShade" id="9VN-cs-jNP">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="installGShade:" target="Voe-Tx-rLC" id="kL6-Y3-mYN"/>
</connections>
<menu key="submenu" title="GShade" id="AgC-OX-7rb">
<items>
<menuItem title="Auto Install" id="8FT-OM-tMB">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="installGShade:" target="Voe-Tx-rLC" id="9mh-2w-KJ5"/>
</connections>
</menuItem>
<menuItem title="Manual Install" id="Taa-Lw-mwf">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="manualGShade:" target="Voe-Tx-rLC" id="7Yg-HS-g4g"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="8ME-M6-Hmm"/>
<menuItem title="Run Install Wizard" id="WUo-tp-nqk">
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions XIV on Mac/GShade/manual_gshade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

cd $TMPDIR
export PATH=$WINEPATH:$PATH
echo $WINEPATH
rm master.zip
rm -rf gshade_installer-master
curl -LO https://github.com/HereInPlainSight/gshade_installer/archive/refs/heads/master.zip
unzip -qquo master.zip
cd gshade_installer-master
./gshade_installer.sh

0 comments on commit 1edd1e5

Please sign in to comment.