Enhance NuGet Package Installation for C++ and C# Projects (#4339)
* initial commit * Revert MainWindow.hmMainWindow.xaml, and MainWindow.cpp to their state in main branch * Revert MainWindow files in SingleProject Cpp to their state in the main branch * adding ThreadHelper.ThrowIfNotOnUIThread in Wizard * removing nuget package list in favour of vstemplate params, fixing wapproj to add wizard ref + removing hardcoded versions in it * fix * adding another wizardtemplate ref to extension class * working wapproj logic * adding multipackage support to C++, changing its implementation to Cpp analogue * fixing bug --------- Co-authored-by: Shashank Nayak <shasnayak@microsoft.com>
This commit is contained in:
Родитель
317f33ef36
Коммит
ea58820039
|
@ -1,4 +1,4 @@
|
|||
<Project ToolsVersion="Current">
|
||||
<Project ToolsVersion="Current">
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
|
@ -55,7 +55,8 @@
|
|||
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
<PackageReference Include="NuGet.VisualStudio" Version="17.9.1" GeneratePathProperty="true" />
|
||||
<PackageReference Include="NuGet.VisualStudio" Version="17.6.1" GeneratePathProperty="true" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.TemplateWizardInterface" Version="17.5.33428.366" />
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.4.2118">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
|
|
|
@ -6,11 +6,12 @@ using Microsoft.VisualStudio.ComponentModelHost;
|
|||
using Microsoft.VisualStudio.Shell;
|
||||
using Microsoft.VisualStudio.Shell.Interop;
|
||||
using Microsoft.VisualStudio.TemplateWizard;
|
||||
using Microsoft.VisualStudio.Threading;
|
||||
using NuGet.VisualStudio;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using WindowsAppSDK.Cpp.Extension;
|
||||
|
||||
namespace WindowsAppSDK.TemplateUtilities.Cpp
|
||||
{
|
||||
|
@ -18,65 +19,61 @@ namespace WindowsAppSDK.TemplateUtilities.Cpp
|
|||
{
|
||||
private Project _project;
|
||||
private IComponentModel _componentModel;
|
||||
private IEnumerable<string> _nuGetPackages;
|
||||
private IVsNuGetProjectUpdateEvents _nugetProjectUpdateEvents;
|
||||
|
||||
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
|
||||
{
|
||||
ThreadHelper.ThrowIfNotOnUIThread();
|
||||
_componentModel = (IComponentModel)ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel));
|
||||
}
|
||||
_nugetProjectUpdateEvents = _componentModel.GetService<IVsNuGetProjectUpdateEvents>();
|
||||
_nugetProjectUpdateEvents.SolutionRestoreFinished += OnSolutionRestoreFinished;
|
||||
// Assuming package list is passed via a custom parameter in the .vstemplate file
|
||||
if (replacementsDictionary.TryGetValue("$NuGetPackages$", out string packages))
|
||||
{
|
||||
_nuGetPackages = packages.Split(';').Where(p => !string.IsNullOrEmpty(p));
|
||||
}
|
||||
}
|
||||
public void ProjectFinishedGenerating(Project project)
|
||||
{
|
||||
_project = project;
|
||||
|
||||
// Ensure we're on the main thread, as required by the ProjectFinishedGenerating method and DTE operations
|
||||
ThreadHelper.JoinableTaskFactory.Run(async () =>
|
||||
{
|
||||
await InstallNuGetPackagesAsync(_project);
|
||||
});
|
||||
}
|
||||
private async Task InstallNuGetPackagesAsync(Project project)
|
||||
}
|
||||
// InstallNuGetPackagesAsync iterates over the package list and installs each
|
||||
private async Task InstallNuGetPackagesAsync()
|
||||
{
|
||||
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
|
||||
foreach (var packageId in NuGetPackageList.Packages)
|
||||
var installer = _componentModel.GetService<IVsPackageInstaller>();
|
||||
|
||||
foreach (var packageId in _nuGetPackages)
|
||||
{
|
||||
try
|
||||
{
|
||||
// No version specified; it installs the latest stable version
|
||||
await InstallNuGetPackageAsync(packageId);
|
||||
// Install the latest stable version of each package
|
||||
installer.InstallPackage(null, _project, packageId, version: "", ignoreDependencies: false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogError($"Failed to install NuGet package: {packageId}. Error: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void BeforeOpeningFile(ProjectItem _)
|
||||
{
|
||||
}
|
||||
}
|
||||
public void ProjectItemFinishedGenerating(ProjectItem _)
|
||||
{
|
||||
}
|
||||
}
|
||||
public void RunFinished()
|
||||
{
|
||||
|
||||
}
|
||||
private async Task InstallNuGetPackageAsync(string packageId)
|
||||
private void OnSolutionRestoreFinished(IReadOnlyList<string> projects)
|
||||
{
|
||||
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
|
||||
IVsPackageInstaller installer = _componentModel.GetService<IVsPackageInstaller>();
|
||||
if (installer == null)
|
||||
{
|
||||
LogError("Could not obtain IVsPackageInstaller service.");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
installer.InstallPackage(null, _project, packageId, "", false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogError($"Error installing package {packageId}: {ex.Message}");
|
||||
}
|
||||
// Debouncing prevents multiple rapid executions of 'InstallNuGetPackageAsync'
|
||||
// during solution restore.
|
||||
_nugetProjectUpdateEvents.SolutionRestoreFinished -= OnSolutionRestoreFinished;
|
||||
var joinableTaskFactory = new JoinableTaskFactory(ThreadHelper.JoinableTaskContext);
|
||||
_ = joinableTaskFactory.RunAsync(InstallNuGetPackagesAsync);
|
||||
}
|
||||
private void LogError(string message)
|
||||
{
|
||||
|
|
|
@ -12,130 +12,85 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace WindowsAppSDK.TemplateUtilities
|
||||
{
|
||||
public class NuGetPackageInstaller : IWizard
|
||||
{
|
||||
private string _packageId;
|
||||
public class NuGetPackageInstaller : IWizard
|
||||
{
|
||||
private Project _project;
|
||||
private IComponentModel _componentModel;
|
||||
private IEnumerable<string> _nuGetPackages;
|
||||
private IVsNuGetProjectUpdateEvents _nugetProjectUpdateEvents;
|
||||
|
||||
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
|
||||
{
|
||||
ThreadHelper.ThrowIfNotOnUIThread();
|
||||
|
||||
_packageId = ExtractPackageId(replacementsDictionary);
|
||||
_componentModel = (IComponentModel)ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel));
|
||||
_nugetProjectUpdateEvents = _componentModel.GetService<IVsNuGetProjectUpdateEvents>();
|
||||
_nugetProjectUpdateEvents.SolutionRestoreFinished += OnSolutionRestoreFinished;
|
||||
}
|
||||
private string ExtractPackageId(Dictionary<string, string> replacementsDictionary)
|
||||
{
|
||||
if (replacementsDictionary.TryGetValue("$wizarddata$", out string wizardDataXml))
|
||||
// Assuming package list is passed via a custom parameter in the .vstemplate file
|
||||
if (replacementsDictionary.TryGetValue("$NuGetPackages$", out string packages))
|
||||
{
|
||||
XDocument xDoc = XDocument.Parse(wizardDataXml);
|
||||
XNamespace ns = xDoc.Root.GetDefaultNamespace();
|
||||
string packageId = xDoc.Descendants(ns + "package")
|
||||
.Attributes("id")
|
||||
.Select(attr => attr.Value)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (!string.IsNullOrEmpty(packageId))
|
||||
{
|
||||
return packageId;
|
||||
}
|
||||
_nuGetPackages = packages.Split(';').Where(p => !string.IsNullOrEmpty(p));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void ProjectFinishedGenerating(Project project)
|
||||
{
|
||||
_project = project;
|
||||
}
|
||||
public void BeforeOpeningFile(ProjectItem _)
|
||||
{
|
||||
}
|
||||
public void ProjectItemFinishedGenerating(ProjectItem _)
|
||||
{
|
||||
}
|
||||
public void RunFinished()
|
||||
{
|
||||
|
||||
}
|
||||
private void OnSolutionRestoreFinished(IReadOnlyList<string> projects)
|
||||
{
|
||||
// Debouncing prevents multiple rapid executions of 'InstallNuGetPackageAsync'
|
||||
// during solution restore.
|
||||
_nugetProjectUpdateEvents.SolutionRestoreFinished -= OnSolutionRestoreFinished;
|
||||
var joinableTaskFactory = new JoinableTaskFactory(ThreadHelper.JoinableTaskContext);
|
||||
joinableTaskFactory.RunAsync(InstallNuGetPackageAsync);
|
||||
|
||||
}
|
||||
private Task InstallNuGetPackageAsync()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_packageId))
|
||||
{
|
||||
string message = "Failed to install the NuGet package. The package ID provided in the template configuration is either missing or invalid. Please ensure the template is correctly configured with a valid package ID.";
|
||||
DisplayMessageToUser(message, "Error", OLEMSGICON.OLEMSGICON_CRITICAL);
|
||||
LogError(message);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
IVsPackageInstaller installer = _componentModel.GetService<IVsPackageInstaller>();
|
||||
try
|
||||
{
|
||||
installer.InstallPackage(null, _project, _packageId, "", false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string errorMessage = "Failed to install the Microsoft.WindowsAppSDK package. You can try installing it manually from: https://www.nuget.org/packages/Microsoft.WindowsAppSDK";
|
||||
DisplayMessageToUser(errorMessage, "Installation Error", OLEMSGICON.OLEMSGICON_CRITICAL);
|
||||
|
||||
string logMessage = $"Failed to install Microsoft.WindowsAppSDK package. Exception details: \n" +
|
||||
$"Message: {ex.Message}\n" +
|
||||
$"Source: {ex.Source}\n" +
|
||||
$"Stack Trace: {ex.StackTrace}\n" +
|
||||
$"Target Site: {ex.TargetSite}\n";
|
||||
|
||||
if (ex.InnerException != null)
|
||||
{
|
||||
logMessage += $"Inner Exception Message: {ex.InnerException.Message}\n" +
|
||||
$"Inner Exception Stack Trace: {ex.InnerException.StackTrace}\n";
|
||||
}
|
||||
LogError(logMessage);
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
private void DisplayMessageToUser(string message, string title, OLEMSGICON icon)
|
||||
{
|
||||
ThreadHelper.JoinableTaskFactory.Run(async delegate
|
||||
_project = project;
|
||||
}
|
||||
// InstallNuGetPackagesAsync iterates over the package list and installs each
|
||||
private async Task InstallNuGetPackagesAsync()
|
||||
{
|
||||
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
|
||||
var installer = _componentModel.GetService<IVsPackageInstaller>();
|
||||
|
||||
foreach (var packageId in _nuGetPackages)
|
||||
{
|
||||
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
|
||||
VsShellUtilities.ShowMessageBox(
|
||||
ServiceProvider.GlobalProvider,
|
||||
message,
|
||||
title,
|
||||
icon,
|
||||
OLEMSGBUTTON.OLEMSGBUTTON_OK,
|
||||
OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
|
||||
});
|
||||
try
|
||||
{
|
||||
// Install the latest stable version of each package
|
||||
installer.InstallPackage(null, _project, packageId, version: "", ignoreDependencies: false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogError($"Failed to install NuGet package: {packageId}. Error: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
public void BeforeOpeningFile(ProjectItem _)
|
||||
{
|
||||
}
|
||||
public void ProjectItemFinishedGenerating(ProjectItem _)
|
||||
{
|
||||
}
|
||||
public void RunFinished()
|
||||
{
|
||||
|
||||
}
|
||||
private void OnSolutionRestoreFinished(IReadOnlyList<string> projects)
|
||||
{
|
||||
// Debouncing prevents multiple rapid executions of 'InstallNuGetPackageAsync'
|
||||
// during solution restore.
|
||||
_nugetProjectUpdateEvents.SolutionRestoreFinished -= OnSolutionRestoreFinished;
|
||||
var joinableTaskFactory = new JoinableTaskFactory(ThreadHelper.JoinableTaskContext);
|
||||
_ = joinableTaskFactory.RunAsync(InstallNuGetPackagesAsync);
|
||||
|
||||
}
|
||||
private void LogError(string message)
|
||||
{
|
||||
IVsActivityLog log = ServiceProvider.GlobalProvider.GetService(typeof(SVsActivityLog)) as IVsActivityLog;
|
||||
if (log != null)
|
||||
ThreadHelper.ThrowIfNotOnUIThread();
|
||||
ThreadHelper.JoinableTaskFactory.Run(async delegate
|
||||
{
|
||||
log.LogEntry(
|
||||
(UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_ERROR,
|
||||
"WindowsAppSDK.TemplateUtilities",
|
||||
message);
|
||||
}
|
||||
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
|
||||
IVsActivityLog log = ServiceProvider.GlobalProvider.GetService(typeof(SVsActivityLog)) as IVsActivityLog;
|
||||
if (log != null)
|
||||
{
|
||||
int hr = log.LogEntry((uint)__ACTIVITYLOG_ENTRYTYPE.ALE_ERROR, ToString(), message);
|
||||
}
|
||||
});
|
||||
}
|
||||
public bool ShouldAddProjectItem(string _)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="$ext_WindowsSDKBuildToolsNupkgVersion$" />
|
||||
<Manifest Include="$(ApplicationManifest)" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -34,15 +34,13 @@
|
|||
<ProjectItem ReplaceParameters="true" TargetFileName="App.xaml.cs">App.xaml.cs</ProjectItem>
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="MainWindow.xaml">MainWindow.xaml</ProjectItem>
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="MainWindow.xaml.cs">MainWindow.xaml.cs</ProjectItem>
|
||||
</Project>
|
||||
</Project>
|
||||
<CustomParameters>
|
||||
<CustomParameter Name="$NuGetPackages$" Value="Microsoft.WindowsAppSDK;Microsoft.Windows.SDK.BuildTools"/>
|
||||
</CustomParameters>
|
||||
</TemplateContent>
|
||||
<WizardExtension>
|
||||
<Assembly>WindowsAppSDK.Cs.Extension.Dev17, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Assembly>
|
||||
<FullClassName>WindowsAppSDK.TemplateUtilities.NuGetPackageInstaller</FullClassName>
|
||||
</WizardExtension>
|
||||
<WizardData>
|
||||
<packages>
|
||||
<package id="Microsoft.WindowsAppSDK" />
|
||||
</packages>
|
||||
</WizardData>
|
||||
</VSTemplate>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<VSTemplate Version="3.0.0" Type="Project" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" xmlns:sdk="http://schemas.microsoft.com/developer/vstemplate-sdkextension/2010">
|
||||
<TemplateData>
|
||||
<Hidden>true</Hidden>
|
||||
|
@ -37,7 +37,10 @@
|
|||
<ProjectItem ReplaceParameters="false" TargetFileName="Images\Square44x44Logo.targetsize-24_altform-unplated.png">Square44x44Logo.targetsize-24_altform-unplated.png</ProjectItem>
|
||||
<ProjectItem ReplaceParameters="false" TargetFileName="Images\StoreLogo.png">StoreLogo.png</ProjectItem>
|
||||
<ProjectItem ReplaceParameters="false" TargetFileName="Images\Wide310x150Logo.scale-200.png">Wide310x150Logo.scale-200.png</ProjectItem>
|
||||
</Project>
|
||||
</Project>
|
||||
<CustomParameters>
|
||||
<CustomParameter Name="$NuGetPackages$" Value="Microsoft.WindowsAppSDK;Microsoft.Windows.SDK.BuildTools"/>
|
||||
</CustomParameters>
|
||||
</TemplateContent>
|
||||
<WizardExtension>
|
||||
<Assembly>Microsoft.VisualStudio.Universal.TemplateWizards, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
|
||||
|
@ -48,10 +51,14 @@
|
|||
<Assembly>Microsoft.VisualStudio.WinRT.TemplateWizards, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
|
||||
<FullClassName>Microsoft.VisualStudio.WinRT.TemplateWizards.UpdatePublisherInManifestWizard</FullClassName>
|
||||
</WizardExtension>
|
||||
<WizardExtension>
|
||||
<Assembly>WindowsAppSDK.Cs.Extension.Dev17, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Assembly>
|
||||
<FullClassName>WindowsAppSDK.TemplateUtilities.NuGetPackageInstaller</FullClassName>
|
||||
</WizardExtension>
|
||||
<WizardData>
|
||||
<MinSupportedVersion>10.0.17763.0</MinSupportedVersion>
|
||||
<SkipXamlCompilerCheck>true</SkipXamlCompilerCheck>
|
||||
<UseWindowsSdkBuildToolsPackage>true</UseWindowsSdkBuildToolsPackage>
|
||||
<UseSdkFallbackFile>true</UseSdkFallbackFile>
|
||||
</WizardData>
|
||||
</VSTemplate>
|
||||
</VSTemplate>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="ProjectGroup">
|
||||
<TemplateData>
|
||||
<Name ID="1029" Package="FIXME-PACKAGEGUID" />
|
||||
|
@ -25,13 +25,18 @@
|
|||
</TemplateData>
|
||||
<TemplateContent PreferedSolutionConfiguration="Debug|x86">
|
||||
<CustomParameters>
|
||||
<CustomParameter Name="$WindowsAppSDKNupkgVersion$" Value="FIXME-Verify-Directory.Build.Targets-XmlPoke-Queries" />
|
||||
<CustomParameter Name="$WindowsSDKBuildToolsNupkgVersion$" Value="FIXME-Verify-Directory.Build.Targets-XmlPoke-Queries" />
|
||||
<CustomParameter Name="$DotNetVersion$" Value="FIXME-Verify-Directory.Build.Targets-XmlPoke-Queries"/>
|
||||
</CustomParameters>
|
||||
<ProjectCollection>
|
||||
<ProjectTemplateLink ProjectName="$projectname$ (Package)" CopyParameters="true">WapProj\WinUI.Desktop.Cs.WapProj.vstemplate</ProjectTemplateLink>
|
||||
<ProjectTemplateLink ProjectName="$projectname$" CopyParameters="true">BlankApp\WinUI.Desktop.Cs.BlankApp.vstemplate</ProjectTemplateLink>
|
||||
</ProjectCollection>
|
||||
<CustomParameters>
|
||||
<CustomParameter Name="$NuGetPackages$" Value="Microsoft.WindowsAppSDK;Microsoft.Windows.SDK.BuildTools"/>
|
||||
</CustomParameters>
|
||||
</TemplateContent>
|
||||
</VSTemplate>
|
||||
<WizardExtension>
|
||||
<Assembly>WindowsAppSDK.Cs.Extension.Dev17, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Assembly>
|
||||
<FullClassName>WindowsAppSDK.TemplateUtilities.NuGetPackageInstaller</FullClassName>
|
||||
</WizardExtension>
|
||||
</VSTemplate>
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="$WindowsSDKBuildToolsNupkgVersion$" />
|
||||
<Manifest Include="$(ApplicationManifest)" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project">
|
||||
<TemplateData>
|
||||
<Name ID="1033" Package="FIXME-PACKAGEGUID" />
|
||||
|
@ -49,7 +49,10 @@
|
|||
<ProjectItem ReplaceParameters="false" TargetFileName="StoreLogo.png">StoreLogo.png</ProjectItem>
|
||||
<ProjectItem ReplaceParameters="false" TargetFileName="Wide310x150Logo.scale-200.png">Wide310x150Logo.scale-200.png</ProjectItem>
|
||||
</Folder>
|
||||
</Project>
|
||||
</Project>
|
||||
<CustomParameters>
|
||||
<CustomParameter Name="$NuGetPackages$" Value="Microsoft.WindowsAppSDK;Microsoft.Windows.SDK.BuildTools"/>
|
||||
</CustomParameters>
|
||||
</TemplateContent>
|
||||
<WizardExtension>
|
||||
<!-- Generates Publisher name for appxmanifest -->
|
||||
|
@ -60,9 +63,4 @@
|
|||
<Assembly>WindowsAppSDK.Cs.Extension.Dev17, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Assembly>
|
||||
<FullClassName>WindowsAppSDK.TemplateUtilities.NuGetPackageInstaller</FullClassName>
|
||||
</WizardExtension>
|
||||
<WizardData>
|
||||
<packages>
|
||||
<package id="Microsoft.WindowsAppSDK" />
|
||||
</packages>
|
||||
</WizardData>
|
||||
</VSTemplate>
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
<ProjectItem ReplaceParameters="true" TargetFileName="MainWindow.xaml.h">MainWindow.h</ProjectItem>
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="readme.txt">readme.txt</ProjectItem>
|
||||
</Project>
|
||||
<CustomParameters>
|
||||
<CustomParameter Name="$NuGetPackages$" Value="Microsoft.WindowsAppSDK;Microsoft.Windows.CppWinRT;Microsoft.Windows.SDK.BuildTools;Microsoft.Windows.ImplementationLibrary"/>
|
||||
</CustomParameters>
|
||||
</TemplateContent>
|
||||
<WizardExtension>
|
||||
<Assembly>NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
|
||||
|
|
|
@ -76,15 +76,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="[$ext_WindowsAppSDKNupkgVersion$]">
|
||||
<IncludeAssets>build</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="[$ext_WindowsSDKBuildToolsNupkgVersion$]">
|
||||
<IncludeAssets>build</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<VSTemplate Version="3.0.0" Type="Project" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" xmlns:sdk="http://schemas.microsoft.com/developer/vstemplate-sdkextension/2010">
|
||||
<TemplateData>
|
||||
<Hidden>true</Hidden>
|
||||
|
@ -33,7 +33,10 @@
|
|||
<ProjectItem ReplaceParameters="false" TargetFileName="Images\Square44x44Logo.targetsize-24_altform-unplated.png">Square44x44Logo.targetsize-24_altform-unplated.png</ProjectItem>
|
||||
<ProjectItem ReplaceParameters="false" TargetFileName="Images\StoreLogo.png">StoreLogo.png</ProjectItem>
|
||||
<ProjectItem ReplaceParameters="false" TargetFileName="Images\Wide310x150Logo.scale-200.png">Wide310x150Logo.scale-200.png</ProjectItem>
|
||||
</Project>
|
||||
</Project>
|
||||
<CustomParameters>
|
||||
<CustomParameter Name="$NuGetPackages$" Value="Microsoft.WindowsAppSDK;Microsoft.Windows.SDK.BuildTools"/>
|
||||
</CustomParameters>
|
||||
</TemplateContent>
|
||||
<WizardExtension>
|
||||
<Assembly>Microsoft.VisualStudio.Universal.TemplateWizards, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
|
||||
|
@ -44,6 +47,10 @@
|
|||
<Assembly>Microsoft.VisualStudio.WinRT.TemplateWizards, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
|
||||
<FullClassName>Microsoft.VisualStudio.WinRT.TemplateWizards.UpdatePublisherInManifestWizard</FullClassName>
|
||||
</WizardExtension>
|
||||
<WizardExtension>
|
||||
<Assembly>WindowsAppSDK.Cpp.Extension.Dev17, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Assembly>
|
||||
<FullClassName>WindowsAppSDK.TemplateUtilities.Cpp.NuGetPackageInstaller</FullClassName>
|
||||
</WizardExtension>
|
||||
<WizardData>
|
||||
<MinSupportedVersion>10.0.17763.0</MinSupportedVersion>
|
||||
<SkipXamlCompilerCheck>true</SkipXamlCompilerCheck>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="ProjectGroup">
|
||||
<TemplateData>
|
||||
<Name ID="1025" Package="FIXME-PACKAGEGUID" />
|
||||
|
@ -32,6 +32,13 @@
|
|||
<ProjectCollection>
|
||||
<ProjectTemplateLink ProjectName="$projectname$ (Package)" CopyParameters="true">WapProj\WinUI.Desktop.CppWinRT.WapProj.vstemplate</ProjectTemplateLink>
|
||||
<ProjectTemplateLink ProjectName="$projectname$" CopyParameters="true">BlankApp\WinUI.Desktop.CppWinRT.BlankApp.vstemplate</ProjectTemplateLink>
|
||||
</ProjectCollection>
|
||||
</TemplateContent>
|
||||
</VSTemplate>
|
||||
</ProjectCollection>
|
||||
<CustomParameters>
|
||||
<CustomParameter Name="$NuGetPackages$" Value="Microsoft.WindowsAppSDK;Microsoft.Windows.SDK.BuildTools"/>
|
||||
</CustomParameters>
|
||||
</TemplateContent>
|
||||
<WizardExtension>
|
||||
<Assembly>WindowsAppSDK.Cpp.Extension.Dev17, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Assembly>
|
||||
<FullClassName>WindowsAppSDK.TemplateUtilities.Cpp.NuGetPackageInstaller</FullClassName>
|
||||
</WizardExtension>
|
||||
</VSTemplate>
|
||||
|
|
|
@ -47,6 +47,9 @@
|
|||
</Folder>
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="readme.txt">readme.txt</ProjectItem>
|
||||
</Project>
|
||||
<CustomParameters>
|
||||
<CustomParameter Name="$NuGetPackages$" Value="Microsoft.WindowsAppSDK;Microsoft.Windows.CppWinRT;Microsoft.Windows.SDK.BuildTools;Microsoft.Windows.ImplementationLibrary"/>
|
||||
</CustomParameters>
|
||||
</TemplateContent>
|
||||
<WizardExtension>
|
||||
<Assembly>NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
|
||||
|
|
Загрузка…
Ссылка в новой задаче