AI OnAI Off
There is a bug that the mapping Virtual Path Providers in EPiServer.Legacy4 does not work in a non-web context (e.g. installer), this has been fixed in CMS6. The workaround for EPiServer5 is to outcomment those providers from web.config (if present) during installtion or upgrade.
Error log and stack trace: