Skip to content

Commit

Permalink
losslesscut: Add file associations (ScoopInstaller#12089)
Browse files Browse the repository at this point in the history
* Create uninstall-associations.reg

* Create install-associations.reg

* Update losslesscut.json
  • Loading branch information
xmha97 authored Dec 29, 2024
1 parent a657569 commit d5ba6bd
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
23 changes: 23 additions & 0 deletions bucket/losslesscut.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"description": "Lossless trimming tool for video and audio files",
"homepage": "https://github.com/mifi/lossless-cut",
"license": "GPL-2.0-or-later",
"notes": [
"For .mp4 and .mkv file associations, run:",
"\"$dir\\install-associations.reg\""
],
"architecture": {
"64bit": {
"url": "https://github.com/mifi/lossless-cut/releases/download/v3.64.0/LosslessCut-win-x64.7z",
Expand All @@ -16,6 +20,25 @@
"LosslessCut"
]
],
"post_install": [
"$dirpath = \"$dir\".Replace('\\', '\\\\')",
"'install-associations', 'uninstall-associations' | ForEach-Object {",
" if (Test-Path \"$bucketsdir\\extras\\scripts\\losslesscut\\$_.reg\") {",
" $content = Get-Content \"$bucketsdir\\extras\\scripts\\losslesscut\\$_.reg\"",
" $content = $content.Replace('$dirpath', $dirpath)",
" $content | Set-Content -Path \"$dir\\$_.reg\"",
" }",
"}"
],
"uninstaller": {
"script": [
"if ($cmd -eq 'uninstall') {",
" $regkey = Get-ItemProperty -Path 'HKCU:\\SOFTWARE\\Classes\\Applications\\LosslessCut.exe' -ErrorAction SilentlyContinue",
" if ($regkey) {",
" reg import \"$dir\\uninstall-associations.reg\"",
"}"
]
},
"checkver": "github",
"autoupdate": {
"architecture": {
Expand Down
23 changes: 23 additions & 0 deletions scripts/losslesscut/install-associations.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\Applications\LosslessCut.exe]
"FriendlyAppName"="LosslessCut"

[HKEY_CURRENT_USER\Software\Classes\Applications\LosslessCut.exe\DefaultIcon]
@="\"$dirpath\\LosslessCut.exe\",0"

[HKEY_CURRENT_USER\Software\Classes\Applications\LosslessCut.exe\shell]

[HKEY_CURRENT_USER\Software\Classes\Applications\LosslessCut.exe\shell\open]
"Icon"="\"$dirpath\\LosslessCut.exe\",0"

[HKEY_CURRENT_USER\Software\Classes\Applications\LosslessCut.exe\shell\open\command]
@="\"$dirpath\\LosslessCut.exe\" \"%1\""

[HKEY_CURRENT_USER\Software\Classes\Applications\LosslessCut.exe\SupportedTypes]
".mp4"=""
".mkv"=""

[HKEY_CURRENT_USER\Software\Classes\.mkv\OpenWithList\LosslessCut.exe]

[HKEY_CURRENT_USER\Software\Classes\.mp4\OpenWithList\LosslessCut.exe]
7 changes: 7 additions & 0 deletions scripts/losslesscut/uninstall-associations.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Windows Registry Editor Version 5.00

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

[-HKEY_CURRENT_USER\Software\Classes\.mkv\OpenWithList\LosslessCut.exe]

[-HKEY_CURRENT_USER\Software\Classes\.mp4\OpenWithList\LosslessCut.exe]

0 comments on commit d5ba6bd

Please sign in to comment.