Created
August 4, 2015 03:18
-
-
Save robot56/7eaa781afbd31f803330 to your computer and use it in GitHub Desktop.
Minecraft: Windows 10 Edition IO error debugger. Send results to http://www.minecraftforum.net/forums/support/minecraft-windows-10-edition or where instructed to.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
Setlocal EnableDelayedExpansion | |
title Minecraft Windows 10 Edition worlderror.IO Debugger | |
echo Minecraft Windows 10 Edition worlderror.IO debugger | |
echo. | |
echo. | |
echo Contact Extreme_Heat on http://minecraftforum.net/ or Extreme on irc.esper.net for help with this file | |
echo. | |
echo ----------------------- | |
echo Writing files... | |
:: CONFIG | |
set FLAGS="" | |
set OUTFILE="MCW10Edition-IOCheck.ps1" | |
echo param ( > %OUTFILE% | |
echo [switch]$ShowAllPermissions = $false >> %OUTFILE% | |
echo ) >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo # Before you compile this.. >> %OUTFILE% | |
echo # * Remove all the comments >> %OUTFILE% | |
echo # * Escape all "^&" and "^|" characters >> %OUTFILE% | |
echo # * Remove all empty lines >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo Write-Output "Starting Minecraft: Windows 10 Edition file troubleshooter" >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo Write-Output "Checking if Minecraft: Windows 10 Edition is installed on this PC..."; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo try { >> %OUTFILE% | |
echo $AppxMetadata = Get-AppxPackage -Name Microsoft.MinecraftUWP; >> %OUTFILE% | |
echo } catch { >> %OUTFILE% | |
echo Write-Output "The Windows 10 Edition was not found on this PC. Check the Windows Store and reinstall the app if it is."; >> %OUTFILE% | |
echo } >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo Write-Output "Found the AppX metadata for MCW10."; >> %OUTFILE% | |
echo Write-Output "Checking ProgramFiles to validate."; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo try { >> %OUTFILE% | |
echo if (^^!(Test-Path $AppxMetadata.InstallLocation)) { >> %OUTFILE% | |
echo Write-Output "ERROR: Didn't find the Windows 10 Edition installation folder. Try reinstalling the app from the store."; >> %OUTFILE% | |
echo #^& cmd /c pause >> %OUTFILE% | |
echo exit; >> %OUTFILE% | |
echo } else { >> %OUTFILE% | |
echo Write-Output "OK: Found the Windows 10 installation files."; >> %OUTFILE% | |
echo } >> %OUTFILE% | |
echo } catch { >> %OUTFILE% | |
echo Write-Output "The Windows 10 Edition was not found on this PC. Check the Windows Store and reinstall the app if it is."; >> %OUTFILE% | |
echo exit; >> %OUTFILE% | |
echo } >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo function toBase64($data) { >> %OUTFILE% | |
echo [System.Convert]^:^:ToBase64String([System.Text.Encoding]^:^:UTF8.GetBytes($data)); >> %OUTFILE% | |
echo } >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo Write-Output "Checking the UserProfile data."; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo $LocalDataPath = $env:LOCALAPPDATA + "\Packages\" + $AppxMetadata.PackageFamilyName; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo $Base64Path = toBase64 $LocalDataPath; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo Write-Output "Data should be path should be this, checking:"; >> %OUTFILE% | |
echo Write-Output $Base64Path; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo if (^^!(Test-Path $LocalDataPath)) { >> %OUTFILE% | |
echo Write-Output "ERROR: Didn't find the UserProfile data. Perhaps you didn't run the Windows 10 Edition on this profile yet?"; >> %OUTFILE% | |
echo #^& cmd /c pause >> %OUTFILE% | |
echo exit; >> %OUTFILE% | |
echo } else { >> %OUTFILE% | |
echo Write-Output "OK: Found the UserProfile data files."; >> %OUTFILE% | |
echo } >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo $RequiredDataFolders = @( >> %OUTFILE% | |
echo "AC", >> %OUTFILE% | |
echo "AppData", >> %OUTFILE% | |
echo "LocalCache", >> %OUTFILE% | |
echo "LocalState", >> %OUTFILE% | |
echo $AppxMetadata.PackageFamilyName, >> %OUTFILE% | |
echo "RoamingState", >> %OUTFILE% | |
echo "Settings", >> %OUTFILE% | |
echo "SystemAppData", >> %OUTFILE% | |
echo "TempState" >> %OUTFILE% | |
echo ); >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo Write-Output "Checking to make sure that the following folders exist:"; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo $MissingFolders = $false; >> %OUTFILE% | |
echo foreach ($folder in $RequiredDataFolders) { >> %OUTFILE% | |
echo Write-Output ($folder + ":"); >> %OUTFILE% | |
echo if (^^!(Test-Path $LocalDataPath)) { >> %OUTFILE% | |
echo $MissingFolders = $true; >> %OUTFILE% | |
echo Write-Output " -> ERROR: Directory not found^^!"; >> %OUTFILE% | |
echo #^& cmd /c pause >> %OUTFILE% | |
echo exit; >> %OUTFILE% | |
echo } else { >> %OUTFILE% | |
echo Write-Output " -> OK: Directory found."; >> %OUTFILE% | |
echo } >> %OUTFILE% | |
echo } >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo if ($MissingFolders) { >> %OUTFILE% | |
echo Write-Output "Found missing files, please check the issue and run this script again."; >> %OUTFILE% | |
echo #^& cmd /c pause >> %OUTFILE% | |
echo exit; >> %OUTFILE% | |
echo } else { >> %OUTFILE% | |
echo Write-Output "Fould all required files, generating a tree list of the directory."; >> %OUTFILE% | |
echo } >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo tree $LocalDataPath /F /A >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo Write-Output "Checking file permissions for the LocalStateData, expect a big flood^^!`n`n"; >> %OUTFILE% | |
echo Write-Output "base64 JSON:`n`n`n"; >> %OUTFILE% | |
echo if ($ShowAllPermissions) { >> %OUTFILE% | |
echo toBase64 (Get-Acl $LocalDataPath ^| ConvertTo-Json); >> %OUTFILE% | |
echo } else { >> %OUTFILE% | |
echo Write-Output "Skipping because -ShowAllPermissions is not set."; >> %OUTFILE% | |
echo } >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo Write-Output "`n`n`n"; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo Write-Output "Checking the worlds..."; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo $WorldPath = $LocalDataPath + "\LocalState\games\com.mojang\minecraftWorlds"; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo if (^^!(Test-Path ($WorldPath))) { >> %OUTFILE% | |
echo Write-Output "ERROR: \LocalState\games\com.mojang\minecraftWorlds could not be found."; >> %OUTFILE% | |
echo #^& cmd /c pause >> %OUTFILE% | |
echo exit; >> %OUTFILE% | |
echo } else { >> %OUTFILE% | |
echo Write-Output "OK: Found \LocalState\games\com.mojang\minecraftWorlds"; >> %OUTFILE% | |
echo } >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo Write-Output "LocalDataState worlds: "; >> %OUTFILE% | |
echo Get-ChildItem ($LocalDataPath + "\LocalState\games\com.mojang\minecraftWorlds") -force; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo Write-Output "Trying to write a file 'TEST_FILE' with the contents 'THIS-IS-A-TEST' and an attribute of 'READ ONLY' in \minecraftWorlds"; >> %OUTFILE% | |
echo "THIS-IS-A-TEST" ^| Out-File -FilePath ($WorldPath + "\TEST_FILE"); >> %OUTFILE% | |
echo Write-Output "Making it read only..."; >> %OUTFILE% | |
echo sp ($WorldPath + "\TEST_FILE") IsReadOnly $true; >> %OUTFILE% | |
echo Write-Output "Removing attribute and deleting file..."; >> %OUTFILE% | |
echo sp ($WorldPath + "\TEST_FILE") IsReadOnly $false; >> %OUTFILE% | |
echo del ($WorldPath + "\TEST_FILE"); >> %OUTFILE% | |
echo Write-Output "Done.`n"; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo $dir = dir ($WorldPath) ^| ?{$_.PSISContainer} >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo foreach ($d in $dir) { >> %OUTFILE% | |
echo Write-Output (" --> " + $d.FullName); >> %OUTFILE% | |
echo Get-ChildItem ($WorldPath + "\" + $d) -force; >> %OUTFILE% | |
echo >> %OUTFILE% | |
echo Write-Output ("Trying to write a file 'TEST_FILE' with the contents 'THIS-IS-A-TEST' and an attribute of 'READ ONLY' in \minecraftWorlds\" + $d); >> %OUTFILE% | |
echo "THIS-IS-A-TEST" ^| Out-File -FilePath ($WorldPath + "\" + $d + "\TEST_FILE"); >> %OUTFILE% | |
echo Write-Output "Making it read only..."; >> %OUTFILE% | |
echo sp ($WorldPath + "\" + $d + "\TEST_FILE") IsReadOnly $true; >> %OUTFILE% | |
echo Write-Output "Removing attribute and deleting file..."; >> %OUTFILE% | |
echo sp ($WorldPath + "\" + $d + "\TEST_FILE") IsReadOnly $false; >> %OUTFILE% | |
echo del ($WorldPath + "\" + $d + "\TEST_FILE"); >> %OUTFILE% | |
echo Write-Output "Done.`n"; >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo if (Test-Path ($WorldPath + "\" + $d + "\db")) { >> %OUTFILE% | |
echo Write-Output ("Trying to write a file 'TEST_FILE' with the contents 'THIS-IS-A-TEST' and an attribute of 'READ ONLY' in \minecraftWorlds\" + $d + "\db"); >> %OUTFILE% | |
echo "THIS-IS-A-TEST" ^| Out-File -FilePath ($WorldPath + "\" + $d + "\db\" + "\TEST_FILE"); >> %OUTFILE% | |
echo Write-Output "Making it read only..."; >> %OUTFILE% | |
echo sp ($WorldPath + "\" + $d + "\db\" + "\TEST_FILE") IsReadOnly $true; >> %OUTFILE% | |
echo Write-Output "Removing attribute and deleting file..."; >> %OUTFILE% | |
echo sp ($WorldPath + "\" + $d + "\db\" + "\TEST_FILE") IsReadOnly $false; >> %OUTFILE% | |
echo del ($WorldPath + "\" + $d + "\db\" + "\TEST_FILE"); >> %OUTFILE% | |
echo Write-Output "Done.`n"; >> %OUTFILE% | |
echo Get-ChildItem ($WorldPath + "\" + $d + "\db") -force; >> %OUTFILE% | |
echo } >> %OUTFILE% | |
echo } >> %OUTFILE% | |
echo # >> %OUTFILE% | |
echo Write-Host "`n`nPlease share the output of this script to whom is helping you.`n`n`n"; >> %OUTFILE% | |
echo Write-Host "The script executed successfully." >> %OUTFILE% | |
echo Successfully wrote PowerShell file, running it... | |
PowerShell -ExecutionPolicy Bypass -File %OUTFILE% %FLAGS% > %UserProfile%\Desktop\MCW10.txt | |
echo Opening notepad window. Once it opens, copy everything inside it and submit it to https://gist.github.com/ and share the link to whom is assisting you. | |
notepad %UserProfile%\Desktop\MCW10.txt | |
del %OUTFILE% | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment