I am trying to portablise an application suite that consists of three separate applications. Individually, this is no problem, I have done the three launcher.inis and they all run fine as separate PortableApps.
The problem is, all three apps use common directories in \Users\[user]\AppData\Roaming\[AppPublisher]\Common
and \ProgramData\[AppPublisher]\Common
to store dictionaries, clipboard data and other things, data that can be shared across all three apps in the suite.
I've been trying to think of ways I can just use the standard Launcher.ini to work around this, but none of them seem like they will work.
If I keep all the apps as separate PortableApps and run more than one, then the second one to open will move its common folders and the first app's folders will be backed up, then when they close, depending on which order they are closed it, the common folders may switch apps and the data is still separate. I can't use the WaitForEXEN
option as there is no way to create a dependency loop that works.
I could put them all into the a single PortableApp and create separate launchers for each app, this means I only have a single copy of the common folders, but I still get all the rest of the issues from the keeping them separate solution.
Do I have to use the custom code option to determine if the app opening is the first one and only move the common folders then, and if it is the last one to close, move them back? Or is there some feature in the standard launcher that I'm missing?
Is there an existing PortableApp that works like this that I can use as an example? The only one that I can think of that is similar is LibreOffice, but that is a single application that takes parameters to determine what sub-app to open. My case is three distinctly separate apps.
Thanks
So.. when you open exactly an app and then you close it, you want the data to be saved in 3 different apps altogether? I think using
Custom.nsh
file is the only alternative I can think of. Something like this should work (not tested):Don't forget to remove
%APPDATA%\PublisherName\Common
from[DirectoriesMove]
section inAppNamePortable.ini
. Good luck!Thanks for this. The custom code section in the developer docs wasn't particularly clear to me and I wasn't sure where to start.
Your example code perfectly explains to me how to use it