Rolando
24th July 2005 01:22 UTC
Functions for saving/loading settings to/from registry
Hi, I'm working on an installer with 5 pages and 14 checkboxes per page (using MUI custompages) and I want the installer to be able to remember the selected checkboxes by storing them in the registry. I was hoping someone could help me create 2 functions: one for saving settings to the registry and the other for loading them from the registry. This is probably easy to do, but I don't know my way around loops, which I think is the best way to do this since the pages are named options1.ini --> options5.ini and there are 14 fields in each page. I'd appreciate any help offered. Thanks.
Afrow UK
24th July 2005 01:24 UTC
Use ReadRegStr and WriteRegStr for the registry parts, then ReadINIStr and WriteINIStr for the INI files.
-Stu
Rolando
24th July 2005 11:46 UTC
Ok thanks, well I'm almost done. I finished the SaveSettings function however, the LoadSettings function isn't working. Is there something wrong with the following:
ReadRegStr $R0 HKCU "Software\LTP\${CURRENT_VER}" "$R2-$R3"
because $R0 is returning a null result while I check the registry and it should have a numeric value. At this point, I checked and am sure that $R2 and $R3 have their correct values.
deguix
25th July 2005 06:00 UTC
ReadRegStr can read only string values. Use ReadRegDWORD if you are reading integers, which is probable to happen in this case. If this is not enough, say which type has your value name.
Comperio
25th July 2005 06:03 UTC
I'd go into RegEdit and see if you can browse to HCKU\software\LTP\${CURRENT_VER} and read what $R2-$R3 is.
If that doesn't work, you can insert a message box just before the command to see what the string "Software\LTP\${CURRENT_VER}" and "$R2-$R3" actually are at the time the command is being called.
EDIT: Deguix also has a good point!