Create appx file

This commit is contained in:
Jaex 2017-05-18 00:32:38 +03:00
parent c5267602dc
commit 8756b9ffa1

View file

@ -84,6 +84,7 @@ private enum SetupJobs
private static string NativeMessagingHostDir => Path.Combine(ParentDir, @"ShareX.NativeMessagingHost\bin\Release");
private static string DesktopBridgeHelperDir => Path.Combine(ParentDir, @"ShareX.DesktopBridgeHelper\bin\Release");
private static string RecorderDevicesSetupPath => Path.Combine(OutputDir, "Recorder-devices-setup.exe");
private static string WindowsStoreAppxPath => Path.Combine(OutputDir, "ShareX.appx");
public static string InnoSetupCompilerPath = @"C:\Program Files (x86)\Inno Setup 5\ISCC.exe";
public static string ZipPath = @"C:\Program Files\7-Zip\7z.exe";
@ -263,6 +264,11 @@ private static void CreateFolder(string source, string destination, SetupJobs jo
{
Helpers.CopyFile(Path.Combine(DesktopBridgeHelperDir, "ShareX_DesktopBridgeHelper.exe"), destination);
Helpers.CopyAll(WindowsStorePackageFilesDir, destination);
Process.Start(@"C:\Program Files (x86)\Windows Kits\10\bin\x64\makeappx.exe",
$"pack /d \"{destination}\" /p \"{WindowsStoreAppxPath}\" /l /o").WaitForExit();
Directory.Delete(destination, true);
}
else if (job == SetupJobs.CreatePortable)
{
@ -279,10 +285,7 @@ private static void CreateFolder(string source, string destination, SetupJobs jo
Helpers.Zip(Path.GetFullPath(destination) + "\\*", Path.GetFullPath(zipPath));
if (Directory.Exists(destination))
{
Directory.Delete(destination, true);
}
Directory.Delete(destination, true);
}
Console.WriteLine("Folder created.");