MustardChef / WSABuilds

Run Windows Subsystem For Android on your Windows 10 and Windows 11 PC using prebuilt binaries with Google Play Store (MindTheGapps) and/or Magisk or KernelSU (root solutions) built in.
GNU Affero General Public License v3.0
8.2k stars 1.38k forks source link

[BUG] WIndows 10 Install script fails #130

Closed phage80 closed 1 year ago

phage80 commented 1 year ago

Describe the bug | 描述一下这个错误

When trying to install WSA install.ps1 fails.

The operation completed successfully. Installing MicrosoftCorporationII.WindowsSubsystemForAndroid version: 2305.40000.6.0 Get-AppxPackage: C:\downloads\WSA\Install.ps1:36 Line | 36 | return Get-AppxPackage -Name $Name | ForEach-Object { if … | ~~~ | The 'Get-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'. Dependency package Microsoft.UI.Xaml.2.8 x64 required minimum version: 8.2208.12001.0. Installing.... Add-AppxPackage: C:\downloads\WSA\Install.ps1:139 Line | 139 | Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAny … | ~~~ | 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'. Get-AppxPackage: C:\downloads\WSA\Install.ps1:36 Line | 36 | return Get-AppxPackage -Name $Name | ForEach-Object { if … | ~~~ | The 'Get-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'. Dependency package Microsoft.VCLibs.140.00.UWPDesktop x64 required minimum version: 14.0.30704.0. Installing.... Add-AppxPackage: C:\downloads\WSA\Install.ps1:139 Line | 139 | Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAny … | ~~~ | 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'. Get-AppxPackage: C:\downloads\WSA\Install.ps1:36 Line | 36 | return Get-AppxPackage -Name $Name | ForEach-Object { if … | ~~~ | The 'Get-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'. Dependency package Microsoft.VCLibs.140.00 x64 required minimum version: 14.0.30704.0. Installing.... Add-AppxPackage: C:\downloads\WSA\Install.ps1:139 Line | 139 | Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAny … | ~~~ | 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'. Get-AppxPackage: C:\downloads\WSA\Install.ps1:147 Line | 147 | $Installed = Get-AppxPackage -Name $Name | ~~~ | The 'Get-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'. Shutting down WSA.... Installing MagiskOnWSA.... Add-AppxPackage: C:\downloads\WSA\Install.ps1:167 Line | 167 | Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion … | ~~~ | 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'. All Done! Press any key to exit

Steps to reproduce the issue | 重现该问题的步骤

Try to install WSA with run.bat

Expected behaviour | 预期的行为

Expect the install.ps1 to complete normally.

Downloaded Build Of WSA | 已下载的WSA版本

WSA_2305.40000.6.0_x64_Release-Nightly-with-magisk-47d2d4e3.26102.-canary-MindTheGapps-13.0-RemovedAmazon_Windows_10

Windows build number | Windows构建号

Windows 10 Pro 22H2

PC Specification | 个人电脑规格

AMD 5800X RTX 2080 TUF GAMING X570-PRO (WI-FI)

Additional context | 额外的背景

Having previously installed an older version on this machine attempted to clean install new version but powershell script fails in the newer version. Was able to reinstall old version it's powershell finishes correctly.

WSA_2303.40000.5.0_x64_Release-Nightly-with-magisk-d0c93842.26101.-canary-MindTheGapps-13.0-RemovedAmazon_Windows_10

MustardChef commented 1 year ago

@phage80 Please provide a screenshot.

phage80 commented 1 year ago

Here is what happens with the new version, Screenshot 2023-07-12 093620

And here is the successful install with the old script. Screenshot 2023-07-12 093907

YT-Advanced commented 1 year ago

@phage80 Please send me the old and new script

MustardChef commented 1 year ago

@phage80

  1. So, open the folder of the new version (of WSA with which you have had issues installing), and open terminal within the folder.
  2. Run these commands:
    Import-Module -Name Appx -UseWindowsPowerShell 
    PowerShell.exe -ExecutionPolicy Bypass -File .\Install.ps1


PowerShell.exe -ExecutionPolicy Bypass -File .\Install.ps1
phage80 commented 1 year ago

@phage80 Please send me the old and new script WSA scripts.zip

phage80 commented 1 year ago

@phage80

  • Could you try this and report back, whether or not this fixed your issue:

Neither worked, both throw the same error as previously when the script runs.

YT-Advanced commented 1 year ago

@phage80 The issues occur because your Windows are using pwsh.exe instead of powershell.exe You can fix easily by copy the old script into the new build then run

tadghh commented 1 year ago

Worked for me.

Running pwsh as admin -> cd to the wsa directory -> Import-module Appx -UseWindowsPowerShell -> .\Install.ps1

phage80 commented 1 year ago

Using the old script for the new files works

For new script resinstalled powershell 7 and got both commands working if I run powershell/pwsh as admin, as well as run.bat if I right click run as admin.

But if I do not prelaunch powershell/pwsh as admin or run.bat as admin it still fails.

bolandnick18 commented 1 year ago

I am having the same issue on my Windows 10 Home

tadghh commented 1 year ago

Windows 10 home doesnt support virtualization

MustardChef commented 1 year ago

@bolandnick18 @phage80 This issue will now be closed. Please reopen this issue if you are still having this issue on the latest builds of WSA.

Many Thanks, MustardChef.