From 3e6982fec1df0a53ed47d9d0e8ecd04f03166672 Mon Sep 17 00:00:00 2001 From: pohlymorph Date: Fri, 10 Jan 2025 16:14:07 +0100 Subject: [PATCH 1/6] beyondcompare-np:Add version 5.x.y.z --- bucket/beyondcompare-np.json | 93 +++++++++++++++++++ .../install-context-32bit.reg | 31 +++++++ .../install-context-64bit.reg | 31 +++++++ .../beyondcompare-np/uninstall-context.reg | 31 +++++++ 4 files changed, 186 insertions(+) create mode 100644 bucket/beyondcompare-np.json create mode 100644 scripts/beyondcompare-np/install-context-32bit.reg create mode 100644 scripts/beyondcompare-np/install-context-64bit.reg create mode 100644 scripts/beyondcompare-np/uninstall-context.reg diff --git a/bucket/beyondcompare-np.json b/bucket/beyondcompare-np.json new file mode 100644 index 000000000..3d60f59d9 --- /dev/null +++ b/bucket/beyondcompare-np.json @@ -0,0 +1,93 @@ +{ + "version": "5.0.4.30422", + "description": "Directory and file compare functions in one package", + "homepage": "https://www.scootersoftware.com", + "license": { + "identifier": "Shareware", + "url": "https://www.scootersoftware.com/kb/licensev5" + }, + "notes": [ + "The manifest is already updated to v5, if you want to stay on v4 proceed as follows:", + "", + "- Install v4 via 'scoop install versions/beyondcompare4'", + "- Consider uninstalling v5 via 'scoop uninstall nonportable/beyondcompare-np'", + "", + "Or maybe you want to upgrade license from v4 to v5: https://www.scootersoftware.com/kb/upgradepolicy" + ], + "innosetup": true, + "architecture": { + "64bit": { + "url": "https://www.scootersoftware.com/files/BCompareSetup-5.0.4.30422.zip", + "hash": "2cfb571c94885fce248e6eac4da3f02c930db35176bd964f22b203a6833f5672", + "installer": { + "file": "BCompareSetup.exe", + "args": [ + "/DIR=\"$dir\"", + "/VERYSILENT", + "/SUPPRESSMSGBOXES", + "/NORESTART" + ] + } + }, + "32bit": { + "url": "https://www.scootersoftware.com/files/BCompareSetup-5.0.4.30422.zip", + "hash": "2cfb571c94885fce248e6eac4da3f02c930db35176bd964f22b203a6833f5672", + "installer": { + "file": "BCompareSetup.exe", + "args": [ + "/32", + "/DIR=\"$dir\"", + "/VERYSILENT", + "/SUPPRESSMSGBOXES", + "/NORESTART" + ] + } + } + }, + "bin": [ + "Bcomp.exe", + "BCompare.exe", + "BCClipboard.exe" + ], + "shortcuts": [ + [ + "BCompare.exe", + "Beyond Compare 5" + ], + [ + "BCClipboard.exe", + "Clipboard Compare" + ] + ], + "post_install": [ + "$dir_escaped = \"$dir\".Replace('\\', '\\\\')", + "\"install-context-$architecture\", \"uninstall-context\" | ForEach-Object {", + " if (Test-Path \"$bucketsdir\\$bucket\\scripts\\$app\\$_.reg\") {", + " $content = Get-Content \"$bucketsdir\\$bucket\\scripts\\$app\\$_.reg\"", + " $content = $content.Replace('$install_dir', $dir_escaped)", + " if ($global) {", + " $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE')", + " }", + " $outfile_no_arch = $_.Replace(\"-$architecture\", \"\")", + " $content | Set-Content -Path \"$dir\\$outfile_no_arch.reg\"", + " }", + "}", + "", + "if ($cmd -eq 'install') {", + " Invoke-Command {reg import \"$dir\\install-context.reg\" 2>&1 | Out-Null}", + "}" + ], + "pre_uninstall": [ + "", + "if ($cmd -eq 'uninstall') {", + " Invoke-Command {reg import \"$dir\\uninstall-context.reg\" 2>&1 | Out-Null}", + "}" + ], + "checkver": { + "url": "https://www.scootersoftware.com/kb/dl5_winalternate", + "regex": "files/BCompareSetup-([\\d.]+)\\.zip" + }, + "autoupdate": { + "url": "https://www.scootersoftware.com/files/BCompareSetup-$version.zip" + } +} diff --git a/scripts/beyondcompare-np/install-context-32bit.reg b/scripts/beyondcompare-np/install-context-32bit.reg new file mode 100644 index 000000000..9332bbe31 --- /dev/null +++ b/scripts/beyondcompare-np/install-context-32bit.reg @@ -0,0 +1,31 @@ +Windows Registry Editor Version 5.00 + + +[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Cached] +"{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5} {000214E4-0000-0000-C000-000000000046} 0xFFFF"=hex(3):01,00,00,00,00,00,00,00,80,96,f0,89,7b,07,db,01 + + + + + + + + +[HKEY_CURRENT_USER\SOFTWARE\Classes\lnkfile\shellex\ContextMenuHandlers\Beyond Compare 5] +""="{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}" + +[HKEY_CURRENT_USER\SOFTWARE\Classes\Folder\shellex\ContextMenuHandlers\Beyond Compare 5] +""="{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}" + +[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shellex\ContextMenuHandlers\Beyond Compare 5] +""="{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}" + +[HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}\InProcServer32] +"ThreadingModel"="Apartment" +""="$install_dir\\BCShellEx64.dll" + +[HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}] +""="Beyond Compare 5" + +[HKEY_CURRENT_USER\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\Beyond Compare 5] +""="{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}" diff --git a/scripts/beyondcompare-np/install-context-64bit.reg b/scripts/beyondcompare-np/install-context-64bit.reg new file mode 100644 index 000000000..d508f8f35 --- /dev/null +++ b/scripts/beyondcompare-np/install-context-64bit.reg @@ -0,0 +1,31 @@ +Windows Registry Editor Version 5.00 + + +[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Cached] +"{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5} {000214E4-0000-0000-C000-000000000046} 0xFFFF"=hex(3):01,00,00,00,00,00,00,00,80,96,f0,89,7b,07,db,01 + +[HKEY_CURRENT_USER\SOFTWARE\Classes\WOW6432Node\CLSID\{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}\InProcServer32] +"ThreadingModel"="Apartment" +""="$install_dir\\BCShellEx.dll" + +[HKEY_CURRENT_USER\SOFTWARE\Classes\WOW6432Node\CLSID\{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}] +""="Beyond Compare 5" + +[HKEY_CURRENT_USER\SOFTWARE\Classes\lnkfile\shellex\ContextMenuHandlers\Beyond Compare 5] +""="{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}" + +[HKEY_CURRENT_USER\SOFTWARE\Classes\Folder\shellex\ContextMenuHandlers\Beyond Compare 5] +""="{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}" + +[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shellex\ContextMenuHandlers\Beyond Compare 5] +""="{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}" + +[HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}\InProcServer32] +"ThreadingModel"="Apartment" +""="$install_dir\\BCShellEx64.dll" + +[HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}] +""="Beyond Compare 5" + +[HKEY_CURRENT_USER\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\Beyond Compare 5] +""="{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}" diff --git a/scripts/beyondcompare-np/uninstall-context.reg b/scripts/beyondcompare-np/uninstall-context.reg new file mode 100644 index 000000000..9aa2c995b --- /dev/null +++ b/scripts/beyondcompare-np/uninstall-context.reg @@ -0,0 +1,31 @@ +Windows Registry Editor Version 5.00 + + +[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Cached] +"{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5} {000214E4-0000-0000-C000-000000000046} 0xFFFF"=- + +[HKEY_CURRENT_USER\SOFTWARE\Classes\WOW6432Node\CLSID\{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}\InProcServer32] +"ThreadingModel"=- +""=- + +[HKEY_CURRENT_USER\SOFTWARE\Classes\WOW6432Node\CLSID\{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}] +""=- + +[HKEY_CURRENT_USER\SOFTWARE\Classes\lnkfile\shellex\ContextMenuHandlers\Beyond Compare 5] +""=- + +[HKEY_CURRENT_USER\SOFTWARE\Classes\Folder\shellex\ContextMenuHandlers\Beyond Compare 5] +""=- + +[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shellex\ContextMenuHandlers\Beyond Compare 5] +""=- + +[HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}\InProcServer32] +"ThreadingModel"=- +""=- + +[HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\{812BC6B5-83CF-4AD9-97C1-6C60C8D025C5}] +""=- + +[HKEY_CURRENT_USER\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\Beyond Compare 5] +""=- From 5dce899f7790db70c1848f8689121631fe0931f0 Mon Sep 17 00:00:00 2001 From: pohlymorph <47659231+pohlymorph@users.noreply.github.com> Date: Sat, 11 Jan 2025 08:28:11 +0100 Subject: [PATCH 2/6] Update bucket/beyondcompare-np.json - commit suggestion, review finding Co-authored-by: HUMORCE --- bucket/beyondcompare-np.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bucket/beyondcompare-np.json b/bucket/beyondcompare-np.json index 3d60f59d9..c3a798500 100644 --- a/bucket/beyondcompare-np.json +++ b/bucket/beyondcompare-np.json @@ -75,7 +75,8 @@ "", "if ($cmd -eq 'install') {", " Invoke-Command {reg import \"$dir\\install-context.reg\" 2>&1 | Out-Null}", - "}" + "}", + "Remove-Item -Path \"$dir\\unins*\" -Force -Recurse" ], "pre_uninstall": [ "", From 0941038aa829ca3ddc8d1a7876ebfb522640df84 Mon Sep 17 00:00:00 2001 From: pohlymorph Date: Sat, 11 Jan 2025 09:41:02 +0100 Subject: [PATCH 3/6] Remove entry from "Apps & features" - remove registry entries left using the installer in 'non-portable' mode --- bucket/beyondcompare-np.json | 3 ++- .../delete-entry-apps-and-features.reg | Bin 0 -> 1316 bytes 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 scripts/beyondcompare-np/delete-entry-apps-and-features.reg diff --git a/bucket/beyondcompare-np.json b/bucket/beyondcompare-np.json index c3a798500..7e539a786 100644 --- a/bucket/beyondcompare-np.json +++ b/bucket/beyondcompare-np.json @@ -61,7 +61,7 @@ ], "post_install": [ "$dir_escaped = \"$dir\".Replace('\\', '\\\\')", - "\"install-context-$architecture\", \"uninstall-context\" | ForEach-Object {", + "\"install-context-$architecture\", \"uninstall-context\", \"delete-entry-apps-and-features\" | ForEach-Object {", " if (Test-Path \"$bucketsdir\\$bucket\\scripts\\$app\\$_.reg\") {", " $content = Get-Content \"$bucketsdir\\$bucket\\scripts\\$app\\$_.reg\"", " $content = $content.Replace('$install_dir', $dir_escaped)", @@ -75,6 +75,7 @@ "", "if ($cmd -eq 'install') {", " Invoke-Command {reg import \"$dir\\install-context.reg\" 2>&1 | Out-Null}", + " Invoke-Command {reg import \"$dir\\delete-entry-apps-and-features.reg\" 2>&1 | Out-Null}", "}", "Remove-Item -Path \"$dir\\unins*\" -Force -Recurse" ], diff --git a/scripts/beyondcompare-np/delete-entry-apps-and-features.reg b/scripts/beyondcompare-np/delete-entry-apps-and-features.reg new file mode 100644 index 0000000000000000000000000000000000000000..f3ebbd7d39d0b3bc3863575f9114c0f629841eff GIT binary patch literal 1316 zcmbu9UoQhu5XH~4#COtOcqsKR+M-pBSdmp)OYLs98sWp^H@DcmtrdwhH@h=) z=FFM7vweT-DOREzrFzy_f!ey&5Z_o&%JqV0hiHtIVh1`So)e9+6YO=ZXqDfh7QWAg z_H{_!xvsRWE}U(wmQJy|>hRuH$n!|M_y@`9ZEE=w zEZ1tHWSUuxIiP;gas5+!nWaT-yIJczo>6MCCdY1hz@*A~ zc6SY?nh~8&#A*#dmr?sLkH9qCBp$rjl;JC@rfYI1%(k3=jOQ8#yNf%x{7KfGKO-KY zu6hb5u*76P{jdccytz|1^eWHqOBK>raloG1{+GM(5iQg{qNa?nDcGh2Y?bMpFtZJ; z2H1qJZo+f;$DBI2F=xc-!)3b~@HItvA2@%hYbySe-*pQ7+p6mEYhr=+xCz^VY))gb l!wnF9da-YDcFt85YA|NZ;MnEe&9VP9`QjdC|JjQ9eE>)4(+B_n literal 0 HcmV?d00001 From 0091b44b882331912b14ae5601aeb0f616cb9b58 Mon Sep 17 00:00:00 2001 From: pohlymorph <47659231+pohlymorph@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:06:22 +0100 Subject: [PATCH 4/6] Update bucket/beyondcompare-np.json - address review finding Co-authored-by: Hsiao-nan Cheung --- bucket/beyondcompare-np.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bucket/beyondcompare-np.json b/bucket/beyondcompare-np.json index 7e539a786..d2476502d 100644 --- a/bucket/beyondcompare-np.json +++ b/bucket/beyondcompare-np.json @@ -25,7 +25,9 @@ "/DIR=\"$dir\"", "/VERYSILENT", "/SUPPRESSMSGBOXES", - "/NORESTART" + "/NORESTART", + "/NOICONS", + "/CURRENTUSER" ] } }, From b132c40f9976d605528e13bb2a34a7334e129e1d Mon Sep 17 00:00:00 2001 From: pohlymorph <47659231+pohlymorph@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:29:11 +0100 Subject: [PATCH 5/6] Apply suggestions from code review - address review findings - https://github.com/ScoopInstaller/Nonportable/pull/385#discussion_r1911964655 - https://github.com/ScoopInstaller/Nonportable/pull/385#discussion_r1911964715 - https://github.com/ScoopInstaller/Nonportable/pull/385#discussion_r1911964788 Co-authored-by: Hsiao-nan Cheung --- bucket/beyondcompare-np.json | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/bucket/beyondcompare-np.json b/bucket/beyondcompare-np.json index d2476502d..f15df7bcb 100644 --- a/bucket/beyondcompare-np.json +++ b/bucket/beyondcompare-np.json @@ -14,13 +14,11 @@ "", "Or maybe you want to upgrade license from v4 to v5: https://www.scootersoftware.com/kb/upgradepolicy" ], - "innosetup": true, + "url": "https://www.scootersoftware.com/files/BCompare-5.0.4.30422.exe", + "hash": "d74892601a50514b5636e27d4be4d3ac38597f2f6c7c7b6b5b169a48ffa1f341", "architecture": { "64bit": { - "url": "https://www.scootersoftware.com/files/BCompareSetup-5.0.4.30422.zip", - "hash": "2cfb571c94885fce248e6eac4da3f02c930db35176bd964f22b203a6833f5672", "installer": { - "file": "BCompareSetup.exe", "args": [ "/DIR=\"$dir\"", "/VERYSILENT", @@ -32,16 +30,15 @@ } }, "32bit": { - "url": "https://www.scootersoftware.com/files/BCompareSetup-5.0.4.30422.zip", - "hash": "2cfb571c94885fce248e6eac4da3f02c930db35176bd964f22b203a6833f5672", "installer": { - "file": "BCompareSetup.exe", "args": [ "/32", "/DIR=\"$dir\"", "/VERYSILENT", "/SUPPRESSMSGBOXES", - "/NORESTART" + "/NORESTART", + "/NOICONS", + "/CURRENTUSER" ] } } @@ -88,10 +85,10 @@ "}" ], "checkver": { - "url": "https://www.scootersoftware.com/kb/dl5_winalternate", - "regex": "files/BCompareSetup-([\\d.]+)\\.zip" + "url": "https://www.scootersoftware.com/download", + "regex": "BCompare-([\\d.]+)\\.exe" }, "autoupdate": { - "url": "https://www.scootersoftware.com/files/BCompareSetup-$version.zip" + "url": "https://www.scootersoftware.com/files/BCompare-$version.exe" } } From e5de5d79fa3b48f8a214979df1bfc33f8627132b Mon Sep 17 00:00:00 2001 From: pohlymorph Date: Sat, 11 Jan 2025 15:42:36 +0100 Subject: [PATCH 6/6] Fix, optimize post_install and pre_uninstall - revert 5dce899f7790db70c1848f8689121631fe0931f0 - use uninstaller - use 'reg delete' recursively to remove installation entry showing up in 'Apps & features' otherwise --- bucket/beyondcompare-np.json | 36 +++++++++++++----- .../delete-entry-apps-and-features.reg | Bin 1316 -> 0 bytes 2 files changed, 27 insertions(+), 9 deletions(-) delete mode 100644 scripts/beyondcompare-np/delete-entry-apps-and-features.reg diff --git a/bucket/beyondcompare-np.json b/bucket/beyondcompare-np.json index f15df7bcb..62a6f18c8 100644 --- a/bucket/beyondcompare-np.json +++ b/bucket/beyondcompare-np.json @@ -27,6 +27,17 @@ "/NOICONS", "/CURRENTUSER" ] + }, + "uninstaller": { + "file": "unins000.exe", + "args": [ + "/DIR=\"$dir\"", + "/VERYSILENT", + "/SUPPRESSMSGBOXES", + "/NORESTART", + "/NOICONS", + "/CURRENTUSER" + ] } }, "32bit": { @@ -40,6 +51,18 @@ "/NOICONS", "/CURRENTUSER" ] + }, + "uninstaller": { + "file": "unins000.exe", + "args": [ + "/32", + "/DIR=\"$dir\"", + "/VERYSILENT", + "/SUPPRESSMSGBOXES", + "/NORESTART", + "/NOICONS", + "/CURRENTUSER" + ] } } }, @@ -60,7 +83,7 @@ ], "post_install": [ "$dir_escaped = \"$dir\".Replace('\\', '\\\\')", - "\"install-context-$architecture\", \"uninstall-context\", \"delete-entry-apps-and-features\" | ForEach-Object {", + "\"install-context-$architecture\", \"uninstall-context\" | ForEach-Object {", " if (Test-Path \"$bucketsdir\\$bucket\\scripts\\$app\\$_.reg\") {", " $content = Get-Content \"$bucketsdir\\$bucket\\scripts\\$app\\$_.reg\"", " $content = $content.Replace('$install_dir', $dir_escaped)", @@ -69,19 +92,14 @@ " }", " $outfile_no_arch = $_.Replace(\"-$architecture\", \"\")", " $content | Set-Content -Path \"$dir\\$outfile_no_arch.reg\"", + " Write-Host \"Generating file $outfile_no_arch\"", " }", "}", "", "if ($cmd -eq 'install') {", " Invoke-Command {reg import \"$dir\\install-context.reg\" 2>&1 | Out-Null}", - " Invoke-Command {reg import \"$dir\\delete-entry-apps-and-features.reg\" 2>&1 | Out-Null}", - "}", - "Remove-Item -Path \"$dir\\unins*\" -Force -Recurse" - ], - "pre_uninstall": [ - "", - "if ($cmd -eq 'uninstall') {", - " Invoke-Command {reg import \"$dir\\uninstall-context.reg\" 2>&1 | Out-Null}", + " # delete installation entry from 'Apps & features'", + " Invoke-Command {reg delete \"HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\BeyondCompare5_is1\" /f /va 2>&1 | Out-Null}", "}" ], "checkver": { diff --git a/scripts/beyondcompare-np/delete-entry-apps-and-features.reg b/scripts/beyondcompare-np/delete-entry-apps-and-features.reg deleted file mode 100644 index f3ebbd7d39d0b3bc3863575f9114c0f629841eff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1316 zcmbu9UoQhu5XH~4#COtOcqsKR+M-pBSdmp)OYLs98sWp^H@DcmtrdwhH@h=) z=FFM7vweT-DOREzrFzy_f!ey&5Z_o&%JqV0hiHtIVh1`So)e9+6YO=ZXqDfh7QWAg z_H{_!xvsRWE}U(wmQJy|>hRuH$n!|M_y@`9ZEE=w zEZ1tHWSUuxIiP;gas5+!nWaT-yIJczo>6MCCdY1hz@*A~ zc6SY?nh~8&#A*#dmr?sLkH9qCBp$rjl;JC@rfYI1%(k3=jOQ8#yNf%x{7KfGKO-KY zu6hb5u*76P{jdccytz|1^eWHqOBK>raloG1{+GM(5iQg{qNa?nDcGh2Y?bMpFtZJ; z2H1qJZo+f;$DBI2F=xc-!)3b~@HItvA2@%hYbySe-*pQ7+p6mEYhr=+xCz^VY))gb l!wnF9da-YDcFt85YA|NZ;MnEe&9VP9`QjdC|JjQ9eE>)4(+B_n