I have checked some other examples.
I am working on a WinForm. & now i am going to create its installer.
i want to start the software when windows starts & trying to use the following code.
RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
rkApp.SetValue("MyApp", Application.ExecutablePath.ToString());
But i am confused that where to put this code. i don't want this code executed every time when my application starts as it will executed once when the software is installed.
shall i put check on form_Load() if the regkey is absent, & if yes then add this value to the Run.
is it correct ? i don't want to give an option to the user & i want to start this application at the startup compulsorily.
Thanks.