Reputation: 4359
My Desktop Application is just a single exe file. For reasons that aren't important, I can't use an installer which would add an icon to the Windows 8 Start screen. Can one be added programatically with C#?
Thanks
Upvotes: 2
Views: 1877
Reputation: 1073
If you right click on the exe you can click pin-to start
This worked for my example in the image, which is a stand-alone exe without any sort of installation. It will then appear on the start bar.
Hope this helps.
EDIT: I realized after that you said programmatically. It looks like a link to the start page is put in C:\Users[UserName]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs So perhaps you could tell it to deposit a short cut there?
EDIT 2 this previous question may also be helpful: Creating application shortcut in a directory. It is in C#
Upvotes: 4
Reputation: 23754
Take a look at the code samples for enabling desktop notifications, a prerequisite of which is the existence of a shortcut installed to the Start screen. The sample is C++ w/COM, but you should be able to incorporate this small bit into a C# app (or rewrite the sample code in C# directly).
Upvotes: 0