Reputation: 165
I have created a ClickOnce application, available offline and can be reached through the start menu.
However, is it possible to set this application to launch on startup/set a shortcut in startup folder through code or settings rather than creating some sort of batch file to do it for me? ClickOnce options seem to be really limited!
Upvotes: 3
Views: 2783
Reputation: 16698
You can found the answer to your question in here, Run ClickOnce app on startup
You can also use startup registry key to launch your application.
It is very simple to setup a key to launch a ClickOnce application and does not require setting up additional shortcuts. You simply use the shortcut created on install:
// The path to the key where Windows looks for startup applications
RegistryKey rk = Registry.CurrentUser.OpenSubKey(
@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);
//Path to launch shortcut
string startPath = Environment.GetFolderPath(Environment.SpecialFolder.Programs)
+ @"\YourPublisher\YourSuite\YourProduct";
rk.SetValue("YourProduct", startPath);
Upvotes: 1