title: Registry Startup not working windows application
body: <p>I created windows application ,I want to start my application on windows startup
  for that i written following code in installer class. but when i am checking registry using regedit i didnt get registry value. and my application not working.</p>
  
  <pre><code>        public override void Commit(IDictionary savedState)
          {
              base.Commit(savedState);
  
  
              try
              {
                  RegistryKey add = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
                  add.SetValue("ToposcreenServer", "\"" + Application.ExecutablePath.ToString() + "\"");
  
  
                  RegistryKey key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{70E25B31-99A9-474C-8990-CE28FBCEAAD1}", RegistryKeyPermissionCheck.Default);
                  if (key != null)
                  {
                      key.SetValue("SystemComponent", 1, RegistryValueKind.DWord);
                      key.Close();
                  }
                  Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
                  Process.Start(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\ToposcreenServer.exe");
                  GLobalclass.WriteLog("Installer Executed");
              }
              catch (Exception ex)
              {
                  GLobalclass.WriteLog("Installer Error :" + ex.Message);
              }
          }
  </code></pre>