Apr 6 2009
Unattended Installs – Vista Sidebar Gadgets
Vista Sidebar Gadgets
A sidebar gadget lives in it’s own separate directory (that might have sub-directories), all the files needed for that gadget live in that directory. Vista then stores these gadget directories in a number of places, each offering a different level of visibility on the computer.
Some gadgets are stored in
C:Program FilesWindows SidebarGadgets
These are accessible on all user accounts on the computer. Unfortunately, I’ve yet to find a reasonably reliable way to work around the various security systems that prevent a batch file from putting data into this directory (UAC and other protections exist for copying data into the Program Files directory in Vista).
Gadgets that are only visible to a particular user of a computer are stored in
%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgets
and this directory is far more accessible for a batch file.
While I’d prefer to install my standard gadgets in a globally accessible location, this would require me to have a less automated approach. The whole idea of an unattended install is to keep it unattended. Therefore, I’ve chosen, for now, to go with the user profile location for gadgets on the basis that most of the computers we deal with really only have one normal user set up on them anyway.
Microsoft seems to prefer that we don’t download the installers for our sidebar gadgets but, rather, install directly from the web. This also doesn’t help for a silent install. While there are undoubtedly other solutions to this problem, in the end I did some experimenting and found that you can just copy the whole directory for an installed gadget to the correct directory on another computer and it will work.
So, I grabbed all my ‘standard’ gadgets out of “%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgets” and then use this command to install to a new computer:
@xcopy ".CPUUtilization v1.2.0.2.Gadget" "%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgetsCPUUtilization v1.2.0.2.Gadget" /e /i /c /q @xcopy ".DriveInfoByChris.gadget" "%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgetsDriveInfoByChris.gadget" /e /i /c /q @xcopy ".iWeather.gadget" "%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgetsiWeather.gadget" /e /i /c /q @xcopy ".MemoryMeter.gadget" "%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgetsMemoryMeter.gadget" /e /i /c /q @xcopy ".NeptuneDigitalClock.gadget" "%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgetsNeptuneDigitalClock.gadget" /e /i /c /q @xcopy ".SysShutdown.gadget" "%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgetsSysShutdown.gadget" /e /i /c /q
Once copied, these gadgets can be added to the sidebar normally. I haven’t tried to automate adding them to the sidebar display yet – mostly because the final step on our build process is running through the Control Panel and finalising some other configuration options as well as doing a QA on the build. It doesn’t add much to this process to manually add the relevant sidebar gadgets.
(This article is part of a series about the build disc I use to standardise system builds. The series starts here and this particular article follows on from this one.)

Windows PowerToys
CrossLoop