From 72bf23b3598bdf5a3d3c857a1e3a9e62598e03d2 Mon Sep 17 00:00:00 2001 From: RecursiveMaple <971499217@qq.com> Date: Fri, 9 Feb 2024 21:29:22 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9C=A8=20feat(tencent-meeting.json):=20a?= =?UTF-8?q?dd=20mani=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bucket/tencent-meeting.json | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 bucket/tencent-meeting.json diff --git a/bucket/tencent-meeting.json b/bucket/tencent-meeting.json new file mode 100644 index 0000000..a8fd888 --- /dev/null +++ b/bucket/tencent-meeting.json @@ -0,0 +1,52 @@ +{ + "version": "3.24.2.407", + "description": "VooV Meeting, An Expert in Conferencing", + "homepage": "https://meeting.tencent.com", + "license": { + "identifier": "Freeware", + "url": "https://meeting.tencent.com/declare.html" + }, + "url": "https://updatecdn.meeting.qq.com/cos/d122f552311a19c56e3cf2e6317830cf/TencentMeeting_0300000000_3.24.2.407.publish.officialwebsite.exe#/dl.7z", + "hash": "md5:d122f552311a19c56e3cf2e6317830cf", + "installer": { + "script": [ + "Import-Module $(Join-Path $(Find-BucketDirectory -Root -Name ox) scripts/DoradoUtils.psm1)", + "Mount-ExternalRuntimeData -Source \"$persist_dir\" -Target \"$env:APPDATA\\Tencent\\WeMeet\"", + "Remove-Module -Name DoradoUtils", + "Rename-Item -Path \"$dir\\`$_*\" -NewName \"$version\" -Force", + "Remove-Item \"$dir\\`$*\" -Recurse -Force -ErrorAction SilentlyContinue", + "Remove-Item \"$dir\\wemeetapp_new.exe\" -Force -ErrorAction SilentlyContinue", + "create_startmenu_shortcuts $manifest $original_dir $global $architecture", + "$manifest.shortcuts = @()" + ] + }, + "shortcuts": [ + [ + "wemeetapp.exe", + "Tencent Meeting" + ] + ], + "uninstaller": { + "script": [ + "Import-Module $(Join-Path $(Find-BucketDirectory -Root -Name ox) scripts/DoradoUtils.psm1)", + "Dismount-ExternalRuntimeData -Target \"$env:APPDATA\\Tencent\\WeMeet\"", + "Remove-Module -Name DoradoUtils" + ] + }, + "checkver": { + "url": "https://meeting.tencent.com/web-service/query-download-info?q=%5B%7B%22package-type%22:%22app%22,%22channel%22:%220300000000%22,%22platform%22:%22windows%22%7D%5D&nonce=AAAAAAAAAAAAAAAA", + "script": [ + "$script:ver = json_path $page '$.info-list[0].version'", + "$script:matchesHashtable = @{'url' = json_path $page '$.info-list[0].url'}", + "$script:regexp = $null" + ] + }, + "autoupdate": { + "url": "$matchUrl#/dl.7z", + "hash": { + "jsonpath": "$.info-list[0].md5", + "mode": "json", + "url": "https://meeting.tencent.com/web-service/query-download-info?q=%5B%7B%22package-type%22:%22app%22,%22channel%22:%220300000000%22,%22platform%22:%22windows%22%7D%5D&nonce=AAAAAAAAAAAAAAAA" + } + } +} \ No newline at end of file From 1ca0c46271b251210fbfb96440c5733ddcb280b7 Mon Sep 17 00:00:00 2001 From: RecursiveMaple <971499217@qq.com> Date: Fri, 9 Feb 2024 21:34:32 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=8C=88=20style:=20fix=20style?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 5 +++-- bucket/dandanplay.json | 2 +- bucket/tencent-meeting.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 93f6279..932449f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,5 +22,6 @@ "**/CVS": true, "**/.DS_Store": true, "**/tmp": true - } -} + }, + "editor.defaultFormatter": "EditorConfig.EditorConfig" +} \ No newline at end of file diff --git a/bucket/dandanplay.json b/bucket/dandanplay.json index ac9b353..a092319 100644 --- a/bucket/dandanplay.json +++ b/bucket/dandanplay.json @@ -43,4 +43,4 @@ "autoupdate": { "url": "https://dandan.sakurateam.top/dandanplay-x64_$version.exe" } -} \ No newline at end of file +} diff --git a/bucket/tencent-meeting.json b/bucket/tencent-meeting.json index a8fd888..d0e7c7c 100644 --- a/bucket/tencent-meeting.json +++ b/bucket/tencent-meeting.json @@ -49,4 +49,4 @@ "url": "https://meeting.tencent.com/web-service/query-download-info?q=%5B%7B%22package-type%22:%22app%22,%22channel%22:%220300000000%22,%22platform%22:%22windows%22%7D%5D&nonce=AAAAAAAAAAAAAAAA" } } -} \ No newline at end of file +} From 5f4951fa61fa2f409e493ae335ca2a1265f30e9f Mon Sep 17 00:00:00 2001 From: RecursiveMaple <971499217@qq.com> Date: Fri, 9 Feb 2024 22:01:53 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=90=9E=20fix:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix external script dependency --- scripts/DoradoUtils.psm1 | 163 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 scripts/DoradoUtils.psm1 diff --git a/scripts/DoradoUtils.psm1 b/scripts/DoradoUtils.psm1 new file mode 100644 index 0000000..d5260f6 --- /dev/null +++ b/scripts/DoradoUtils.psm1 @@ -0,0 +1,163 @@ +# https://github.com/chawyehsu/dorado/blob/master/scripts/DoradoUtils.psm1 +#Requires -Version 5.1 +Set-StrictMode -Version 3.0 + +# A temp fix for https://github.com/ScoopInstaller/Scoop/pull/5066#issuecomment-1372087032 +function Invoke-ExternalCommand2 { + [CmdletBinding(DefaultParameterSetName = "Default")] + [OutputType([Boolean])] + param ( + [Parameter(Mandatory = $true, Position = 0)] + [Alias("Path")] + [ValidateNotNullOrEmpty()] + [String] + $FilePath, + [Parameter(Position = 1)] + [Alias("Args")] + [String[]] + $ArgumentList, + [Parameter(ParameterSetName = "UseShellExecute")] + [Switch] + $RunAs, + [Alias("Msg")] + [String] + $Activity, + [Alias("cec")] + [Hashtable] + $ContinueExitCodes, + [Parameter(ParameterSetName = "Default")] + [Alias("Log")] + [String] + $LogPath + ) + if ($Activity) { + Write-Host "$Activity " -NoNewline + } + $Process = New-Object System.Diagnostics.Process + $Process.StartInfo.FileName = $FilePath + $Process.StartInfo.UseShellExecute = $false + if ($LogPath) { + if ($FilePath -match '^msiexec(.exe)?$') { + $ArgumentList += "/lwe `"$LogPath`"" + } + else { + $Process.StartInfo.RedirectStandardOutput = $true + $Process.StartInfo.RedirectStandardError = $true + } + } + if ($RunAs) { + $Process.StartInfo.UseShellExecute = $true + $Process.StartInfo.Verb = 'RunAs' + } + if ($FilePath -match '^((cmd|cscript|wscript|msiexec)(\.exe)?|.*\.(bat|cmd|js|vbs|wsf))$') { + $Process.StartInfo.Arguments = $ArgumentList -join ' ' + } + elseif ($Process.StartInfo.ArgumentList.Add) { + # ArgumentList is supported in PowerShell 6.1 and later (built on .NET Core 2.1+) + # ref-1: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.argumentlist?view=net-6.0 + # ref-2: https://docs.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.2#net-framework-vs-net-core + $ArgumentList | ForEach-Object { $Process.StartInfo.ArgumentList.Add($_) } + } + else { + # escape arguments manually in lower versions, refer to https://docs.microsoft.com/en-us/previous-versions/17w5ykft(v=vs.85) + $escapedArgs = $ArgumentList | ForEach-Object { + # escape N consecutive backslash(es), which are followed by a double quote, to 2N consecutive ones + $s = $_ -replace '(\\+)"', '$1$1"' + # escape N consecutive backslash(es), which are at the end of the string, to 2N consecutive ones + $s = $s -replace '(\\+)$', '$1$1' + # escape double quotes + $s = $s -replace '"', '\"' + # quote the argument + "`"$s`"" + } + $Process.StartInfo.Arguments = $escapedArgs -join ' ' + } + try { + [void]$Process.Start() + } + catch { + if ($Activity) { + Write-Host "error." -ForegroundColor DarkRed + } + Write-Host $_.Exception.Message -ForegroundColor DarkRed + return $false + } + $Process.WaitForExit() + if ($Process.ExitCode -ne 0) { + if ($ContinueExitCodes -and ($ContinueExitCodes.ContainsKey($Process.ExitCode))) { + if ($Activity) { + Write-Host "done." -ForegroundColor DarkYellow + } + Write-Host $ContinueExitCodes[$Process.ExitCode] -ForegroundColor DarkYellow + return $true + } + else { + if ($Activity) { + Write-Host "error." -ForegroundColor DarkRed + } + Write-Host "Exit code was $($Process.ExitCode)!" -ForegroundColor DarkRed + return $false + } + } + if ($Activity) { + Write-Host "done." -ForegroundColor Green + } + return $true +} + +function Mount-ExternalRuntimeData { + <# + .SYNOPSIS + Mount external runtime data + + .PARAMETER Source + The source path, which is the persist_dir + + .PARAMETER Target + The target path, which is the actual path app uses to access the runtime data + #> + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Source, + [Parameter(Mandatory = $true, Position = 1)] + [string] $Target + ) + + if (Test-Path $Source) { + Remove-Item $Target -Force -Recurse -ErrorAction SilentlyContinue + } + else { + New-Item -ItemType Directory $Source -Force | Out-Null + if (Test-Path $Target) { + Get-ChildItem $Target | Move-Item -Destination $Source -Force + Remove-Item $Target + } + } + + New-Item -ItemType Junction -Path $Target -Target $Source -Force | Out-Null +} + +function Dismount-ExternalRuntimeData { + <# + .SYNOPSIS + Unmount external runtime data + + .PARAMETER Target + The target path, which is the actual path app uses to access the runtime data + #> + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Target + ) + + if (Test-Path $Target) { + Remove-Item $Target -Force -Recurse + } +} + +Export-ModuleMember ` + -Function ` + Mount-ExternalRuntimeData, Dismount-ExternalRuntimeData, ` + Invoke-ExternalCommand2 From 6cb4dcb6c833dcb0f5b199ba4081d510ec646dc5 Mon Sep 17 00:00:00 2001 From: RecursiveMaple <971499217@qq.com> Date: Fri, 9 Feb 2024 22:07:01 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=90=9E=20fix:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix installer script module import error --- bucket/tencent-meeting.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bucket/tencent-meeting.json b/bucket/tencent-meeting.json index d0e7c7c..ee9fef0 100644 --- a/bucket/tencent-meeting.json +++ b/bucket/tencent-meeting.json @@ -10,7 +10,7 @@ "hash": "md5:d122f552311a19c56e3cf2e6317830cf", "installer": { "script": [ - "Import-Module $(Join-Path $(Find-BucketDirectory -Root -Name ox) scripts/DoradoUtils.psm1)", + "Import-Module $(Join-Path $(Find-BucketDirectory -Root -Name RecursiveMaple_scoop) scripts/DoradoUtils.psm1)", "Mount-ExternalRuntimeData -Source \"$persist_dir\" -Target \"$env:APPDATA\\Tencent\\WeMeet\"", "Remove-Module -Name DoradoUtils", "Rename-Item -Path \"$dir\\`$_*\" -NewName \"$version\" -Force",