Skip Ribbon Commands
Skip to main content

Distribution

:

Application Configuration Notes: UVM Wallpaper Pack

Documentation and logs for UVM OS and application distribution methodologies
Installer Technology:
The Wallpaper pack was developed using the excellent (is slightly dense) "INNO Setup" tool:
We downloaded the "Quick Start Pack" version of the product, which includes the full INNO Setup compiler, documentation, and the "ISTool" script editor (highly recommended as it makes script development so much easier).
 
Installer Syntax:
One command line option is supported:
/silent
To install without "modal" (end-user prompting).
 
Installation Location:
For Windows Vista and XP, system wallpapers are stored in the following directory:
%WINDIR%\Web\Wallpaper
(generally C:\WINDOWS\Web\Wallpaper)
 
The Vista Control Panel for desktop backgrounds uses EXIF tags on the images to group pictures into groups.  We added tags to our images to keep their grouping distinct from the Vista shipping backgrounds.  This is accomplished easily in explorer by selecting all images that you want to tag, right click, select "properties" from the drop-down menu, then select the "Details" tab, and edit the "Tags" field.
 
Setting the default background:
We can set the default background for the current user by modifying the following registry key:
HKCU\Control Panel\Desktop, Value:WallPaper
To modify the default for the "Default User" profile, we need to mount the Default User registry profile (this requires some light-weight scripting:
reg load HKLM\DefUser %USERPROFILE%\..\Default\NTUSER.DAT
reg add "HKLM\DefUser\Control Panel\Desktop" /v WallPaper /t REG_SZ /d "%WINDIR%\Web\Wallpaper\Mansfield Wind.jpg" /f
reg unload HKLM\DefUser
(Note that the default user profile is located in C:\Users\Default\NTUSER.DAT on most systems, but we use the relative path above to avoid trouble on systems where a power user may have relocated the user profile directories).
 
On XP, we use the same method, but we load the registry from the path c:\documents and settings\default user\ntuser.dat
 
Special Note for XP:
 
Windows XP converts any non-BMP formatted image used for desktop backgrounds into BMPs, and then caches the copy in the local user profie directory.  As a result, setting the default background to a non-BMP file can create significant problems.  See the following for details:
 
To counter this, we have included BMP-formatted versions of all of the images in the Wallpaper Pack.  The excellent utility "IRFanView" has a bulk-conversion feature that makes this easy.  We then use the "MinVersion: 0,6.0" flag on each JPG files to prevent its installation on Vista systems, and the "OnlyBelowVersion: 0,5.2" to prevent installation of BMP files on any system later than XP Service Pack 3.
 
Adding pictures to the Windows Sidebar:
Another requested function of the installer was to inject the new images into the Windows Sidebar slideshow gadget.  The slideshow uses only one folder for its images, so I decided to add a symlink to the default location of:
%PUBLIC%\Pictures\Sample Pictures\Wallpaper
Using the following command:
mklink /D "%PUBLIC%\Pictures\Sample Pictures\Wallpaper" %WINDIR%\Web\Wallpaper
 
Post setup-actions:
It was considered desirable to launch the control panel at the end of the setup process so that end users would feel like something happened.  For Vista, I found documentation of the control panel command line here:
The specific syntac for launching the Desktop Background Control Panel page is:
%windir%\system32\control.exe /name Microsoft.Personalization /page pageWallpaper
(N.B. In the INNO setup scripts, we substitute "{sys} for "%windir%\system32", both for 32 and 64 bit systems.  We also need to make sure that the "runmaximized" flag is used so that the control panel will launch in the forground)
 
On XP, we also use control.exe to spawn the control panel, but instead we use the argument desk.cpl,,0:
%windir%\system32\control.exe desk.cpl,,0
This calls the "desktop" control panel file with the second tab from the left open by default.  Don't ask be to explain the logic of ",,0"... it just works, so leave it alone.

Special Note for Windows 7:
Windows 7 changes the behavior of how the Contol Panel groups images in the %windir%\web\wallpaper directory.  EXIF tags on wallpaper files are not ignored, and instead traditional filesystem folders are used to generate groups.  To address this, we now copy the wallpaper files into "UVM" and "UVM-Widescreen" folders, but only on the Windows 7 platform.

We use the flag "MinVersion: 0,6.0.7000" to force the use of the new folder groups on the Windows 7 platform only.  (Vista and Server 2008 R1 will never have a version higher than 6.0.6xxx).  We also add the flags "MinVersion: 0,6.0; OnlyBelowVersion: 0,6.0sp4" to prevent the original file copy location from being used on Windows 7.

Also new for Windows 7 are "Themepacks", which allow us to define Aero color settings, sounds, and desktop background slideshow groups as an installable package.  We have developed a "UVM.themepack" file simply by tuning the user interface, then right-clicking our custom theme in the "Personalization" control panel and selecting "save for sharing".  We include the "UVM.themepack" in our INNO setup installer, and activate it using the command line:
control.exe desk.cpl desk,@Themes /Action:OpenTheme /file:"{app}\UVM.themepack"
(The command line was discovered my searching for the action associated with the "themepack" file extension in the Windows registry.)

Finally, Windows 7 introduces the option to set an "OEM Background" which replaces the default "Ctrl-Alt-Delete" Windows Logon background.  To utilize this feature, we need to set the reg DWord:
SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background\OEMBackground
to "1"
And we need to copy our custom background file (which must be in JPEG format and less than 256Kb in size) to:
{win}\system32\oobe\info\backgrounds

Special Note for 64-bit Systems:
We needed to update our ISSetup install to version 5.2.4 to address issues with setup on x64-architecture platforms.  We wanted to make sure that certain files are installed in %windir%\system32 on x64 systems, but a 32-bit installer will, by default, get redirected to the "SysWow64" directory.  By adding the setting "ArchitecturesInstallIn64BitMode=x64" to the [Setup] section of our installer, we are able to disable this redirection behavior.