Integrate into latest v4
Sean Hall committed
Jan 19, 2019 at 13:03 UTC
985ba427f8cd12b7b74d62f83a8b304764e6077b
27 files changed
+588
-153
.editorconfig
new
+37
@@ -0,0 +1,37 @@
1
+# Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+#
3
+# Do NOT modify this file. Update the canonical version in Home\repo-template\src\.editorconfig
4
+# then update all of the repos.
5
+
6
+root = true
7
+
8
+[*]
9
+charset = utf-8
10
+indent_style = space
11
+indent_size = 4
12
+trim_trailing_whitespace = true
13
+
14
+[*.{cs,vb}]
15
+dotnet_sort_system_directives_first = true
16
+
17
+[*.cs]
18
+csharp_indent_case_contents = true : error
19
+csharp_indent_switch_labels = true : error
20
+csharp_new_line_before_open_brace = all
21
+csharp_prefer_braces = true : error
22
+csharp_style_expression_bodied_methods = when_on_single_line : suggestion
23
+csharp_style_expression_bodied_constructors = when_on_single_line : suggestion
24
+csharp_style_expression_bodied_operators = when_on_single_line : suggestion
25
+csharp_style_expression_bodied_properties = when_on_single_line : suggestion
26
+csharp_style_expression_bodied_indexers = when_on_single_line : suggestion
27
+csharp_style_expression_bodied_accessors = when_on_single_line : suggestion
28
+csharp_style_var_elsewhere = true : suggestion
29
+csharp_style_var_for_built_in_types = true : suggestion
30
+csharp_style_var_when_type_is_apparent = true : suggestion
31
+dotnet_style_qualification_for_event = true : error
32
+dotnet_style_qualification_for_field = true : error
33
+dotnet_style_qualification_for_method = true : error
34
+dotnet_style_qualification_for_property = true : error
35
+
36
+[*.targets]
37
+indent_size = 2
PowerShell.wixext.sln
new
+63
@@ -0,0 +1,63 @@
1
+
2
+Microsoft Visual Studio Solution File, Format Version 12.00
3
+# Visual Studio 15
4
+VisualStudioVersion = 15.0.27130.2003
5
+MinimumVisualStudioVersion = 15.0.26124.0
6
+Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "powershell", "src\wixlib\powershell.wixproj", "{9D4CCDFC-840C-4D4E-A9B0-3D6015480645}"
7
+EndProject
8
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.PowerShell.wixext", "src\wixext\WixToolset.PowerShell.wixext.csproj", "{6F1482DF-1598-4D88-BDAA-B9D0E0242139}"
9
+EndProject
10
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.PowerShell", "src\test\WixToolsetTest.PowerShell\WixToolsetTest.PowerShell.csproj", "{BFD10109-F4F3-4530-BE3B-802342D411F7}"
11
+EndProject
12
+Global
13
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
14
+ Debug|Any CPU = Debug|Any CPU
15
+ Debug|x64 = Debug|x64
16
+ Debug|x86 = Debug|x86
17
+ Release|Any CPU = Release|Any CPU
18
+ Release|x64 = Release|x64
19
+ Release|x86 = Release|x86
20
+ EndGlobalSection
21
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
22
+ {9D4CCDFC-840C-4D4E-A9B0-3D6015480645}.Debug|Any CPU.ActiveCfg = Debug|x86
23
+ {9D4CCDFC-840C-4D4E-A9B0-3D6015480645}.Debug|Any CPU.Build.0 = Debug|x86
24
+ {9D4CCDFC-840C-4D4E-A9B0-3D6015480645}.Debug|x64.ActiveCfg = Debug|x86
25
+ {9D4CCDFC-840C-4D4E-A9B0-3D6015480645}.Debug|x86.ActiveCfg = Debug|x86
26
+ {9D4CCDFC-840C-4D4E-A9B0-3D6015480645}.Debug|x86.Build.0 = Debug|x86
27
+ {9D4CCDFC-840C-4D4E-A9B0-3D6015480645}.Release|Any CPU.ActiveCfg = Release|x86
28
+ {9D4CCDFC-840C-4D4E-A9B0-3D6015480645}.Release|Any CPU.Build.0 = Release|x86
29
+ {9D4CCDFC-840C-4D4E-A9B0-3D6015480645}.Release|x64.ActiveCfg = Release|x86
30
+ {9D4CCDFC-840C-4D4E-A9B0-3D6015480645}.Release|x86.ActiveCfg = Release|x86
31
+ {9D4CCDFC-840C-4D4E-A9B0-3D6015480645}.Release|x86.Build.0 = Release|x86
32
+ {6F1482DF-1598-4D88-BDAA-B9D0E0242139}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33
+ {6F1482DF-1598-4D88-BDAA-B9D0E0242139}.Debug|Any CPU.Build.0 = Debug|Any CPU
34
+ {6F1482DF-1598-4D88-BDAA-B9D0E0242139}.Debug|x64.ActiveCfg = Debug|Any CPU
35
+ {6F1482DF-1598-4D88-BDAA-B9D0E0242139}.Debug|x64.Build.0 = Debug|Any CPU
36
+ {6F1482DF-1598-4D88-BDAA-B9D0E0242139}.Debug|x86.ActiveCfg = Debug|Any CPU
37
+ {6F1482DF-1598-4D88-BDAA-B9D0E0242139}.Debug|x86.Build.0 = Debug|Any CPU
38
+ {6F1482DF-1598-4D88-BDAA-B9D0E0242139}.Release|Any CPU.ActiveCfg = Release|Any CPU
39
+ {6F1482DF-1598-4D88-BDAA-B9D0E0242139}.Release|Any CPU.Build.0 = Release|Any CPU
40
+ {6F1482DF-1598-4D88-BDAA-B9D0E0242139}.Release|x64.ActiveCfg = Release|Any CPU
41
+ {6F1482DF-1598-4D88-BDAA-B9D0E0242139}.Release|x64.Build.0 = Release|Any CPU
42
+ {6F1482DF-1598-4D88-BDAA-B9D0E0242139}.Release|x86.ActiveCfg = Release|Any CPU
43
+ {6F1482DF-1598-4D88-BDAA-B9D0E0242139}.Release|x86.Build.0 = Release|Any CPU
44
+ {BFD10109-F4F3-4530-BE3B-802342D411F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45
+ {BFD10109-F4F3-4530-BE3B-802342D411F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
46
+ {BFD10109-F4F3-4530-BE3B-802342D411F7}.Debug|x64.ActiveCfg = Debug|Any CPU
47
+ {BFD10109-F4F3-4530-BE3B-802342D411F7}.Debug|x64.Build.0 = Debug|Any CPU
48
+ {BFD10109-F4F3-4530-BE3B-802342D411F7}.Debug|x86.ActiveCfg = Debug|Any CPU
49
+ {BFD10109-F4F3-4530-BE3B-802342D411F7}.Debug|x86.Build.0 = Debug|Any CPU
50
+ {BFD10109-F4F3-4530-BE3B-802342D411F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
51
+ {BFD10109-F4F3-4530-BE3B-802342D411F7}.Release|Any CPU.Build.0 = Release|Any CPU
52
+ {BFD10109-F4F3-4530-BE3B-802342D411F7}.Release|x64.ActiveCfg = Release|Any CPU
53
+ {BFD10109-F4F3-4530-BE3B-802342D411F7}.Release|x64.Build.0 = Release|Any CPU
54
+ {BFD10109-F4F3-4530-BE3B-802342D411F7}.Release|x86.ActiveCfg = Release|Any CPU
55
+ {BFD10109-F4F3-4530-BE3B-802342D411F7}.Release|x86.Build.0 = Release|Any CPU
56
+ EndGlobalSection
57
+ GlobalSection(SolutionProperties) = preSolution
58
+ HideSolutionNode = FALSE
59
+ EndGlobalSection
60
+ GlobalSection(ExtensibilityGlobals) = postSolution
61
+ SolutionGuid = {60A3EA0F-9313-47F8-BF6B-74478A57B577}
62
+ EndGlobalSection
63
+EndGlobal
appveyor.cmd
new
+13
@@ -0,0 +1,13 @@
1
+@setlocal
2
+@pushd %~dp0
3
+
4
+nuget restore
5
+
6
+msbuild -p:Configuration=Release -t:Restore
7
+
8
+msbuild -p:Configuration=Release src\test\WixToolsetTest.PowerShell\WixToolsetTest.PowerShell.csproj
9
+
10
+msbuild -p:Configuration=Release -t:Pack src\wixext\WixToolset.PowerShell.wixext.csproj
11
+
12
+@popd
13
+@endlocal
\ No newline at end of file
appveyor.yml
new
+40
@@ -0,0 +1,40 @@
1
+# Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+#
3
+# Do NOT modify this file. Update the canonical version in Home\repo-template\src\appveyor.yml
4
+# then update all of the repos.
5
+
6
+branches:
7
+ only:
8
+ - master
9
+ - develop
10
+
11
+image: Visual Studio 2017
12
+
13
+version: 0.0.0.{build}
14
+configuration: Release
15
+
16
+environment:
17
+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
18
+ DOTNET_CLI_TELEMETRY_OPTOUT: 1
19
+ NUGET_XMLDOC_MODE: skip
20
+
21
+build_script:
22
+ - appveyor.cmd
23
+
24
+pull_requests:
25
+ do_not_increment_build_number: true
26
+
27
+nuget:
28
+ disable_publish_on_pr: true
29
+
30
+skip_branch_with_pr: true
31
+skip_tags: true
32
+
33
+artifacts:
34
+- path: build\Release\**\*.nupkg
35
+ name: nuget
36
+
37
+notifications:
38
+- provider: Slack
39
+ incoming_webhook:
40
+ secure: p5xuu+4x2JHfwGDMDe5KcG1k7gZxqYc4jWVwvyNZv5cvkubPD2waJs5yXMAXZNN7Z63/3PWHb7q4KoY/99AjauYa1nZ4c5qYqRPFRBKTHfA=
nuget.config
new
+14
@@ -0,0 +1,14 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<configuration>
3
+ <packageSources>
4
+ <clear />
5
+ <add key="wixtoolset-data" value="https://ci.appveyor.com/nuget/wixtoolset-data" />
6
+ <add key="wixtoolset-extensibility" value="https://ci.appveyor.com/nuget/wixtoolset-extensibility" />
7
+ <add key="wixtoolset-core" value="https://ci.appveyor.com/nuget/wixtoolset-core" />
8
+ <add key="wixtoolset-core-native" value="https://ci.appveyor.com/nuget/wixtoolset-core-native" />
9
+ <add key="wixtoolset-dtf" value="https://ci.appveyor.com/nuget/wixtoolset-dtf" />
10
+ <add key="wixtoolset-tools" value="https://ci.appveyor.com/nuget/wixtoolset-tools" />
11
+ <add key="wixbuildtools" value="https://ci.appveyor.com/nuget/wixbuildtools" />
12
+ <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
13
+ </packageSources>
14
+</configuration>
\ No newline at end of file
src/Directory.Build.props
new
+26
@@ -0,0 +1,26 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
+<!--
4
+ Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.props
5
+ then update all of the repos.
6
+-->
7
+<Project>
8
+ <PropertyGroup>
9
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
10
+ <EnableSourceLink Condition=" '$(NCrunch)' == '1' ">false</EnableSourceLink>
11
+
12
+ <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName>
13
+ <BaseOutputPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\))</BaseOutputPath>
14
+ <BaseIntermediateOutputPath>$(BaseOutputPath)obj\$(ProjectName)\</BaseIntermediateOutputPath>
15
+ <OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath>
16
+
17
+ <Authors>WiX Toolset Team</Authors>
18
+ <Company>WiX Toolset</Company>
19
+ <Copyright>Copyright (c) .NET Foundation and contributors. All rights reserved.</Copyright>
20
+ <PackageLicenseExpression>MS-RL</PackageLicenseExpression>
21
+ <Product>WiX Toolset</Product>
22
+ </PropertyGroup>
23
+
24
+ <Import Project="Cpp.Build.props" Condition=" '$(MSBuildProjectExtension)'=='.vcxproj' " />
25
+ <Import Project="Custom.Build.props" Condition=" Exists('Custom.Build.props') " />
26
+</Project>
src/Directory.Build.targets
new
+48
@@ -0,0 +1,48 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
+<!--
4
+ Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.targets
5
+ then update all of the repos.
6
+-->
7
+<!--
8
+ Replace PackageReferences with ProjectReferences when the projects can be found in .sln.
9
+ See the original here: https://github.com/dotnet/sdk/issues/1151#issuecomment-385133284
10
+-->
11
+<Project>
12
+ <PropertyGroup>
13
+ <ReplacePackageReferences>true</ReplacePackageReferences>
14
+ <TheSolutionPath Condition=" '$(NCrunch)'=='' ">$(SolutionPath)</TheSolutionPath>
15
+ <TheSolutionPath Condition=" '$(NCrunch)'=='1' ">$(NCrunchOriginalSolutionPath)</TheSolutionPath>
16
+ </PropertyGroup>
17
+
18
+ <Choose>
19
+ <When Condition="$(ReplacePackageReferences) AND '$(TheSolutionPath)' != '' AND '$(TheSolutionPath)' != '*undefined*' AND Exists('$(TheSolutionPath)')">
20
+
21
+ <PropertyGroup>
22
+ <SolutionFileContent>$([System.IO.File]::ReadAllText($(TheSolutionPath)))</SolutionFileContent>
23
+ <SmartSolutionDir>$([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) ))</SmartSolutionDir>
24
+ <RegexPattern>(?<="[PackageName]", ")(.*)(?=", ")</RegexPattern>
25
+ </PropertyGroup>
26
+
27
+ <ItemGroup>
28
+ <!-- Keep the identity of the PackageReference -->
29
+ <SmartPackageReference Include="@(PackageReference)">
30
+ <PackageName>%(Identity)</PackageName>
31
+ <InSolution>$(SolutionFileContent.Contains('\%(Identity).csproj'))</InSolution>
32
+ </SmartPackageReference>
33
+
34
+ <!-- Filter them by mapping them to another ItemGroup using the WithMetadataValue item function -->
35
+ <PackageInSolution Include="@(SmartPackageReference->WithMetadataValue('InSolution', True))">
36
+ <Pattern>$(RegexPattern.Replace('[PackageName]','%(PackageName)') )</Pattern>
37
+ <SmartPath>$([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)'))</SmartPath>
38
+ </PackageInSolution>
39
+
40
+ <ProjectReference Include="@(PackageInSolution->'$(SmartSolutionDir)\%(SmartPath)' )"/>
41
+
42
+ <!-- Remove the package references that are now referenced as projects -->
43
+ <PackageReference Remove="@(PackageInSolution->'%(PackageName)' )"/>
44
+ </ItemGroup>
45
+
46
+ </When>
47
+ </Choose>
48
+</Project>
src/FindLocalWix.props
new
+8
@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
+
4
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5
+ <PropertyGroup>
6
+ <WixTargetsPath Condition=" '$(Configuration)' == 'Debug' And Exists('$(MSBuildThisFileDirectory)..\..\Tools\README.md') ">$(MSBuildThisFileDirectory)..\..\Tools\build\Debug\net461\wix.targets</WixTargetsPath>
7
+ </PropertyGroup>
8
+</Project>
src/test/WixToolsetTest.PowerShell/PowerShellExtensionFixture.cs
new
+26
@@ -0,0 +1,26 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolsetTest.PowerShell
4
+{
5
+ using WixBuildTools.TestSupport;
6
+ using WixToolset.Core.TestPackage;
7
+ using WixToolset.PowerShell;
8
+ using Xunit;
9
+
10
+ public class PowerShellExtensionFixture
11
+ {
12
+ [Fact]
13
+ public void CantBuildUsingTypesFileWithoutSnapIn()
14
+ {
15
+ var folder = TestData.Get(@"TestData\TypesFile");
16
+ var build = new Builder(folder, typeof(PowerShellExtensionFactory), new[] { folder });
17
+
18
+ WixRunnerResult wixRunnerResult = null;
19
+ var results = build.BuildAndQuery(args => {
20
+ wixRunnerResult = WixRunner.Execute(args);
21
+ });
22
+ Assert.NotNull(wixRunnerResult);
23
+ Assert.Equal((int)PSErrors.Ids.NeitherIdSpecified, wixRunnerResult.ExitCode);
24
+ }
25
+ }
26
+}
src/test/WixToolsetTest.PowerShell/TestData/TypesFile/Package.en-us.wxl
new
+11
@@ -0,0 +1,11 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+
3
+<!--
4
+This file contains the declaration of all the localizable strings.
5
+-->
6
+<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">
7
+
8
+ <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String>
9
+ <String Id="FeatureTitle">MsiPackage</String>
10
+
11
+</WixLocalization>
src/test/WixToolsetTest.PowerShell/TestData/TypesFile/Package.wxs
new
+21
@@ -0,0 +1,21 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3
+ <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
4
+ <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" />
5
+
6
+ <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
7
+ <MediaTemplate />
8
+
9
+ <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)">
10
+ <ComponentGroupRef Id="ProductComponents" />
11
+ </Feature>
12
+ </Product>
13
+
14
+ <Fragment>
15
+ <Directory Id="TARGETDIR" Name="SourceDir">
16
+ <Directory Id="ProgramFilesFolder">
17
+ <Directory Id="INSTALLFOLDER" Name="MsiPackage" />
18
+ </Directory>
19
+ </Directory>
20
+ </Fragment>
21
+</Wix>
src/test/WixToolsetTest.PowerShell/TestData/TypesFile/PackageComponents.wxs
new
+13
@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3
+ xmlns:powershell="http://wixtoolset.org/schemas/v4/wxs/powershell">
4
+ <Fragment>
5
+ <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
6
+ <Component>
7
+ <File Source="example.txt">
8
+ <powershell:TypesFile />
9
+ </File>
10
+ </Component>
11
+ </ComponentGroup>
12
+ </Fragment>
13
+</Wix>
src/test/WixToolsetTest.PowerShell/TestData/TypesFile/example.txt
new
+1
@@ -0,0 +1 @@
1
+This is example.txt.
\ No newline at end of file
src/test/WixToolsetTest.PowerShell/WixToolsetTest.Powershell.csproj
new
+38
@@ -0,0 +1,38 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
+
4
+<Project Sdk="Microsoft.NET.Sdk">
5
+ <PropertyGroup>
6
+ <TargetFramework>netcoreapp2.1</TargetFramework>
7
+ <IsPackable>false</IsPackable>
8
+ </PropertyGroup>
9
+
10
+ <PropertyGroup>
11
+ <NoWarn>NU1701</NoWarn>
12
+ </PropertyGroup>
13
+
14
+ <ItemGroup>
15
+ <Content Include="TestData\TypesFile\example.txt" CopyToOutputDirectory="PreserveNewest" />
16
+ <Content Include="TestData\TypesFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
17
+ <Content Include="TestData\TypesFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
18
+ <Content Include="TestData\TypesFile\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
19
+ </ItemGroup>
20
+
21
+ <ItemGroup>
22
+ <ProjectReference Include="..\..\wixext\WixToolset.Powershell.wixext.csproj" />
23
+ </ItemGroup>
24
+
25
+ <ItemGroup>
26
+ <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" PrivateAssets="all" />
27
+ </ItemGroup>
28
+
29
+ <ItemGroup>
30
+ <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" />
31
+ </ItemGroup>
32
+
33
+ <ItemGroup>
34
+ <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
35
+ <PackageReference Include="xunit" Version="2.4.0" />
36
+ <PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
37
+ </ItemGroup>
38
+</Project>
src/wixext/PSCompiler.cs
+50
-56
@@ -1,30 +1,24 @@
1
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3
-namespace WixToolset.Extensions
3
+namespace WixToolset.PowerShell
4
{
5
using System;
6
using System.Collections.Generic;
7
using System.Globalization;
8
using System.Xml.Linq;
9
using WixToolset.Data;
10
- using WixToolset.Data.Rows;
10
+ using WixToolset.Data.Tuples;
11
using WixToolset.Extensibility;
12
13
/// <summary>
14
- /// The compiler for the WiX Toolset Internet Information Services Extension.
14
+ /// The compiler for the WiX Toolset PowerShell Extension.
15
/// </summary>
16
- public sealed class PSCompiler : CompilerExtension
16
+ public sealed class PSCompiler : BaseCompilerExtension
17
{
18
private const string KeyFormat = @"SOFTWARE\Microsoft\PowerShell\{0}\PowerShellSnapIns\{1}";
19
private const string VarPrefix = "PSVersionMajor";
20
21
- /// <summary>
22
- /// Instantiate a new PSCompiler.
23
- /// </summary>
24
- public PSCompiler()
25
- {
26
- this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/powershell";
27
- }
21
+ public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/powershell";
22
23
/// <summary>
24
/// Processes an element for the Compiler.
@@ -33,7 +27,7 @@ namespace WixToolset.Extensions
27
/// <param name="parentElement">Parent element of element to process.</param>
28
/// <param name="element">Element to process.</param>
29
/// <param name="contextValues">Extra information about the context in which this element is being parsed.</param>
36
- public override void ParseElement(XElement parentElement, XElement element, IDictionary<string, string> context)
30
+ public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context)
31
{
32
switch (parentElement.Name.LocalName)
33
{
@@ -44,25 +38,25 @@ namespace WixToolset.Extensions
38
switch (element.Name.LocalName)
39
{
40
case "FormatsFile":
47
- this.ParseExtensionsFile(element, "Formats", fileId, componentId);
41
+ this.ParseExtensionsFile(intermediate, section, element, "Formats", fileId, componentId);
42
break;
43
44
case "SnapIn":
51
- this.ParseSnapInElement(element, fileId, componentId);
45
+ this.ParseSnapInElement(intermediate, section, element, fileId, componentId);
46
break;
47
48
case "TypesFile":
55
- this.ParseExtensionsFile(element, "Types", fileId, componentId);
49
+ this.ParseExtensionsFile(intermediate, section, element, "Types", fileId, componentId);
50
break;
51
52
default:
59
- this.Core.UnexpectedElement(parentElement, element);
53
+ this.ParseHelper.UnexpectedElement(parentElement, element);
54
break;
55
}
56
break;
57
58
default:
65
- this.Core.UnexpectedElement(parentElement, element);
59
+ this.ParseHelper.UnexpectedElement(parentElement, element);
60
break;
61
}
62
}
@@ -73,9 +67,9 @@ namespace WixToolset.Extensions
67
/// <param name="node">Element to parse.</param>
68
/// <param name="fileId">Identifier for parent file.</param>
69
/// <param name="componentId">Identifier for parent component.</param>
76
- private void ParseSnapInElement(XElement node, string fileId, string componentId)
70
+ private void ParseSnapInElement(Intermediate intermediate, IntermediateSection section, XElement node, string fileId, string componentId)
71
{
78
- SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
72
+ SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
73
string id = null;
74
string assemblyName = null;
75
string customSnapInType = null;
@@ -93,52 +87,52 @@ namespace WixToolset.Extensions
87
switch (attrib.Name.LocalName)
88
{
89
case "Id":
96
- id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
90
+ id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
91
break;
92
93
case "CustomSnapInType":
100
- customSnapInType = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
94
+ customSnapInType = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
95
break;
96
97
case "Description":
104
- description = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
98
+ description = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
99
break;
100
101
case "DescriptionIndirect":
108
- descriptionIndirect = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
102
+ descriptionIndirect = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
103
break;
104
105
case "RequiredPowerShellVersion":
112
- string ver = this.Core.GetAttributeVersionValue(sourceLineNumbers, attrib);
106
+ string ver = this.ParseHelper.GetAttributeVersionValue(sourceLineNumbers, attrib);
107
requiredPowerShellVersion = new Version(ver);
108
break;
109
110
case "Vendor":
117
- vendor = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
111
+ vendor = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
112
break;
113
114
case "VendorIndirect":
121
- vendorIndirect = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
115
+ vendorIndirect = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
116
break;
117
118
case "Version":
125
- version = this.Core.GetAttributeVersionValue(sourceLineNumbers, attrib);
119
+ version = this.ParseHelper.GetAttributeVersionValue(sourceLineNumbers, attrib);
120
break;
121
122
default:
129
- this.Core.UnexpectedAttribute(node, attrib);
123
+ this.ParseHelper.UnexpectedAttribute(node, attrib);
124
break;
125
}
126
}
127
else
128
{
135
- this.Core.ParseExtensionAttribute(node, attrib);
129
+ this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
130
}
131
}
132
133
if (null == id)
134
{
141
- this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id"));
135
+ this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id"));
136
}
137
138
// Default to require PowerShell 1.0.
@@ -161,19 +155,19 @@ namespace WixToolset.Extensions
155
switch (child.Name.LocalName)
156
{
157
case "FormatsFile":
164
- this.ParseExtensionsFile(child, "Formats", id, componentId);
158
+ this.ParseExtensionsFile(intermediate, section, child, "Formats", id, componentId);
159
break;
160
case "TypesFile":
167
- this.ParseExtensionsFile(child, "Types", id, componentId);
161
+ this.ParseExtensionsFile(intermediate, section, child, "Types", id, componentId);
162
break;
163
default:
170
- this.Core.UnexpectedElement(node, child);
164
+ this.ParseHelper.UnexpectedElement(node, child);
165
break;
166
}
167
}
168
else
169
{
176
- this.Core.ParseExtensionElement(node, child);
170
+ this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, node, child);
171
}
172
}
173
@@ -182,54 +176,54 @@ namespace WixToolset.Extensions
176
// for use in Formats and Types files. PowerShell v2 still uses 1.
177
int major = (2 == requiredPowerShellVersion.Major) ? 1 : requiredPowerShellVersion.Major;
178
185
- WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable");
186
- wixVariableRow.Id = String.Format(CultureInfo.InvariantCulture, "{0}_{1}", VarPrefix, id);
179
+ var variableId = new Identifier(AccessModifier.Public, String.Format(CultureInfo.InvariantCulture, "{0}_{1}", VarPrefix, id));
180
+ var wixVariableRow = (WixVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixVariable", variableId);
181
wixVariableRow.Value = major.ToString(CultureInfo.InvariantCulture);
182
wixVariableRow.Overridable = false;
183
184
int registryRoot = 2; // HKLM
185
string registryKey = String.Format(CultureInfo.InvariantCulture, KeyFormat, major, id);
186
193
- this.Core.CreateRegistryRow(sourceLineNumbers, registryRoot, registryKey, "ApplicationBase", String.Format(CultureInfo.InvariantCulture, "[${0}]", componentId), componentId, false);
187
+ this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, registryKey, "ApplicationBase", String.Format(CultureInfo.InvariantCulture, "[${0}]", componentId), componentId, false);
188
189
// set the assembly name automatically when binding.
190
// processorArchitecture is not handled correctly by PowerShell v1.0
191
// so format the assembly name explicitly.
192
assemblyName = String.Format(CultureInfo.InvariantCulture, "!(bind.assemblyName.{0}), Version=!(bind.assemblyVersion.{0}), Culture=!(bind.assemblyCulture.{0}), PublicKeyToken=!(bind.assemblyPublicKeyToken.{0})", fileId);
199
- this.Core.CreateRegistryRow(sourceLineNumbers, registryRoot, registryKey, "AssemblyName", assemblyName, componentId, false);
193
+ this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, registryKey, "AssemblyName", assemblyName, componentId, false);
194
195
if (null != customSnapInType)
196
{
203
- this.Core.CreateRegistryRow(sourceLineNumbers, registryRoot, registryKey, "CustomPSSnapInType", customSnapInType, componentId, false);
197
+ this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, registryKey, "CustomPSSnapInType", customSnapInType, componentId, false);
198
}
199
200
if (null != description)
201
{
208
- this.Core.CreateRegistryRow(sourceLineNumbers, registryRoot, registryKey, "Description", description, componentId, false);
202
+ this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, registryKey, "Description", description, componentId, false);
203
}
204
205
if (null != descriptionIndirect)
206
{
213
- this.Core.CreateRegistryRow(sourceLineNumbers, registryRoot, registryKey, "DescriptionIndirect", descriptionIndirect, componentId, false);
207
+ this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, registryKey, "DescriptionIndirect", descriptionIndirect, componentId, false);
208
}
209
216
- this.Core.CreateRegistryRow(sourceLineNumbers, registryRoot, registryKey, "ModuleName", String.Format(CultureInfo.InvariantCulture, "[#{0}]", fileId), componentId, false);
210
+ this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, registryKey, "ModuleName", String.Format(CultureInfo.InvariantCulture, "[#{0}]", fileId), componentId, false);
211
218
- this.Core.CreateRegistryRow(sourceLineNumbers, registryRoot, registryKey, "PowerShellVersion", requiredPowerShellVersion.ToString(2), componentId, false);
212
+ this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, registryKey, "PowerShellVersion", requiredPowerShellVersion.ToString(2), componentId, false);
213
214
if (null != vendor)
215
{
222
- this.Core.CreateRegistryRow(sourceLineNumbers, registryRoot, registryKey, "Vendor", vendor, componentId, false);
216
+ this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, registryKey, "Vendor", vendor, componentId, false);
217
}
218
219
if (null != vendorIndirect)
220
{
227
- this.Core.CreateRegistryRow(sourceLineNumbers, registryRoot, registryKey, "VendorIndirect", vendorIndirect, componentId, false);
221
+ this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, registryKey, "VendorIndirect", vendorIndirect, componentId, false);
222
}
223
224
if (null != version)
225
{
232
- this.Core.CreateRegistryRow(sourceLineNumbers, registryRoot, registryKey, "Version", version, componentId, false);
226
+ this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, registryKey, "Version", version, componentId, false);
227
}
228
}
229
@@ -240,9 +234,9 @@ namespace WixToolset.Extensions
234
/// <param name="valueName">Registry value name.</param>
235
/// <param name="id">Idendifier for parent file or snap-in.</param>
236
/// <param name="componentId">Identifier for parent component.</param>
243
- private void ParseExtensionsFile(XElement node, string valueName, string id, string componentId)
237
+ private void ParseExtensionsFile(Intermediate intermediate, IntermediateSection section, XElement node, string valueName, string id, string componentId)
238
{
245
- SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
239
+ SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
240
string fileId = null;
241
string snapIn = null;
242
@@ -253,38 +247,38 @@ namespace WixToolset.Extensions
247
switch (attrib.Name.LocalName)
248
{
249
case "FileId":
256
- fileId = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
250
+ fileId = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
251
snapIn = id;
252
break;
253
254
case "SnapIn":
255
fileId = id;
262
- snapIn = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
256
+ snapIn = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
257
break;
258
259
default:
266
- this.Core.UnexpectedAttribute(node, attrib);
260
+ this.ParseHelper.UnexpectedAttribute(node, attrib);
261
break;
262
}
263
}
264
else
265
{
272
- this.Core.ParseExtensionAttribute(node, attrib);
266
+ this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
267
}
268
}
269
270
if (null == fileId && null == snapIn)
271
{
278
- this.Core.OnMessage(PSErrors.NeitherIdSpecified(sourceLineNumbers, valueName));
272
+ this.Messaging.Write(PSErrors.NeitherIdSpecified(sourceLineNumbers, valueName));
273
}
274
281
- this.Core.ParseForExtensionElements(node);
275
+ this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
276
277
int registryRoot = 2; // HKLM
278
string registryKey = String.Format(CultureInfo.InvariantCulture, KeyFormat, String.Format(CultureInfo.InvariantCulture, "!(wix.{0}_{1})", VarPrefix, snapIn), snapIn);
279
286
- this.Core.CreateSimpleReference(sourceLineNumbers, "File", fileId);
287
- this.Core.CreateRegistryRow(sourceLineNumbers, registryRoot, registryKey, valueName, String.Format(CultureInfo.InvariantCulture, "[~][#{0}]", fileId), componentId, false);
280
+ this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "File", fileId);
281
+ this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, registryKey, valueName, String.Format(CultureInfo.InvariantCulture, "[~][#{0}]", fileId), componentId, false);
282
}
283
}
284
}
src/wixext/PSErrors.cs
new
+30
@@ -0,0 +1,30 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.PowerShell
4
+{
5
+ using System.Resources;
6
+ using WixToolset.Data;
7
+
8
+ public static class PSErrors
9
+ {
10
+ public static Message NeitherIdSpecified(SourceLineNumber sourceLineNumbers, string element)
11
+ {
12
+ return Message(sourceLineNumbers, Ids.NeitherIdSpecified, "Either the {0}/@FileId attribute must be specified if nested under a SnapIn element, or the {0}/@SnapIn attribute must be specified if nested under under a File element.", element);
13
+ }
14
+
15
+ private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
16
+ {
17
+ return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
18
+ }
19
+
20
+ private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
21
+ {
22
+ return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args);
23
+ }
24
+
25
+ public enum Ids
26
+ {
27
+ NeitherIdSpecified = 5301,
28
+ }
29
+ }
30
+}
src/wixext/PSExtensionData.cs
+11
-15
@@ -1,34 +1,30 @@
1
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3
-namespace WixToolset.Extensions
3
+namespace WixToolset.PowerShell
4
{
5
- using System;
6
- using System.Reflection;
5
using WixToolset.Data;
6
using WixToolset.Extensibility;
7
8
/// <summary>
9
/// The WiX Toolset PowerShell Extension.
10
/// </summary>
13
- public sealed class PSExtensionData : ExtensionData
11
+ public sealed class PSExtensionData : BaseExtensionData
12
{
13
/// <summary>
16
- /// Gets the library associated with this extension.
14
+ /// Gets the default culture.
15
/// </summary>
18
- /// <param name="tableDefinitions">The table definitions to use while loading the library.</param>
19
- /// <returns>The loaded library.</returns>
20
- public override Library GetLibrary(TableDefinitionCollection tableDefinitions)
16
+ /// <value>The default culture.</value>
17
+ public override string DefaultCulture => "en-US";
18
+
19
+ public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition)
20
{
22
- return PSExtensionData.GetExtensionLibrary(tableDefinitions);
21
+ tupleDefinition = null;
22
+ return tupleDefinition != null;
23
}
24
25
- /// <summary>
26
- /// Internal mechanism to access the extension's library.
27
- /// </summary>
28
- /// <returns>Extension's library.</returns>
29
- internal static Library GetExtensionLibrary(TableDefinitionCollection tableDefinitions)
25
+ public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions)
26
{
31
- return ExtensionData.LoadLibraryHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.ps.wixlib", tableDefinitions);
27
+ return Intermediate.Load(typeof(PSExtensionData).Assembly, "WixToolset.PowerShell.powershell.wixlib", tupleDefinitions);
28
}
29
}
30
}
src/wixext/PSWarnings.cs
new
+30
@@ -0,0 +1,30 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.PowerShell
4
+{
5
+ using System.Resources;
6
+ using WixToolset.Data;
7
+
8
+ public static class PSWarnings
9
+ {
10
+ public static Message DeprecatedAssemblyNameAttribute(SourceLineNumber sourceLineNumbers)
11
+ {
12
+ return Message(sourceLineNumbers, Ids.DeprecatedAssemblyNameAttribute, "The SnapIn/@AssemblyName attribute is deprecated. It is assigned automatically.");
13
+ }
14
+
15
+ private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
16
+ {
17
+ return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args);
18
+ }
19
+
20
+ private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
21
+ {
22
+ return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, resourceManager, resourceName, args);
23
+ }
24
+
25
+ public enum Ids
26
+ {
27
+ DeprecatedAssemblyNameAttribute = 5350,
28
+ }
29
+ }
30
+}
src/wixext/PowerShellExtensionFactory.cs
new
+17
@@ -0,0 +1,17 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.PowerShell
4
+{
5
+ using System;
6
+ using System.Collections.Generic;
7
+ using WixToolset.Extensibility;
8
+
9
+ public class PowerShellExtensionFactory : BaseExtensionFactory
10
+ {
11
+ protected override IEnumerable<Type> ExtensionTypes => new[]
12
+ {
13
+ typeof(PSCompiler),
14
+ typeof(PSExtensionData),
15
+ };
16
+ }
17
+}
src/wixext/WixPSExtension.csproj
deleted
-43
@@ -1,43 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
-
4
-
5
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
6
- <PropertyGroup>
7
- <ProjectGuid>{6F1482DF-1598-4D88-BDAA-B9D0E0242139}</ProjectGuid>
8
- <AssemblyName>WixPSExtension</AssemblyName>
9
- <OutputType>Library</OutputType>
10
- <RootNamespace>WixToolset.Extensions</RootNamespace>
11
- </PropertyGroup>
12
- <ItemGroup>
13
- <Compile Include="AssemblyInfo.cs" />
14
- <Compile Include="PSCompiler.cs" />
15
- <Compile Include="PSExtensionData.cs" />
16
- <MsgGenSource Include="Data\messages.xml">
17
- <ResourcesLogicalName>$(RootNamespace).Data.Messages.resources</ResourcesLogicalName>
18
- </MsgGenSource>
19
- <EmbeddedFlattenedResource Include="Xsd\ps.xsd">
20
- <LogicalName>$(RootNamespace).Xsd.ps.xsd</LogicalName>
21
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
22
- </EmbeddedFlattenedResource>
23
- <XsdGenSource Include="Xsd\ps.xsd">
24
- <CommonNamespace>WixToolset.Data.Serialize</CommonNamespace>
25
- <Namespace>WixToolset.Extensions.Serialize.PS</Namespace>
26
- </XsdGenSource>
27
- <EmbeddedResource Include="$(OutputPath)\ps.wixlib">
28
- <Link>Data\ps.wixlib</Link>
29
- </EmbeddedResource>
30
- </ItemGroup>
31
- <ItemGroup>
32
- <Reference Include="System" />
33
- <Reference Include="System.Xml" />
34
- <ProjectReference Include="..\..\..\libs\WixToolset.Data\WixToolset.Data.csproj" />
35
- <ProjectReference Include="..\..\..\libs\WixToolset.Extensibility\WixToolset.Extensibility.csproj" />
36
- <ProjectReference Include="..\..\..\tools\wix\Wix.csproj" />
37
- <ProjectReference Include="..\wixlib\PSExtension.wixproj">
38
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
39
- </ProjectReference>
40
- <Reference Include="System.Xml.Linq" />
41
- </ItemGroup>
42
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
43
-</Project>
src/wixext/WixToolset.PowerShell.wixext.csproj
new
+29
@@ -0,0 +1,29 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
+
4
+<Project Sdk="Microsoft.NET.Sdk">
5
+ <PropertyGroup>
6
+ <TargetFramework>netstandard2.0</TargetFramework>
7
+ <RootNamespace>WixToolset.PowerShell</RootNamespace>
8
+ <Description>WiX Toolset PowerShell Extension</Description>
9
+ <Title>WiX Toolset PowerShell Extension</Title>
10
+ <IsTool>true</IsTool>
11
+ <ContentTargetFolders>build</ContentTargetFolders>
12
+ </PropertyGroup>
13
+ <ItemGroup>
14
+ <Content Include="$(MSBuildThisFileName).targets" />
15
+ <Content Include="ps.xsd" PackagePath="tools" />
16
+ <EmbeddedResource Include="$(OutputPath)..\powershell.wixlib" />
17
+ </ItemGroup>
18
+ <ItemGroup>
19
+ <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" PrivateAssets="all" />
20
+ </ItemGroup>
21
+
22
+ <ItemGroup>
23
+ <ProjectReference Include="..\wixlib\powershell.wixproj" ReferenceOutputAssembly="false" Condition=" '$(NCrunch)'=='' " />
24
+ </ItemGroup>
25
+
26
+ <ItemGroup>
27
+ <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" />
28
+ </ItemGroup>
29
+</Project>
src/wixext/WixToolset.PowerShell.wixext.targets
new
+11
@@ -0,0 +1,11 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
+
4
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
5
+ <PropertyGroup>
6
+ <WixToolsetPowerShellWixextPath Condition=" '$(WixToolsetPowerShellWixextPath)' == '' ">$(MSBuildThisFileDirectory)..\tools\WixToolset.PowerShell.wixext.dll</WixToolsetPowerShellWixextPath>
7
+ </PropertyGroup>
8
+ <ItemGroup>
9
+ <WixExtension Include="$(WixToolsetPowerShellWixextPath)" />
10
+ </ItemGroup>
11
+</Project>
src/wixext/messages.xml
deleted
-20
@@ -1,20 +0,0 @@
1
-<?xml version='1.0' encoding='utf-8'?>
2
-<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
-
4
-
5
-<Messages Namespace="WixToolset.Extensions" Resources="Data.Messages" xmlns="http://schemas.microsoft.com/genmsgs/2004/07/messages">
6
- <Class Name="PSErrors" ContainerName="PSErrorEventArgs" BaseContainerName="WixErrorEventArgs">
7
- <Message Id="NeitherIdSpecified" Number="5301">
8
- <Instance>Either the {0}/@FileId attribute must be specified if nested under a SnapIn element, or the {0}/@SnapIn attribute must be specified if nested under under a File element.
9
- <Parameter Type="System.String" Name="element" />
10
- </Instance>
11
- </Message>
12
- </Class>
13
- <Class Name="PSWarnings" ContainerName="PSWarningEventArgs" BaseContainerName="WixWarningEventArgs">
14
- <Message Id="DeprecatedAssemblyNameAttribute" Number="5350">
15
- <Instance>The SnapIn/@AssemblyName attribute is deprecated. It is assigned automatically.</Instance>
16
- </Message>
17
- </Class>
18
- <Class Name="PSVerboses" ContainerName="PSVerboseEventArgs" BaseContainerName="WixVerboseEventArgs">
19
- </Class>
20
-</Messages>
src/wixlib/PSExtension.wixproj
deleted
-19
@@ -1,19 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8" ?>
2
-<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
-
4
-
5
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
6
- <PropertyGroup>
7
- <ProjectGuid>{9d4ccdfc-840c-4d4e-a9b0-3d6015480645}</ProjectGuid>
8
- <OutputName>ps</OutputName>
9
- <OutputType>Library</OutputType>
10
- <BindFiles>true</BindFiles>
11
- <Pedantic>true</Pedantic>
12
- </PropertyGroup>
13
-
14
- <ItemGroup>
15
- <Compile Include="PSExtension.wxs" />
16
- </ItemGroup>
17
-
18
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
19
-</Project>
src/wixlib/packages.config
new
+5
@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<packages>
3
+ <package id="Nerdbank.GitVersioning" version="2.1.65" developmentDependency="true" targetFramework="net40" />
4
+ <package id="WixToolset.MSBuild" version="4.0.0-build-0035" developmentDependency="true" targetFramework="net40" />
5
+</packages>
\ No newline at end of file
src/wixlib/powershell.wixproj
new
+35
@@ -0,0 +1,35 @@
1
+<?xml version="1.0" encoding="utf-8" ?>
2
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
+<Project DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
4
+ <Import Project="..\..\packages\WixToolset.MSBuild.4.0.0-build-0035\build\WixToolset.MSBuild.props" Condition="Exists('..\..\packages\WixToolset.MSBuild.4.0.0-build-0035\build\WixToolset.MSBuild.props')" />
5
+ <Import Project="..\FindLocalWix.props" />
6
+ <PropertyGroup>
7
+ <ProjectGuid>{9d4ccdfc-840c-4d4e-a9b0-3d6015480645}</ProjectGuid>
8
+ <OutputName>powershell</OutputName>
9
+ <OutputType>Library</OutputType>
10
+ <BindFiles>true</BindFiles>
11
+ <Pedantic>true</Pedantic>
12
+ </PropertyGroup>
13
+
14
+ <ItemGroup>
15
+ <Compile Include="PSExtension.wxs" />
16
+ </ItemGroup>
17
+
18
+ <ItemGroup>
19
+ <None Include="packages.config" />
20
+ </ItemGroup>
21
+
22
+ <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' AND Exists('$(WixTargetsPath)') " />
23
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets') " />
24
+ <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
25
+ <Error Text="WiX Toolset build tools (v4.0 or later) must be installed to build this project. To download the WiX Toolset, go to http://wixtoolset.org/releases/." />
26
+ </Target>
27
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
28
+ <PropertyGroup>
29
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
30
+ </PropertyGroup>
31
+ <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
32
+ <Error Condition="!Exists('..\..\packages\WixToolset.MSBuild.4.0.0-build-0035\build\WixToolset.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.MSBuild.4.0.0-build-0035\build\WixToolset.MSBuild.props'))" />
33
+ </Target>
34
+ <Import Project="..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" />
35
+</Project>
version.json
new
+11
@@ -0,0 +1,11 @@
1
+{
2
+ "version": "4.0",
3
+ "publicReleaseRefSpec": [
4
+ "^refs/heads/master$"
5
+ ],
6
+ "cloudBuild": {
7
+ "buildNumber": {
8
+ "enabled": true
9
+ }
10
+ }
11
+}