mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-29 17:02:05 +13:00
Auto detect WindowsKitsDir
This commit is contained in:
parent
309b77a650
commit
060b61d00e
2 changed files with 13 additions and 4 deletions
|
@ -307,7 +307,7 @@ public static int CompareApplicationVersion(string version)
|
|||
return CompareVersion(version, Application.ProductVersion);
|
||||
}
|
||||
|
||||
private static Version NormalizeVersion(string version)
|
||||
public static Version NormalizeVersion(string version)
|
||||
{
|
||||
return Version.Parse(version).Normalize();
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using Microsoft.Win32;
|
||||
using ShareX.HelpersLib;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
@ -61,6 +62,7 @@ private enum SetupJobs
|
|||
private static string ParentDir;
|
||||
private static string Configuration;
|
||||
private static string AppVersion;
|
||||
private static string WindowsKitsDir;
|
||||
|
||||
private static string SolutionPath => Path.Combine(ParentDir, "ShareX.sln");
|
||||
private static string BinDir => Path.Combine(ParentDir, "ShareX", "bin", Configuration);
|
||||
|
@ -86,10 +88,9 @@ private enum SetupJobs
|
|||
private static string SteamZipPath => Path.Combine(OutputDir, $"ShareX-{AppVersion}-Steam.zip");
|
||||
private static string MicrosoftStoreAppxPath => Path.Combine(OutputDir, $"ShareX-{AppVersion}.appx");
|
||||
private static string FFmpegPath => Path.Combine(OutputDir, "ffmpeg.exe");
|
||||
private static string MakeAppxPath => Path.Combine(WindowsKitsDir, "x64", "makeappx.exe");
|
||||
|
||||
private const string InnoSetupCompilerPath = @"C:\Program Files (x86)\Inno Setup 6\ISCC.exe";
|
||||
private const string MakeAppxPath = @"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\makeappx.exe";
|
||||
private const string MakeAppxPathAppVeyor = @"C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64\makeappx.exe";
|
||||
private const string FFmpegDownloadURL = "https://github.com/ShareX/FFmpeg/releases/download/v5.1/ffmpeg-5.1-win64.zip";
|
||||
|
||||
private static void Main(string[] args)
|
||||
|
@ -241,6 +242,14 @@ private static void UpdatePaths()
|
|||
AppVersion = $"{versionInfo.ProductMajorPart}.{versionInfo.ProductMinorPart}.{versionInfo.ProductBuildPart}";
|
||||
|
||||
Console.WriteLine("Application version: " + AppVersion);
|
||||
|
||||
string sdkInstallationFolder = RegistryHelpers.GetValueString(@"SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0",
|
||||
"InstallationFolder", RegistryHive.LocalMachine);
|
||||
string sdkProductVersion = RegistryHelpers.GetValueString(@"SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0",
|
||||
"ProductVersion", RegistryHive.LocalMachine);
|
||||
WindowsKitsDir = Path.Combine(sdkInstallationFolder, "bin", Helpers.NormalizeVersion(sdkProductVersion).ToString());
|
||||
|
||||
Console.WriteLine("Windows Kits directory: " + WindowsKitsDir);
|
||||
}
|
||||
|
||||
private static void CompileSetup()
|
||||
|
@ -287,7 +296,7 @@ private static void CompileAppx()
|
|||
{
|
||||
ProcessStartInfo psi = new ProcessStartInfo()
|
||||
{
|
||||
FileName = AppVeyor ? MakeAppxPathAppVeyor : MakeAppxPath,
|
||||
FileName = MakeAppxPath,
|
||||
Arguments = $"pack /d \"{MicrosoftStoreOutputDir}\" /p \"{MicrosoftStoreAppxPath}\" /l /o",
|
||||
UseShellExecute = false
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue