Merge branch 'almod90-safer-startup' into jay

This commit is contained in:
Travis Nickles 2019-11-04 01:08:54 -06:00
commit 7120feac88

View File

@ -346,9 +346,18 @@ namespace DS4Windows.Forms
if (onlylnkpath != Process.GetCurrentProcess().MainModule.FileName) if (onlylnkpath != Process.GetCurrentProcess().MainModule.FileName)
{ {
File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk"); string ds4lnkpath = Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk";
appShortcutToStartup(); if (!new FileInfo(ds4lnkpath).IsReadOnly)
changeStartupRoutine(); {
File.Delete(ds4lnkpath);
appShortcutToStartup();
changeStartupRoutine();
}
else
{
StartWindowsCheckBox.Checked = false;
runStartupPanel.Visible = false;
}
} }
} }