示例#1
0
        private void TryDeleteAllFiles()
        {
            try
            {
                if (null != _tempFilePath && File.Exists(_tempFilePath))
                {
                    File.Delete(_tempFilePath);
                }
            }
            catch (Exception exception)
            {
                Debug.Write(exception);
            }

            try
            {
                if (Directory.Exists(SetupConsts.AppDirectory))
                {
                    Directory.Delete(SetupConsts.AppDirectory, true);
                }
            }
            catch (Exception exception)
            {
                Debug.Write(exception);
            }

            ShortcutUtility.TryDeleteShortcut(
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu)),
                SetupConsts.AppStartupFile);

            ShortcutUtility.TryDeleteShortcut(
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop)),
                SetupConsts.AppStartupFile);

            RegistryUtility.RemoveUninstallRegistryKey();
        }