public void ApplyAutorun()
{
using (var mgr = new UpdateManager(""))
{
try
{
if (Autorun)
mgr.CreateShortcutsForExecutable("Artemis.exe", ShortcutLocation.Startup, false);
else
mgr.RemoveShortcutsForExecutable("Artemis.exe", ShortcutLocation.Startup);
}
catch (FileNotFoundException)
{
// Ignored, only happens when running from VS
}
catch (DirectoryNotFoundException)
{
// Ignored, only happens when running from VS
}
}
}