kiennq / scoop-misc

Miscellaneous scoop packages
28 stars 3 forks source link

Failed to install emacs-k #14

Closed jawadcode closed 2 months ago

jawadcode commented 2 months ago

Attempting to install emacs-k under pwsh.exe results in the following:

λx. scoop install emacs-k
Installing 'emacs-k' (31.302.20240819.7480876) [64bit] from 'scoop-misc' bucket
emacs-7480876-ucrt-x86_64.msix (114.3 MB) [=======================================================================================] 100%
Checking hash of emacs-7480876-ucrt-x86_64.msix ... ok.
Running installer script...Add-AppxPackage: The 'Add-AppxPackage' command was found in the module 'Appx', but the module could not be loaded due to the following error: [Operation is not supported on this platform. (0x80131539)]
For more information, run 'Import-Module Appx'.
done.
Linking ~\scoop\apps\emacs-k\current => ~\scoop\apps\emacs-k\31.302.20240819.7480876
'emacs-k' (31.302.20240819.7480876) was installed successfully!
Notes
-----
Please install as administrator

After trying scoop uninstall --purge emacs-k and scoop install emacs-k in an adminstrator pwsh.exe (this is evident as I use a starship prompt, and it displays [Administrator] there), I get:

λx. scoop install emacs-k
Installing 'emacs-k' (31.302.20240819.7480876) [64bit] from 'scoop-misc' bucket
Loading emacs-7480876-ucrt-x86_64.msix from cache
Checking hash of emacs-7480876-ucrt-x86_64.msix ... ok.
Running installer script...Add-AppxPackage: The 'Add-AppxPackage' command was found in the module 'Appx', but the module could not be loaded due to the following error: [Operation is not supported on this platform. (0x80131539)]
For more information, run 'Import-Module Appx'.
done.
Linking ~\scoop\apps\emacs-k\current => ~\scoop\apps\emacs-k\31.302.20240819.7480876
'emacs-k' (31.302.20240819.7480876) was installed successfully!
Notes
-----
Please install as administrator

For completeness' sake I also tried in powershell.exe, which gave me:

Installing 'emacs-k' (31.302.20240819.7480876) [64bit] from 'scoop-misc' bucket
Loading emacs-7480876-ucrt-x86_64.msix from cache
Checking hash of emacs-7480876-ucrt-x86_64.msix ... ok.
Running installer script...Add-AppxPackage : A parameter cannot be found that matches parameter name 'AllowUnsigned'.
At line:1 char:47
+ Get-ChildItem "$dir\*.msix" | Add-AppxPackage -AllowUnsigned -ForceAp ...
+                                               ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Add-AppxPackage], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand

done.
Linking ~\scoop\apps\emacs-k\current => ~\scoop\apps\emacs-k\31.302.20240819.7480876
'emacs-k' (31.302.20240819.7480876) was installed successfully!
-----
Please install as administrator

And finally, I also tried in an administrator powershell.exe:

λx. scoop install emacs-k
Installing 'emacs-k' (31.302.20240819.7480876) [64bit] from 'scoop-misc' bucket
Loading emacs-7480876-ucrt-x86_64.msix from cache
Checking hash of emacs-7480876-ucrt-x86_64.msix ... ok.
Running installer script...Add-AppxPackage : A parameter cannot be found that matches parameter name 'AllowUnsigned'.
At line:1 char:47
+ Get-ChildItem "$dir\*.msix" | Add-AppxPackage -AllowUnsigned -ForceAp ...
+                                               ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Add-AppxPackage], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageComm
   and

done.
Linking ~\scoop\apps\emacs-k\current => ~\scoop\apps\emacs-k\31.302.20240819.7480876
'emacs-k' (31.302.20240819.7480876) was installed successfully!
Notes
-----
Please install as administrator

The $PSVersionTable values for pwsh.exe and powershell.exe (respectively) are:

λx. $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.4
PSEdition                      Core
GitCommitId                    7.4.4
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

and

λx. $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.4780
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.4780
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
kiennq commented 2 months ago

Can you try with this workaround listed here to see if it works? https://github.com/PowerShell/PowerShell/issues/13138#issuecomment-1820195503

Alternatively, can you try with Add-AppxPackage $env:scoop\cache\emacs-k#31.302.20240819.7480876#36e4006.msix in powershell to see if it's working? You will need to enable developer mode in your machine btw.

kiennq commented 2 months ago

Or please use the package emacs-kl instead.

jawadcode commented 2 months ago

Can you try with this workaround listed here to see if it works? PowerShell/PowerShell#13138 (comment)

Alternatively, can you try with Add-AppxPackage $env:scoop\cache\emacs-k#31.302.20240819.7480876#36e4006.msix in powershell to see if it's working? You will need to enable developer mode in your machine btw.

Apologies for the late reply, I thought I had got back to you but apparently not 😅.

The Windows 10 solution involving modifying $PROFILE doesn't work (same errors all around IIRC), and I'm unwilling to try any other solutions as the emacs-kl package installs and works perfectly.