Currently the PortableApps.com Launcher uses the Data\settings directory for two things; the AppNamePortableSettings.ini file and any registry files.
In the current situation, a [DirectoriesMove] line should not be used to move the settings directory because [RegistryKeys] is parsed later, and registry files are in Data\settings, so if you move it they aren't there and no settings will be loaded.
There are two ways of fixing this:
- the easy, lazy way: move the execution of the RegistryKeys segment to before the DirectoriesMove segment. This fixes the problem, but there's still some not-neatness about it all.
- the more complex but nicer way:
- Move Data\settings\AppNamePortableSettings.ini to Data. This will be an issue for upgrade, and so a simple PostInstallCode macro for PortableApps.comInstallerCustom.nsh can be provided which does
Rename $INSTDIR\Data\settings\${APPID}Settings.ini $INSTDIR\Data\${AppID}Settings.ini
(think that's right, not tested). - Move Data\settings\*.reg to Data\registry\*.reg. I can add checking into the Generator so that if you use any %PAL:DataDir%\settings\*.reg files it will remind you to update them to registry rather than settings. Custom installer code would also be provided for a
${MoveFiles}
operation.
- Move Data\settings\AppNamePortableSettings.ini to Data. This will be an issue for upgrade, and so a simple PostInstallCode macro for PortableApps.comInstallerCustom.nsh can be provided which does
The second method is more complex, but I think it makes it actually reflect what things should be and are more accurately. Also it frees up the "settings" directory so that it can be moved with impunity. (Currently custom code could potentially also break the [DirectoriesMove] on settings, but I'm less worried about that as developers should know what they're doing with custom code). Gringoloco and I prefer the second method, but it's a significant change, which would require developers to notice it (though it can be detected and they be warned easily) so I thought I'd see what the public reaction was to the idea.
This thread was brought about because of this incident in #portableapps-dev. Please read that log before commenting as it'll help fill out the details and understand why I'm saying this.
(This thread is currently quite fragmented and I haven't put much padding around it because I'm going to bed. See the IRC log or ask questions and I'll try to answer them tomorrow morning (or do I call it this morning? :P), or Gringoloco may too.)