Gadgets for Windows Sidebar Packaging, Updating, and Refreshing
[ The Windows Gadget Platform/Sidebar is available for use in the following versions of Windows: Windows 8 Consumer Preview, Windows 7, Windows Vista, Windows Server 8 Beta, and Windows Server 2008. It may be altered or unavailable in subsequent versions. ]
This overview describes how to install or refresh a gadget when updates are made to gadget files during development, debugging, and distribution.
- Packaging a Sidebar Gadget
- Development and Debugging
- Distributing or Installing An Updated Gadget Package
- Gadgets and Web Services
Packaging a Sidebar Gadget
Gadgets can be deployed using one of the following methods:
- A ZIP file. In this package type, the gadget files are collected and compressed into a single file.
Many tools, including Windows itself, can create, extract, and edit ZIP files.
A simple way to create a ZIP file is to deselect the Hide extensions for known file types option in the Folder Options dialog of Windows Explorer. Create a compressed folder. Copy all of your gadget files into the compressed folder. Change the extension from ".zip" to ".gadget".
- A Windows cabinet (CAB) file. The CAB file can be code-signed to provide additional information to users.
- A Windows Installer .msi file.
Both Gadget CAB files and ZIP files must have the .gadget extension. This enables Windows Sidebar to open the package when the user downloads or double-clicks the file.
Note Some email servers are configured to detect and remove DHTML code when found inside attached files. CAB, ZIP, and gadget files are no exception. For this reason, you may want your gadget to be downloaded from a website.
Development and Debugging
In most cases, it is not necessary to shut down and restart the Sidebar to see updates.
When revising gadget files directly in one of the gadget system folders (%USER_DATA%\Local\Microsoft\Windows Sidebar\Gadgets or %SYSTEM_ROOT%\Program Files\Windows Sidebar\Gadgets) or in a separate development environment, follow these steps:
The Manifest
- Close the Gadget Picker, if open.
- Copy the updated manifest to the gadget folder, if necessary.
- Reopen the Gadget Picker.
The Primary HTML, Script, or CSS Files
- Copy the updated files to the gadget folder, if necessary.
- Open the Gadget Picker, if necessary. The Gadget Picker does not need to be closed.
- Install the updated gadget.
Note Any versions of the gadget added to the Sidebar prior to the update remain visible and continue to function as before.
The Settings and Flyout HTML, Script, or CSS Files
- Close the gadget Settings, if open.
- Copy the updated files to the gadget folder, if necessary.
Note The gadget does not need to be re-added to the Sidebar, the updated functionality will be available when the gadget settings, or the flyout, are re-displayed.
Distributing or Installing An Updated Gadget Package
When installing an updated gadget package, it's advisable to uninstall any previous versions by right-clicking the gadget in the Gadget Picker and selecting "Uninstall" from the context menu. This deletes all pre-existing gadget files. Otherwise, installing an updated gadget by either a self-installing gadget package or copying selected files results in the same behavior described above.
Gadgets and Web Services
Web services provide an alternative method for gadget developers to update their gadgets. Hosting business logic on a server and the presentation logic on the client (the gadget) allows for discrete updates with little to no intervention by end users.
Send comments about this topic to Microsoft
Build date: 2/3/2012
- 10/22/2011
- nwanne
There is an example in C++ (IDesktopGadget) included in the Windows SDK for Windows 7 Samples: http://www.microsoft.com/download/en/details.aspx?id=8442
- 9/13/2011
- Pedro BCN
The cabarc.exe syntax needed to CAB up your files is:
cabarc.exe -r -p -s 6144 N MyWidget.gadget *.*
The parameters in this case are:
-r recurse subdirectories
-p preserve path names (e.g. css\mywidget.css)
-s 6144 reserve space in cab for signature (6144 bytes)
See "Cabarc Syntax" (http://technet2.microsoft.com/windowsserver/en/library/2912d867-d424-401f-8256-82a2b321708f1033.mspx?mfr=true)
To sign the .cab file use signcode.exe:
signcode.exe -a "sha1" -spc "MyCertificateFile.spc" -v "myPrivateKeyFile.pvk" -t "http://timestamp.verisign.com/scripts/timstamp.dll" MyWidget.gadget
- 8/2/2008
- Jack Tripper
- 7/6/2011
- Thomas Lee
Before people can properly download a gadget from your web-server, there needs to be the proper miemtype configured for .gadget files
application/x-windows-gadget
In IIS you can configure mimetype associations from IIS administrator.
- 8/2/2008
- Jack Tripper
- 7/6/2011
- Thomas Lee
After you download the zip file, simply unzip it (e.g. using WinZip) and double click the LoopZineTV.gadget file to install.
- 6/28/2009
- LoopZineTV
- 7/6/2011
- Thomas Lee