I use the 2.6.2 template to make applications portable. I noticed that if I specify multiple entries to $REGKEYS in the header (with ||), after the application terminates, only the first entry is saved to Data directory.
I think the problem is in the CleanReg function, or more specifically, CleanRegLoop section:
; --------------------------------------------------------------------------
; Copy actual registry key to portable folder
; --------------------------------------------------------------------------
${registry::KeyExists} "$R9" "$R7" ; check whether registry key exists
StrCmp "$R7" "0" 0 CleanRegLoop ; registry key does not exist, do not save anything
${registry::SaveKey} "$R9" "$DATADIR\${APP}.reg" "/G=1 /A=1" "$R7" ; Backup registry key
StrCmp "$R7" 0 +3 ; an error occures when saving registry key
MessageBox MB_OK|MB_ICONEXCLAMATION `It is not possible to save the registry keys. Maybe your drive is write protected. Please check and press OK afterwards!`
${registry::SaveKey} "$R9" "$DATADIR\${APP}.reg" "/G=1 /A=1" "$R7" ; Backup registry key
; Sleep 50
; --------------------------------------------------------------------------
; Delete actual actual registry key (with portable content)
; --------------------------------------------------------------------------
${registry::DeleteKey} "$R9" "$R7" ; Delete registry key
When the loop process each entry, later one overwrites the previous one. Since the entries are pushed reversely, and popped reversely, the first entry overwrites all others.
Is there walkaround to solve the problem? For example, save each entry to different file (reg1.reg, reg2.reg, ...), or even merge the temporary reg files to one at last?
Thanks!
--------------------
Update: I found the solution. Please refer to the Portable Application Template thread.
can you ask this in the PAT topic?
As for the actual problem, I'm pretty sure there is a way to fix this up but I am not very experienced with LogicLib so I'm not sure what to do :(.
Insert original signature here with Greasemonkey Script.
I have posted in the PAT thread.