It's a long time since I last used InnoSetup. But I remember there used to be an addon to it that could be used to automatically find dependency and also generate the script file, just like P&D wizard.