whenever I try and launch RunUnityPackageManagerDiagnostics.bat on Windows I get this output:
Unity Package Manager Diagnostics
Version 0.1.8
Failed to create report at ''.
An error occurred while running the diagnostic tool. See log for details (C:\Users\Chris\AppData\Local\Unity\Editor\upm-diag.log).
Press any key to continue . . .
[2021-01-25T21:28:45.800Z][ERROR] EISDIR: illegal operation on a directory, open ‘C:\Program Files\Unity\Hub\Editor\2020.1.14f1\Editor\Data\Resources\PackageManager\Diagnostics’
[2021-01-25T21:28:45.802Z][ERROR] EISDIR: illegal operation on a directory, open ‘C:\Program Files\Unity\Hub\Editor\2020.1.14f1\Editor\Data\Resources\PackageManager\Diagnostics’
That is strange indeed. Are you launching RunUnityPackageManagerDiagnostics.bat manually (e.g. from Windows Explorer or from a command prompt) or is it being launched by Unity (from the “Diagnose” button in an error dialog)?
For now, if you simply want to run the diagnostics, you can take a look at what the .bat script is doing; it’s a very simple script that launches the diagnostic app like so:
You can run this command from a command prompt like cmd or PowerShell and replace the parts in angle brackets. Judging from the logs you provided, the paths would be something like this:
Hi, sorry I missed this.
I’m running the .bat script directly in command line. @NiQiuNiQiu is right, the “UPM_DIAG_REPORT_PATH” and “UPM_DIAG_UPM_PATH” variables don’t exist.
I made this batch script that does work for my purpose:
@echo off
set unityVersion=2021.1.12f1
set unityDiagPath="C:\Program Files\Unity\Hub\Editor\%unityVersion%\Editor\Data\Resources\PackageManager\Diagnostics\bin\UnityPackageManagerDiagnostics.exe"
set unityPackagePath="C:\Program Files\Unity\Hub\Editor\%unityVersion%\Editor\Data\Resources\PackageManager\Server\UnityPackageManager.exe"
echo Running Diagnostic
echo Unity Version: %unityVersion%
%unityDiagPath% -o "%~dp0\report.txt" -p %unityPackagePath%
set exit_code=%ERRORLEVEL%
echo.
pause
exit /b %exit_code%