Archive: It's late and I don't see my error...


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

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.


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

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: