so finally created a vista gadget..... following are the steps to package it in a installer (which I think are the most important to remember ).....
complete article from Jan Kucera.
Deploying
Oh yes, and when we are finished, we still have to deploy the gadget. As I already wrote a while ago, you can install a gadget either by copying it to a gadgets folder (e.g. user's, system's or default user's) or by unpackaging the ZIP archive. You can also pack it into a CAB archive. Why would you want to do that? Because the CAB archive can be signed. Fortunately the sidebar team knows how costly code signing certificates are, so they did not place any requirements that gadgets must be digitally signed. Follow me as I pack the Garfield gadget for you:
Start Visual Studio 2005 Command Prompt and navigate to the folder with your gadget.
Type cabarc -p -r N MyGadget.gadget * and press Enter.
You cannot create a CAB Setup project in Visual Studio, since it does not preserve subdirectories.
(-p preserves directories in archives, -r includes files from subdirectories, N creates new archive)
Type makecert -sv "MyGadget.pvk" -n "CN=My Company" MyGadget.cer and press Enter.
This creates a certificate, which you need in order to sign the gadget. Please choose another name than MyGadget for your gadget. You will be asked three times for the password. Type anything you want here.
(-sv creates a private key, -n sets the Issued To field)
Type signtool signwizard and press Enter. The Digital Signature Wizard will be started.
Press Next, Browse and locate the .gadget file we created in step 1. (Note: the open dialog box has an executable files filter by default, so you will need to switch it to All Files (*.*) to see your gadget.
Press Next, choose Custom signing options, and press Next again.
On the Signature Certificate page click Select from File..., and locate and open the .cer file we created in step 2 (switch filter to X.509 Certificate (*.cer;*.crt). Now you should see details of the certificate we set above and we are ready to continue. Next.
Now the private key comes into play - click Browse and open it. Click Next and re-enter the password we just created.
Choose your favorite hash algorithm (or leave the selected one), press Next and also press Next on the next page.
If you see the Data Description page now, you can fill in a short description of your gadget and web link. Now the Timestamp page. If you want to mark the gadget creation time, check the checkbox and enter http://timestamp.verisign.com/scripts/timstamp.dll (unless you prefer another timestamp provider). Next.
Here it is! Click Finish, re-enter password if asked, and we are done.
If you find it easier or don't want to use the GUI, you can enter
signtool sign /v /a /d "Description of gadget" /du http://your.web.link/ /t http://timestamp.verisign.com/scripts/timstamp.dll MyGadget.gadget
(/v optional tells you if the command succeeded, /a tries to find any certificate for signing, /d, /du, /t optional - see above)
If you have a .pfx for your projects generated by Visual Studio, you can use it the following way:
signtool sign /v /f MyFile.pfx /p password /t http://timestamp.verisign.com/scripts/timstamp.dll MyGadget.gadget
(/f assuming you have the pfx file in the same directory, /p optional password for your pfx created in Visual Studio)
Double-click the .gadget file to test whether everything works ok.
No comments:
Post a Comment