diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 76af3bc..6c884f0 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -346,9 +346,18 @@ namespace DS4Windows.Forms if (onlylnkpath != Process.GetCurrentProcess().MainModule.FileName) { - File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk"); - appShortcutToStartup(); - changeStartupRoutine(); + try + { + File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk"); + appShortcutToStartup(); + changeStartupRoutine(); + } + catch + { + MessageBox.Show("No access to Autorun/DS4Windows.lnk\nPlease check file permissions", "DS4Windows"); + StartWindowsCheckBox.Checked = false; + runStartupPanel.Visible = false; + } } }