35
									
								
								.github/workflows/magisk.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										35
									
								
								.github/workflows/magisk.yml
									
									
									
									
										vendored
									
									
								
							| @@ -427,6 +427,12 @@ jobs: | |||||||
|               } |               } | ||||||
|           } |           } | ||||||
|  |  | ||||||
|  |           function Finish { | ||||||
|  |               Clear-Host | ||||||
|  |               Start-Process "wsa://com.topjohnwu.magisk" | ||||||
|  |               Start-Process "wsa://com.android.vending" | ||||||
|  |           } | ||||||
|  |  | ||||||
|           if (-not (Test-Administrator)) { |           if (-not (Test-Administrator)) { | ||||||
|               \$proc = Start-Process -PassThru -WindowStyle Hidden -Verb RunAs powershell.exe -Args "-executionpolicy bypass -command Set-Location \`"\$PSScriptRoot\`"; \`"\$PSCommandPath\`" EVAL" |               \$proc = Start-Process -PassThru -WindowStyle Hidden -Verb RunAs powershell.exe -Args "-executionpolicy bypass -command Set-Location \`"\$PSScriptRoot\`"; \`"\$PSCommandPath\`" EVAL" | ||||||
|               \$proc.WaitForExit() |               \$proc.WaitForExit() | ||||||
| @@ -464,8 +470,7 @@ jobs: | |||||||
|           \$Installed = \$null |           \$Installed = \$null | ||||||
|           \$Installed = Get-AppxPackage -Name 'MicrosoftCorporationII.WindowsSubsystemForAndroid' |           \$Installed = Get-AppxPackage -Name 'MicrosoftCorporationII.WindowsSubsystemForAndroid' | ||||||
|  |  | ||||||
|           If (\$null -ne \$Installed) { |           If ((\$null -ne \$Installed) -and (-not (\$Installed.IsDevelopmentMode))) { | ||||||
|               If (-not (\$Installed.IsDevelopmentMode)) { |  | ||||||
|               Clear-Host |               Clear-Host | ||||||
|               Write-Warning "There is already one installed WSA. Please uninstall it first.\`r\`nPress y to uninstall existing WSA or press any key to exit" |               Write-Warning "There is already one installed WSA. Please uninstall it first.\`r\`nPress y to uninstall existing WSA or press any key to exit" | ||||||
|               \$key = \$Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') |               \$key = \$Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') | ||||||
| @@ -476,16 +481,24 @@ jobs: | |||||||
|                   exit 1 |                   exit 1 | ||||||
|               } |               } | ||||||
|           } |           } | ||||||
|               Else { |  | ||||||
|                   Clear-Host |  | ||||||
|                   Write-Host "Uninstalling existing installation while preserving userdata..." |  | ||||||
|                   Remove-AppxPackage -PreserveApplicationData -Package \$Installed.PackageFullName |  | ||||||
|               } |  | ||||||
|           } |  | ||||||
|           Clear-Host |           Clear-Host | ||||||
|           Write-Host "Installing MagiskOnWSA..." |           Write-Host "Installing MagiskOnWSA..." | ||||||
|           Add-AppxPackage -Register .\AppxManifest.xml |           Stop-Process -Name "wsaclient" | ||||||
|  |           Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Register .\AppxManifest.xml | ||||||
|  |           if (\$?) { | ||||||
|  |               Finish | ||||||
|  |           } | ||||||
|  |           Elseif (\$null -ne \$Installed) { | ||||||
|               Clear-Host |               Clear-Host | ||||||
|  |               Write-Host "Failed to update, try to uninstall existing installation while preserving userdata..." | ||||||
|  |               Remove-AppxPackage -PreserveApplicationData -Package \$Installed.PackageFullName | ||||||
|  |               Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Register .\AppxManifest.xml | ||||||
|  |               if (\$?) { | ||||||
|  |                   Finish | ||||||
|  |               } | ||||||
|  |           } | ||||||
|  |           Write-Host "All Done\`r\`nPress any key to exit" | ||||||
|  |           \$null = \$Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') | ||||||
|           EOF |           EOF | ||||||
|       - name: Generate artifact name |       - name: Generate artifact name | ||||||
|         run: | |         run: | | ||||||
| @@ -495,7 +508,6 @@ jobs: | |||||||
|             name1="" |             name1="" | ||||||
|           elif [[ "$root" = "" ]]; then |           elif [[ "$root" = "" ]]; then | ||||||
|             name1="-with-magisk" |             name1="-with-magisk" | ||||||
|             echo 'Start-Process "wsa://com.topjohnwu.magisk"' >> ${{ matrix.arch }}/Install.ps1 |  | ||||||
|           else |           else | ||||||
|             name1="-with-${root}" |             name1="-with-${root}" | ||||||
|           fi |           fi | ||||||
| @@ -503,10 +515,7 @@ jobs: | |||||||
|             name2="-NoGApps" |             name2="-NoGApps" | ||||||
|           else |           else | ||||||
|             name2="-GApps-${variant}" |             name2="-GApps-${variant}" | ||||||
|             echo 'Start-Process "wsa://com.android.vending"' >> ${{ matrix.arch }}/Install.ps1 |  | ||||||
|           fi |           fi | ||||||
|           echo 'Write-Host "All Done`r`nPress any key to exit"' >> ${{ matrix.arch }}/Install.ps1 |  | ||||||
|           echo "\$null = \$Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')" >> ${{ matrix.arch }}/Install.ps1 |  | ||||||
|           echo "artifact_name=WSA${name1}${name2}_${{ env.WSA_VER }}_${{ matrix.arch }}_${{ env.WSA_REL }}" >> $GITHUB_ENV |           echo "artifact_name=WSA${name1}${name2}_${{ env.WSA_VER }}_${{ matrix.arch }}_${{ env.WSA_REL }}" >> $GITHUB_ENV | ||||||
|       - name: Upload WSA |       - name: Upload WSA | ||||||
|         uses: actions/upload-artifact@v2 |         uses: actions/upload-artifact@v2 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user