Have you completely finished doing all the windows updates, what about SP3? try installing the latest SP for XP then retry installing Avast http://files.avast.com/iavs5x/setup_av_free.exe.
If you need to get into your system to remove avast becauce it keeps restarting you can try tapping f8 while booting to get to safe mode then uninstall avast via remove programs.