3

Is is possible to install a gadget to a user's desktop somehow? I believe I need to copy all the files to a the user's gadget folder, e.g.

C:\Users\curusername\AppData\Local\Microsoft\Windows Sidebar\Gadgets\test.gadget

But copying the files here doesn't run the gadget. How can I register/activate it?

Is it enough to shell execute test.gadget?

Andy E
  • 338,112
  • 86
  • 474
  • 445
Tom
  • 6,725
  • 24
  • 95
  • 159

2 Answers2

5

Late answer, I know, but the other answer is talking about Windows Sideshow Gadgets, and your question is related to Windows Desktop Gadgets.

It's possible to run the gadget on Windows 7 without shell executing the archive, you need to use the IDesktopGadget interface method RunGadget. Call RunGadget on a folder containing your gadget's files and it will appear on the user's desktop.

A description of the RunGadget method and sample code for C++ is offered here:

http://msdn.microsoft.com/en-us/library/dd378390(VS.85).aspx

If you're using .NET, refer to a previous question I asked for how to implement the IDesktopGadget interface:

Stack Overflow - C#: Referencing a windows shell interface

For backwards compatibility (Vista), I would recommend you fall back to the shell execute method.

Community
  • 1
  • 1
Andy E
  • 338,112
  • 86
  • 474
  • 445
  • This doesn't answer what to do on InnoSetup, there's something here but doesn't support 64bit AFAICT: http://forum.oszone.net/post-1861100-834.html – lapo May 07 '12 at 15:28
  • I'm not sure how it doesn't answer what to do on InnoSetup. True, I've never used it, but the instructions still apply ― call the `RunGadget` function on a folder containing the gadget files. If the OP knows how to code for InnoSetup and InnoSetup allows the use of Win32 interfaces, then this answer should provide what he needs to know, without going as far as writing the entire thing for him (which isn't really in the spirit of things). – Andy E May 07 '12 at 16:47
0

The following MSDN Article covers this:

http://msdn.microsoft.com/en-us/library/cc982277(VS.85).aspx

Robert Love
  • 12,447
  • 2
  • 48
  • 80
  • This answer links to an article about Windows Sideshow Gadgets, I have no idea why the OP accepted it. They work completely different to Windows Desktop Gadgets. – Andy E Mar 08 '12 at 09:46
  • Adding links to third party sites as an 'answer' needs to be stopped. MSDN is not associated with SO or SE and if they decide to break said link your answer becomes useless... instead can you pull the applicable notes out of the article... then link to the article for your source. – rlemon May 07 '12 at 16:56