Files
Sourcetrail/deployment/windows/CoatiAppSetup/SetupRemoveCacheFiles/SetupRemoveCacheFiles.cs
T
malte_langkabel 4dabe31776 build: windows deploy
* implemented a new deploy script for windows
* created a new setup project for the Coati Trail
2016-02-24 10:52:24 +01:00

49 lines
1.2 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace SetupRemoveCacheFiles
{
[RunInstaller(true)]
public partial class SetupRemoveCacheFiles : System.Configuration.Install.Installer
{
public SetupRemoveCacheFiles()
{
InitializeComponent();
}
protected override void OnAfterRollback(IDictionary savedState)
{
base.OnAfterRollback(savedState);
DeleteCacheFiles();
}
protected override void OnAfterUninstall(IDictionary savedState)
{
base.OnAfterUninstall(savedState);
DeleteCacheFiles();
}
private void DeleteCacheFiles()
{
try
{
string appDataCoatiPath = Environment.GetEnvironmentVariable("APPDATA") + "\\..\\local\\Coati Software"; // \\Coati\\";
Directory.Delete(appDataCoatiPath, true);
}
catch(Exception e)
{
// well damn
}
}
}
}