Instead of running the installer, you will extract its contents using a tool like . Right-click the downloaded Unity installer. Choose 7-Zip > Extract to "Unity..." .
@echo off set UNITY_CACHE_DIR=D:\PortableUnity\Cache set UNITY_TEMP_DIR=D:\PortableUnity\Temp set UNITY_EDITOR_LOG_DIR=D:\PortableUnity\Logs set LOCALAPPDATA=D:\PortableUnity\LocalAppData unity portable install