1

I am creating wpf application using visual studio 2010 specifically for windows 7 operating system. Now I want my wpf app to start when ever computer starts. I googled it and wrote service but couldn't succeeded what I need. I do not know how to use that service properly or how to make one installer of both service project and wpf project ( I am new to wpf dev).

this is the code I found on msdn forum but do not know if I am using it right way - I think I am not giving right path of exe file

 protected override void OnStart(string[] args)
    {
        ProcessStartInfo info = new ProcessStartInfo(@"C:\Users\Zeshan\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\TaskManagerPro");
        info.CreateNoWindow = false;
        Process p = new Process();
        p.StartInfo = info;
        p.Start();
    }

Please guide me to the right direction and if possible kindly share some source code and also guide what is the best way to create installer.

rene
  • 39,748
  • 78
  • 111
  • 142
Zeshan Aman
  • 103
  • 3
  • 12

2 Answers2

0

Try this solution from this answer: https://stackoverflow.com/a/5527457/2696641

Modifying a current user registry items do not require admin access.

Community
  • 1
  • 1
0

Add you value to HKCU\Software\Microsoft\Windows\CurrentVersion\Run.

John Smith
  • 487
  • 1
  • 5
  • 20