Skip to content

Commit

Permalink
アンインストール時に一時フォルダを削除
Browse files Browse the repository at this point in the history
  • Loading branch information
yutokun committed Dec 25, 2021
1 parent c6f6466 commit 6d7a087
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Setup/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.IO;
using WixSharp;
using File = WixSharp.File;

namespace Setup
{
Expand All @@ -10,15 +12,25 @@ public static void Main()
var exe = new File(@"..\APKInstaller\bin\Release\APKInstaller.exe");
exe.Shortcuts = new[] { new FileShortcut("APK Installer", "%ProgramMenu%") };
var files = new Dir(@"%ProgramFiles%\yutokun\APK Installer", exe);
var project = new Project("APK Installer", files)
var project = new ManagedProject("APK Installer", files)
{
ProductId = new Guid("f9b8f955-f62f-4765-a2e3-c94c198b3eb0"),
UpgradeCode = new Guid("f9b8f955-f62f-4765-a2e3-c94c198b3eb1"),
Version = new Version("1.4.1"),
LicenceFile = "../LICENSE.rtf",
Language = "ja-JP"
};
project.AfterInstall += RemoveTempFolder;
Compiler.BuildMsi(project);
}

static void RemoveTempFolder(SetupEventArgs e)
{
if (e.IsUninstalling)
{
var temp = Path.Combine(Path.GetTempPath(), "APKInstaller");
Directory.Delete(temp, true);
}
}
}
}

0 comments on commit 6d7a087

Please sign in to comment.