demiller9
15th February 2007 23:52 UTC
It's late and I don't see my error...
This little piece of code should copy one of several files to the system folder and set it as the wallpaper. The file is not copied, but the registry key is set. Can anyone think why? (This is running on Windows 2000, logged on as administrator).
${If} ${FileExists} "C:\Ipls\Lockout\$0.bmp"
CopyFiles "C:\Ipls\Lockout\$0.bmp" "$SYSDIR\NTL_POPUP.bmp" 1407
WriteRegStr HKCU "Control Panel\Desktop" "Wallpaper" "$SYSDIR\NTL_POPUP.bmp"
${EndIf}
The value shown in the registry ends up as C:\Winnt\system32\NTL_POPUP.bmp
Thanks,
Don
kichik
16th February 2007 00:00 UTC
The user might not have enough permissions to write to the system directory or you might have a relative jump above ${If} which skips the check itself.
demiller9
16th February 2007 00:08 UTC
I am only using LogicLib statements, there are no relative jumps coded here. I am able to copy the file in manually (same logon).
Here's the code immediately before the piece I posted above:
ReadRegStr $R0 HKLM "${REG_ARCHITECT}\System" "Display Partner Logo"
${Unless} ${Errors}
${If} $R0 == "TRUE"
StrCpy $0 "Partner"
${EndIf}
${EndUnless}
There is a little bit more logic ahead of this that sets $0 to one of 6 values depending upon another registry value.
Don
demiller9
17th February 2007 11:19 UTC
Found my problem
Just to close out my thread...
I found that I wasn't extracting the bmp files before I tried to select one of them for the wallpaper. (They are in different sections, and I had to reorder the sections). The registry was being set by the application after the install finished and started it, but before I had a chance to look to see what lines of code executed.
Don :hang: