/// <summary> /// Change the File Association setting /// </summary> private void checkBoxFileAssoc_CheckedChanged(object sender, EventArgs e) { if (checkBoxFileAssoc.Checked) { SoundArchive.AssocFiles(); } else { SoundArchive.UnAssocFiles(); } }
/// <summary> /// Uninstall will remove application data from the user directory, sound scheme from the registry, and disable all system integration /// </summary> /// <returns></returns> public static void Uninstall() { if (BgSoundPlayer.RegisteredForStartup) { BgSoundPlayer.RegisteredForStartup = false; foreach (Process process in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(Application.ExecutablePath))) { if (process.Id != Process.GetCurrentProcess().Id) { process.Kill(); } } } SoundArchive.UnAssocFiles(); SoundScheme.Uninstall(); if (Directory.Exists(SoundEvent.DataDirectory)) { Directory.Delete(SoundEvent.DataDirectory, true); } if (Directory.Exists(DataFolder)) { Directory.Delete(DataFolder, true); } }