Partager via


.NET Sidebar Gadget Creator Update

OK, ran into some problems with UAC on Vista and hopefully I have it solved. I've uploaded a new version of the application. I've gotten a couple email from people that tested the last version so I want to say thanks for testing it out. Again, let me know any issues you find with this new version.

You can find it here:: NetSBHostCreator.exe

Once I think I have a good working solution in place, I'll start posting tutorials on creating a .NET based gadget and using my application to host it in Vista Sidebar.

P.S. If you get an error during installation, uninstall the previous version first. I don't feel like debugging installation issues :-)

Comments

  • Anonymous
    July 26, 2007
    I don't think this is doing what you think it's doing.  The .NET assembly with your control in it is not actually being unloaded.  What happens is RegisterGadget.exe copies the assembly into the user's %TEMP% dir and registers it from there (check the registry and you'll see it pointing to the dll in the temp dir).  When you try to uninstall, the gadget uninstalls successfully because you're not using the assembly in the gadget dir.  However you're still leaving the assembly registered and in the temp dir and loaded by Sidebar, which is a little messy.  I'm not sure how you can fix that. Try it out -- Load your gadget, close it, and uninstall it.  Now without closing Sidebar, try to delete BouncingBall.dll from %TEMP%.  You can't, because it's still in-use.  Close the sidebar and all is well.  To fully clean up, you need to run regasm /u on %TEMP%bouncingball.dll, close sidebar, and delete the file.  I don't think you can automate that, but it might worth looking into. Also, this should be solvable in pure javascript, using a wscript shell object to copy the file into %TEMP% and the standard javascript to add the registry keys (refactored into reusable methods that just take an assembly name and GUID).  It doesn't hurt to do it as a separate executable, but you should be aware of what the registration is actually doing.

  • Anonymous
    July 27, 2007
    What you say is true I would like to point out some reasons for creating this:

  1. You can't submit a .NET based gadget to gallery.live.com because it won't uninstall. I should know. I tried to update a gadget with feature requests but was denied because it won't uninstall unless you shutdown sidebar.
  2. I'm all about user experience. I think filling out some fields, pointing to an assembly and hitting a button is a little easier than writing several lines of registry access JavaScript. Sure its trivial but so is nailing a board with your hand. Sure you might get it done but it will take awhile and may hurt a little. You also said "However you're still leaving the assembly registered and in the temp dir and loaded by Sidebar, which is a little messy". The other solution is still leaving the assembly registered (since there isn't any uninstall notification from sidebar that you can handle), not being able to uninstall anything since the assembly is still loaded in the gadget directory and leaving all your files in the gadget directory so that it still shows up in the add gadget page. I choose the former not the latter :-) BTW, it is doing what I think its doing. I wrote the code :-)
  • Anonymous
    October 13, 2008
    Hi Mark, I like your tool very much. Can you let me know how I can run more then one Gadget at once please? I currently get an error Cannot create an instance of type [UserControl Name] It seems to be fine when running only one instance of a .NET gadget but more then one seems to generate this issue.