Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions src/PackageUploader.UI/ViewModel/PackageCreationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,6 @@ private async void StartMakePackageProcess()

if (UseMsixvc2)
{
// According to the SubmissionValidator development team, an upcoming version will no longer have this dependency and this workaround will be removable
CopyXsapiDllToSettingsFolder(_settingsFolder);

string msixvc2CmdFormat = "pack /f \"{0}\" /pd \"{1}\" /d \"{2}\" /msixvc2 /updatesubval /validationpath \"{3}\"";
arguments = string.Format(msixvc2CmdFormat, MappingDataXmlPath, buildPath, GameDataPath, _settingsFolder);
executablePath = _pathConfigurationService.MakePkg2Path;
Expand Down Expand Up @@ -903,40 +900,6 @@ private bool PopulateSubValArgs(string settingsFolder, ref string arguments)
return true;
}

/// <summary>
/// Copies XSAPI.dll from the GDK bin folder to the settings folder if it exists.
/// SubmissionValidator.dll has a native dependency on XSAPI.dll, and when makepkg2 downloads
/// a fresh validator via /updatesubval, XSAPI.dll must be in the same directory for it to load.
/// </summary>
private void CopyXsapiDllToSettingsFolder(string settingsFolder)
{
try
{
string? gdkBinDir = Path.GetDirectoryName(_pathConfigurationService.BaseSubValPath);
if (string.IsNullOrEmpty(gdkBinDir))
{
return;
}

string sourceXsapi = Path.Combine(gdkBinDir, "xsapi.dll");
if (!File.Exists(sourceXsapi))
{
return;
}

string destXsapi = Path.Combine(settingsFolder, "xsapi.dll");
if (!File.Exists(destXsapi))
{
File.Copy(sourceXsapi, destXsapi, overwrite: false);
_logger.LogInformation("Copied xsapi.dll to settings folder for SubmissionValidator dependency.");
}
}
catch (Exception ex)
{
_logger.LogWarning("Failed to copy xsapi.dll to settings folder: {message}", ex.Message);
}
}

private async Task GenerateMappingFile(string tempBuildPath)
{
Process? makePackageProcess;
Expand Down
Loading