The source code for the PortableApps platform (launcher etc.) is available from SourceForge, but kind of difficult to find there (at least it took me half an hour – again). So, in case I want to look at it again this post will hopefully let me find it faster next time:
https://sourceforge.net/projects/portableapps/files/Source/PortableApps.com%20Platform/
(You know that it is written in Delphi, don’t you?)