ScoopInstaller / Extras

📦 The Extras bucket for Scoop.
https://scoop.sh
The Unlicense
1.8k stars 1.38k forks source link

[Bug]: office-tool-plus install failed #13174

Closed ZxcSoft closed 6 months ago

ZxcSoft commented 6 months ago

Prerequisites

Package Name

office-tool-plus

Expected/Current Behaviour

install office-tool-plus failed

Steps to Reproduce

PS> scoop install office-tool-plus@10.10.7.0
WARN  Purging previous failed installation of office-tool-plus.
ERROR 'office-tool-plus' isn't installed correctly.
Removing older version (10.10.7.0).
'office-tool-plus' was uninstalled.
Installing 'office-tool-plus' (10.10.7.0) [64bit] from 'D:\soft\scoop\default\buckets\extras\bucket\office-tool-plus.json'
Loading Office_Tool_v10.10.7.0_x64.zip from cache.
Checking hash of Office_Tool_v10.10.7.0_x64.zip ... ok.
Extracting Office_Tool_v10.10.7.0_x64.zip ... Could not find 'Office Tool'! (error 16)
所在位置 D:\soft\scoop\default\apps\scoop\current\lib\core.ps1:855 字符: 9
+         throw "Could not find '$(fname $from)'! (error $($proc.ExitCo ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Could not find 'Office Tool'! (error 16):String) [], RuntimeException
    + FullyQualifiedErrorId : Could not find 'Office Tool'! (error 16)

Possible Solution

no

Scoop and Buckets Version

PS> scoop --version
Current Scoop version:
105e4161 (HEAD -> master, tag: v0.4.0, origin/master, origin/HEAD) chore(release): Bump to version 0.4.0 (#5424)

'main' bucket:
c65c3cec4 (HEAD -> master, origin/master, origin/HEAD) glab: Update to version 1.40.0

'extras' bucket:
7562f4fe2 (HEAD -> master, origin/master, origin/HEAD) sidekick-browser: Update to version 120.58.1.38488-aa4b5ae

'versions' bucket:
095915c60 (HEAD -> master, origin/master, origin/HEAD) oss-cad-suite-nightly: Update to version 2024-04-25

'nonportable' bucket:
0728a4fe (HEAD -> master, origin/master, origin/HEAD) unity-hub-np: Update to version 3.8.0

'java' bucket:
469998e8 (HEAD -> master, origin/master, origin/HEAD) zulufx8-jre: Update to version 8.78.0.19

'zaki' bucket:
495d8483 (HEAD -> master, origin/master, origin/HEAD) chromium: Update to version 124.0.6367.79-r1274542

'zlemon' bucket:
9b1eea12e (HEAD -> master, origin/master, origin/HEAD) keepassxc-snapshot: Update to version 2.8.0-244296

Scoop Config

PS > scoop config

root_path                       : D:\soft\scoop\default
global_path                     : D:\soft\scoop\global
last_update                     : 2024-04-25T14:10:00.8882313+08:00
aria2-warning-enabled           : False
aria2-retry-wait                : 1
aria2-split                     : 10
aria2-max-connection-per-server : 10
aria2-enabled                   : True
autostash_on_conflict           : True
aria2-options                   : --check-certificate=false
scoop_branch                    : master
scoop_repo                      : https://github.com/ScoopInstaller/Scoop
proxy                           : 127.0.0.1:7897

PowerShell Version

PS > $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.2506
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.2506
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Additional Softwares

none

ZxcSoft commented 6 months ago

PS > scoop search office-tool-plus Results from local buckets...

Name Version Source Binaries


office-tool-plus 10.10.7.0 extras

windzwindy commented 6 months ago

@niheaven "https://github.com/ScoopInstaller/Scoop/commit/77b66cc8905e1872f550ff833d4d531a9f2a527c"

I don't know what this powershell code is doing, but it's clear to me that this is the problem

I temporarily solved the problem using the following steps(roll back some code):

Delete the following code

# escape N consecutive backslash(es), which are followed by a double quote or at the end of the string, to 2N consecutive ones
$s = $_ -replace '(\\+)(""|$)', '$1$1$2'
# quote the path if it contains spaces and is not NSIS's '/D' argument
# ref: https://nsis.sourceforge.io/Docs/Chapter3.html
if ($s -match ' ' -and $s -notmatch '/D=[A-Z]:[\\/].*') {
    $s -replace '([A-Z]:[\\/].*)', '"$1"'
} else {
    $s
}

Then add the following code

# 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`""

Install "office-tool-plus" again


Or use Git-Bash to roll back to the scoop version before 77b66cc was submitted. For example 9770c86:

git reset --hard 9770c86                          # roll back to 9770c86
scoop install office-tool-plus                   # install otp again