I encountered a strange problem during packaging Nemp and suspect it a timing issue.
Problem:
Nemp is a little bit "automatic" and starts a wizard at the first launch to query several settings - mostly related to changes made to the system. Even if these are user settings, they could compromise portability (automatic updates, register file types, etc.).
It is started only, if no folder called "Data" exists with some config files in the app folder. As this is an online installer, there is none initially. I tried to solve this with a "Data" folder containing some precofigured files in DefaultData and a [DirectoriesMove] Data=%PAL:AppDir%\nemp\Data .
But it just does not work. Everytime I launch from a fresh install, the wizard would start, despite the Launcher being told to move the Data folder in place. It seems to be just timing. I tried to delay the launch of the base app with a longer SplashTime and LaunchAppAfterSplash=true, but that didn't solve the problem. The contents of DefaultData are just copied and moved at a later time (just as the base app is launched).
Is there a workaround for that? I think I need some safety time buffer between the copying of the folder and the base app launch.
Another issue
[FileWriteN] failed with Type=INI. It just creates duplicate sections in the Nemp.ini. That may be timing dependent, too, as I don't know, at which point Nemp writes settings to the ini and if they are existend, while the file is in use. Type=ConfigWrite works as workaround, though (there are no duplicate Keys in the ini, so that is safe).
To conclude my issue:
I expected the following behaviour, but that seems not to be the exact case:
- Launch of NempPortable.exe
- Launcher realizes "No Data" and copies contents of DefaultData to %PAL:DataDir%
- Launcher moves folder "Data" from %PAL:DataDir% to %PAL:AppDir%\nemp\
- Nemp.ini in %PAL:AppDir%\nemp\ gets adjusted by the launcher according to the NempPortable.ini
- Nemp.ini is present in %PAL:AppDir%\nemp\ when nemp.exe is called and therefore no wizard is launched. Settings could be written to it by nemp.exe
- After closing Nemp, the launcher moves "Data" back to %PAL:DataDir%
It happens too fast to nail down, but I think nemp.exe is called (5) simultanious to the file/folder operations (2-4) so that it just misses them by a whisker. (are there ways to trace that?)