You are here

Problem when saving registry file using template

3 posts / 0 new
Last post
CrendKing
Offline
Last seen: 15 years 6 months ago
Joined: 2007-08-14 05:36
Problem when saving registry file using template

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.

digitxp
digitxp's picture
Offline
Last seen: 13 years 3 months ago
Joined: 2007-11-03 18:33
Please

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.

CrendKing
Offline
Last seen: 15 years 6 months ago
Joined: 2007-08-14 05:36
Thank you!

I have posted in the PAT thread.

Log in or register to post comments