Skip to content

Commit

Permalink
Add Fjord Launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-goode committed May 15, 2024
1 parent 63d6e29 commit d2e87bc
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 0 deletions.
87 changes: 87 additions & 0 deletions bucket/fjordlauncher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"version": "8.3",
"description": "An open source Minecraft launcher with the ability to manage multiple instances, accounts and mods. Focused on user freedom and free redistributability.",
"homepage": "https://github.com/unmojang/FjordLauncher/",
"license": "GPL-3.0-only",
"notes": [
"To add Fjord Launcher file association options for .ZIPs and .MRPACKS, run this: \"$dir\\install-associations.reg\"",
"",
"This package is now using the portable version of Fjord Launcher, and data should have been migrated automatically.",
"If you are using a global install on a system with more than one user, you will need to copy a user's data from %appdata% to the new Scoop FjordLauncher persist directory"
],
"architecture": {
"64bit": {
"url": "https://github.com/unmojang/FjordLauncher/releases/download/8.3/FjordLauncher-Windows-MSVC-Portable-8.3.zip",
"hash": "394a46c7555294b7b287e829d4baeb8c718a61ba20f924db587e13b52bcf8e61"
}
},
"suggest": {
"Microsoft Visual C++ Redistributables": "extras/vcredist2022"
},
"pre_install": [
"$migration = $true",
"$visibleUserAccounts = Get-LocalUser | Where-Object { $_.Enabled -eq $true }",
"if ($global -and $visibleUserAccounts.Count -gt 1) { $migration = $false }",
"",
"$appdataPath = \"$HOME\\AppData\\Roaming\\FjordLauncher\"",
"if ((Test-Path -Path $appdataPath\\*) -and (!(Test-Path -Path $persist_dir\\*)) -and $migration) {",
" Write-Warning \"Migrating data from $appdataPath to $persist_dir (this may take a while)\"",
" New-Item -Type Directory -Path $persist_dir | Out-Null",
" Copy-Item -Recurse -Force $appdataPath\\* $persist_dir\\",
"} elseif (!($migration)) {",
" Write-Warning \"A global Scoop installation was detected with multiple user accounts. Please see the notes at the end of the install process.\"",
"}",
"",
"'accounts.json', 'metacache', 'fjordlauncher.cfg' | ForEach-Object {",
" if (!(Test-Path -Path $persist_dir\\$_)) {",
" New-Item -Type File $dir/$_ | Out-Null",
" }",
"}",
"Add-Content $dir/metacache '{}'",
"Remove-Item $original_dir/fjordlauncher_updater.exe"
],
"post_install": [
"'install-associations', 'uninstall-associations' | ForEach-Object {",
" if (Test-Path \"$bucketsdir\\games\\scripts\\fjordlauncher\\$_.reg\") {",
" $exePath = \"$dir\\fjordlauncher.exe\".Replace('\\', '\\\\')",
" $content = (Get-Content \"$bucketsdir\\games\\scripts\\fjordlauncher\\$_.reg\").Replace('$EXEPATH', $exePath)",
" if ($global) { $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE') }",
" Set-Content \"$dir\\$_.reg\" $content -Encoding Ascii -Force",
" }",
"}"
],
"bin": "fjordlauncher.exe",
"shortcuts": [
[
"fjordlauncher.exe",
"Fjord Launcher"
]
],
"persist": [
"assets",
"cache",
"catpacks",
"icons",
"iconthemes",
"instances",
"libraries",
"logs",
"meta",
"mods",
"themes",
"translations",
"accounts.json",
"metacache",
"fjordlauncher.cfg"
],
"checkver": {
"github": "https://github.com/unmojang/FjordLauncher"
},
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://github.com/FjordLauncher/FjordLauncher/releases/download/$version/FjordLauncher-Windows-MSVC-Portable-$version.zip"
}
}
}
}
46 changes: 46 additions & 0 deletions scripts/fjordlauncher/install-associations.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\fjordlauncher.exe]
@="Minecraft Mod-Pack"

[HKEY_CURRENT_USER\Software\Classes\fjordlauncher.exe\DefaultIcon]
@="$EXEPATH,0"

[HKEY_CURRENT_USER\Software\Classes\fjordlauncher.exe\shell]
@="open"

[HKEY_CURRENT_USER\Software\Classes\fjordlauncher.exe\shell\open]
@="Import into Fjord Launcher"

[HKEY_CURRENT_USER\Software\Classes\fjordlauncher.exe\shell\open\command]
@="$EXEPATH"

[HKEY_CURRENT_USER\Software\Classes\Applications\fjordlauncher.exe\shell\open\command]
@="$EXEPATH -I \"%1\""

[HKEY_CURRENT_USER\Software\Classes\Applications\fjordlauncher.exe]
"FriendlyAppName"= "Fjord Launcher"

[HKEY_CURRENT_USER\Software\Classes\Applications\fjordlauncher.exe\Capabilities]
"ApplicationDescription"="Minecraft Mod-Pack"

[HKEY_CURRENT_USER\Software\RegisteredApplications]
"Fjord Launcher"="Software\Classes\Applications\fjordlauncher.exe\Capabilities"

[HKEY_CURRENT_USER\Software\Classes\.zip\OpenWithList]
"fjordlauncher.exe"=""

[HKEY_CURRENT_USER\Software\Classes\.zip\OpenWithProgids]
"fjordlauncher.exe"=""

[HKEY_CURRENT_USER\Software\Classes\.mrpack\OpenWithList]
"fjordlauncher.exe"=""

[HKEY_CURRENT_USER\Software\Classes\.mrpack\OpenWithProgids]
"fjordlauncher.exe"=""

[HKEY_CURRENT_USER\Software\Classes\Applications\fjordlauncher.exe\Capabilities\FileAssociations]
".mrpack"="fjordlauncher.exe"

[HKEY_CURRENT_USER\Software\Classes\Applications\fjordlauncher.exe\Capabilities\FileAssociations]
".zip"="fjordlauncher.exe"
20 changes: 20 additions & 0 deletions scripts/fjordlauncher/uninstall-associations.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\Classes\fjordlauncher.exe]

[-HKEY_CURRENT_USER\Software\Classes\Applications\fjordlauncher.exe]

[HKEY_CURRENT_USER\Software\RegisteredApplications]
"Fjord Launcher"=-

[HKEY_CURRENT_USER\Software\Classes\.zip\OpenWithList]
"fjordlauncher.exe"=-

[HKEY_CURRENT_USER\Software\Classes\.zip\OpenWithProgids]
"fjordlauncher.exe"=-

[HKEY_CURRENT_USER\Software\Classes\.mrpack\OpenWithList]
"fjordlauncher.exe"=-

[HKEY_CURRENT_USER\Software\Classes\.mrpack\OpenWithProgids]
"fjordlauncher.exe"=-

0 comments on commit d2e87bc

Please sign in to comment.