Skip to content

Commit

Permalink
Switch project to PolyMC
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayBox committed Jan 9, 2022
1 parent 6ce16d9 commit d1bbe66
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build/darwin/MultiMC-Curseforge.app/Contents/MacOS/MultiMC-Curseforge
build/linux/usr/bin/multimc-curseforge
build/windows/MultiMC-Curseforge.exe
build/darwin/PolyMC-Curseforge.app/Contents/MacOS/PolyMC-Curseforge
build/linux/usr/bin/polymc-curseforge
build/windows/PolyMC-Curseforge.exe
output/
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ all: clean darwin linux windows

clean:
-rm -rf ./output
-rm ./build/darwin/MultiMC-Curseforge.app/Contents/MacOS/MultiMC-Curseforge
-rm ./build/linux/usr/bin/multimc-curseforge
-rm ./build/darwin/PolyMC-Curseforge.app/Contents/MacOS/PolyMC-Curseforge
-rm ./build/linux/usr/bin/polymc-curseforge

darwin:
mkdir -p output
GOOS=darwin GOARCH=amd64 $(GOCMD) build $(GOFLAGS) -o ./build/darwin/MultiMC-Curseforge.app/Contents/MacOS/MultiMC-Curseforge
GOOS=darwin GOARCH=amd64 $(GOCMD) build $(GOFLAGS) -o ./build/darwin/PolyMC-Curseforge.app/Contents/MacOS/PolyMC-Curseforge
tar -czvf ./output/darwin.tar.gz --exclude .gitkeep -C ./build/darwin .

linux:
mkdir -p output
GOOS=linux GOARCH=386 $(GOCMD) build $(GOFLAGS) -o ./build/linux/usr/bin/multimc-curseforge
GOOS=linux GOARCH=386 $(GOCMD) build $(GOFLAGS) -o ./build/linux/usr/bin/polymc-curseforge
tar -czvf ./output/linux.tar.gz --exclude .gitkeep -C ./build/linux .

windows:
mkdir -p output
GOOS=windows GOARCH=386 $(GOCMD) build $(GOFLAGS) -o ./output/MultiMC-Curseforge.exe
GOOS=windows GOARCH=386 $(GOCMD) build $(GOFLAGS) -o ./output/PolyMC-Curseforge.exe
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
# MultiMC-Curseforge
# PolyMC-Curseforge

A simple Go program that handles Curseforge's custom protocol and ccip files
1. Reads the [CurseForge] `.ccip` file or `curseforge://` protocol
2. Requests the [CurseForge] to get the zip url
3. Launches [MultiMC] with the `--import` flag, with the url
3. Launches [PolyMC] with the `--import` flag, with the url
4. Downloads the modpack icon into the icons folder

Instructions:
- macOS - Move `MultiMC-Curseforge.app` into `Applications`
- macOS - Move `PolyMC-Curseforge.app` into `Applications`
- Linux - [AUR] or Manually install files into system
- Windows - Move `MultiMC-Curseforge.exe` into `MultiMC` folder and execute as admin
- Windows - Move `PolyMC-Curseforge.exe` into `PolyMC` folder and execute

Note: Having the Curse app installed may break this.

[Download](https://github.com/ShayBox/MultiMC-Curseforge/releases)
[Download](https://github.com/ShayBox/PolyMC-Curseforge/releases)

I do not support MultiMC and its developers anymore
If you would like to know more, check out [PolyMC]

[CurseForge]: https://www.curseforge.com/
[MultiMC]: https://multimc.org/
[AUR]: https://aur.archlinux.org/packages/multimc-curseforge/
[PolyMC]: https://polymc.org/
[AUR]: https://aur.archlinux.org/packages/Polymc-curseforge/
4 changes: 2 additions & 2 deletions build/darwin/MultiMC-Curseforge.app/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>MultiMC-Curseforge</string>
<string>PolyMC-Curseforge</string>
<key>CFBundleIdentifier</key>
<string>com.shaybox.multimc-curseforge</string>
<string>com.shaybox.polymc-curseforge</string>
<key>NSUIElement</key>
<true/>
<key>CFBundleURLTypes</key>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=MultiMC-Curseforge
Exec=multimc-curseforge %u
Name=PolyMC-Curseforge
Exec=polymc-curseforge %u
Terminal=false
MimeType=x-scheme-handler/curseforge;
OnlyShowIn=
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/shaybox/multimc-curseforge
module github.com/shaybox/polymc-curseforge

go 1.17

require golang.org/x/sys v0.0.0-20210903071746-97244b99971b
require golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
golang.org/x/sys v0.0.0-20210903071746-97244b99971b h1:3Dq0eVHn0uaQJmPO+/aYPI/fRMqdrVDbu7MQcku54gg=
golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
18 changes: 9 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,31 +70,31 @@ func main() {
var args []string
switch runtime.GOOS {
case "darwin":
path = "/Applications/MultiMC.app/Contents/MacOS/icons/" + addonInfo.Name
args = []string{"open", "-a", "MultiMC", "--args", "--import", pack}
path = "/Applications/PolyMC.app/Contents/MacOS/icons/" + addonInfo.Name
args = []string{"open", "-a", "PolyMC", "--args", "--import", pack}
case "freebsd", "linux", "netbsd", "openbsd":
home, err := os.UserHomeDir()
if err != nil {
fmt.Println(err)
}

path = home + "/.local/share/multimc/icons/" + addonInfo.Name
// Workaround for hacky MultiMC.deb package wrapper
deb := "/opt/multimc/run.sh"
path = home + "/.local/share/polymc/icons/" + addonInfo.Name
// Workaround for hacky PolyMC.deb package wrapper
deb := "/opt/polymc/run.sh"
if FileExists(deb) {
args = []string{deb, "--import", pack}
} else {
args = []string{"multimc", "--import", pack}
args = []string{"polymc", "--import", pack}
}
case "windows":
executable, err := os.Executable()
if err != nil {
fmt.Println(err)
}

multimc := filepath.Dir(executable)
path = multimc + "\\icons\\" + addonInfo.Name
args = []string{"MultiMC.exe", "--import", pack}
polymc := filepath.Dir(executable)
path = polymc + "\\icons\\" + addonInfo.Name
args = []string{"PolyMC.exe", "--import", pack}
}

var attachmentURL string
Expand Down
2 changes: 1 addition & 1 deletion main_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func UpdateRegistry() error {
return err
}

err = iconKey.SetStringValue("", dir+"\\MultiMC.exe")
err = iconKey.SetStringValue("", dir+"\\PolyMC.exe")
if err != nil {
return err
}
Expand Down

0 comments on commit d1bbe66

Please sign in to comment.