Closed ahrib closed 5 months ago
I have the same issue on one machine but not on another. The difference is the username - 6 characters where it works, 9 where it doesn't. The file it complains about is 261 characters:
C:\Users\xxxxxxxxx\scoop\apps\azure-cli\2.55.0\_tmp\SourceDir\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\command_modules\dla\vendored_sdks\azure_mgmt_datalake_analytics\catalog\models\data_lake_analytics_catalog_secret_create_or_update_parameters.pyc
. And no, I cannot change my username.
I managed to install version 2.55.0 by changing decompress.ps1
:
if ($ExtractDir) {
$OriDestinationPath = $DestinationPath
#$DestinationPath = "$DestinationPath\_tmp"
$DestinationPath = "$env:TMP\scoop"
}
Same error for me
> scoop checkup
WARN LongPaths support is not enabled.
You can enable it by running:
sudo Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
(Requires 'sudo' command. Run 'scoop install sudo' if you don't have it.)
Would a enabled long path support solve this issue? OR scoop config use_lessmsi true; scoop install azure-cli; scoop config use_lessmsi false
Hi appreciate the suggestions.
LongPaths support is disabled by my organization and I am unable to change this.
running scoop config use_lessmsi true; scoop install azure-cli; scoop config use_lessmsi false
(note use of azure-cli not aws-sam-cli) installed the tool successfully - good workaround.
I like rob-spoor's approach as well in the comment https://github.com/ScoopInstaller/Main/issues/5300#issuecomment-1840812098
running scoop config use_lessmsi true; scoop install azure-cli; scoop config use_lessmsi false (note use of azure-cli not aws-sam-cli) installed the tool successfully - good workaround.
emmmm, I was working on another issue at the time and got confused.
I like rob-spoor's approach as well in the comment https://github.com/ScoopInstaller/Main/issues/5300#issuecomment-1840812098
Yes, it is works, but may caused performance issue (when moving extracted files), if users installs Scoop to another disk instead of disk of system partition. And changes to Core code may cause Scoop's self-update fail when next release published.
The official fix for this is enabling LongPath support, if not, using LessMSI as commented earlier.
Closing the issue in this light.
Azure CLI is also released as a ZIP package now, but then only for x64.
What about changing the manifest to use ZIP instead? Or add a azure-cli-zip.json
manifest?
Edit: Here's a manifest that seems do work at least for installation. Filename azure-cli-zip.json
.
{
"version": "2.60.0",
"description": "A cross-platform command-line tool to connect to Azure and execute administrative commands on Azure resources",
"homepage": "https://aka.ms/cli",
"license": "MIT",
"notes": [
"* Known issue:",
" - Cannot be extracted due to long path: https://github.com/ScoopInstaller/Main/issues/5300"
],
"architecture": {
"64bit": {
"url": "https://azcliprod.blob.core.windows.net/zip/azure-cli-2.60.0-x64.zip",
"hash": "40891711b9cc31693df7445db5236f8c7a6cae851f9087cace0e0186781a6a73"
}
},
"env_set": {
"AZURE_CLI_PATH": "$dir\\bin",
"AzureCLIPath": "$dir\\bin"
},
"bin": "bin\\az.cmd",
"checkver": {
"github": "https://github.com/Azure/azure-cli",
"regex": "/releases/tag/azure-cli-([\\d.]+)"
},
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://azcliprod.blob.core.windows.net/zip/azure-cli-$version-x64.zip"
}
}
}
}
A PowerShell command to chech whether long paths has been enabled, could be used in post_install
maybe?
[bool](
(Get-ItemPropertyValue -Path 'Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -ErrorAction 'Ignore') -eq 1
)
Prerequisites
Package Name
azure-cli
Expected/Current Behaviour
Current behaviour Having a problem updating or installing the azure-cli package (2.54.0 at time of writing). The last successful version of the package I was able to install was version 2.51.0
The error I receive from the azure-cli installer is "Error writing to file: C:\users\XXXXXXXX\scoop\apps\azure-cli\2.54.0_tmp\SourceDir\Microsoft SDKs\Azure\SLI2\Lib\site-packages\azure\cli\command_modules\dla\vendored_sdks\azure_mgmt_datalake_analytics\catalog\models\data_lake_analytics_catalog_secret_create_or_update_parameters.pyc"
The Log file referenced by scoop does not exist. (~\scoop\apps\azure-cli\2.54.0\msi.log)
Steps to Reproduce
Possible Solution
The error I receive from the installer (see current behaviour section) references a very long file path.. possible solution is to change the temp folder where the MSI is extracted to a shorter path
Scoop and Buckets Version
Scoop Config
PowerShell Version
Additional Softwares
No response