@joebigelow / wix / commits / 10794363

VSExtension cleanup:

- Add ARM64-specific custom action. - Remove "naked" `CustomActionRef`s. - Clean up `wix convert` behavior: - Remove `PropertyRef`s for properties CA always sets. Fixes https://github.com/wixtoolset/issues/issues/7100. Fixes https://github.com/wixtoolset/issues/issues/7153.

Bob Arnson committed Jan 11, 2023 at 20:14 UTC 10794363b90e49885ace5729bb45af4da5d0f220
11 files changed +88 -48
src/ext/VisualStudio/ca/vsca.vcxproj
+8
@@ -19,6 +19,14 @@
19 <Configuration>Release</Configuration>
20 <Platform>x64</Platform>
21 </ProjectConfiguration>
22 + <ProjectConfiguration Include="Debug|ARM64">
23 + <Configuration>Debug</Configuration>
24 + <Platform>ARM64</Platform>
25 + </ProjectConfiguration>
26 + <ProjectConfiguration Include="Release|ARM64">
27 + <Configuration>Release</Configuration>
28 + <Platform>ARM64</Platform>
29 + </ProjectConfiguration>
30 </ItemGroup>
31
32 <PropertyGroup Label="Globals">
src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/TestData/UsingVsixPackage/Package.wxs
+2 -1
@@ -1,9 +1,10 @@
1 -<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:vs="http://wixtoolset.org/schemas/v4/wxs/vs">
1 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:vs="http://wixtoolset.org/schemas/v4/wxs/vs">
2 <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
3 <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
4
5 <vs:FindVisualStudio />
6 <PropertyRef Id="VS2017DEVENV" />
7 + <PropertyRef Id="VS2019_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED" />
8 <PropertyRef Id="VS2022_ROOT_FOLDER" />
9
10 <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)">
src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs
+37
@@ -6,6 +6,7 @@ namespace WixToolsetTest.VisualStudio
6 using WixInternal.Core.TestPackage;
7 using WixToolset.VisualStudio;
8 using Xunit;
9 + using System.Linq;
10
11 public class VisualStudioExtensionFixture
12 {
@@ -35,10 +36,46 @@ namespace WixToolsetTest.VisualStudio
36 }, results);
37 }
38
39 + [Fact]
40 + public void CanBuildUsingVsixPackageOnArm64()
41 + {
42 + var folder = TestData.Get(@"TestData\UsingVsixPackage");
43 + var build = new Builder(folder, typeof(VSExtensionFactory), new[] { folder });
44 +
45 + var results = build.BuildAndQuery(BuildARM64, "CustomAction");
46 + WixAssert.CompareLineByLine(new[]
47 + {
48 + "CustomAction:SetVS2010Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2010_VSIX_INSTALLER_PATH]\t",
49 + "CustomAction:SetVS2012Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2012_VSIX_INSTALLER_PATH]\t",
50 + "CustomAction:SetVS2013Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2013_VSIX_INSTALLER_PATH]\t",
51 + "CustomAction:SetVS2015Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2015_VSIX_INSTALLER_PATH]\t",
52 + "CustomAction:vimLa9TyFoAVwf8JmA0_ZJHA69J2fo\t3122\tVS_VSIX_INSTALLER_PATH\t/q \"[#filzi8nwT8Ta133xcfp7qSIdGdRiC0]\" /admin\t",
53 + "CustomAction:viuMpl8IvFSDAzTulrmpAzBwAmCRTQ\t1074\tVS_VSIX_INSTALLER_PATH\t/q \"[#filzi8nwT8Ta133xcfp7qSIdGdRiC0]\"\t",
54 + "CustomAction:vrmLa9TyFoAVwf8JmA0_ZJHA69J2fo\t3442\tVS_VSIX_INSTALLER_PATH\t/q /u:\"ExampleVsix\" /admin\t",
55 + "CustomAction:vruMpl8IvFSDAzTulrmpAzBwAmCRTQ\t1394\tVS_VSIX_INSTALLER_PATH\t/q /u:\"ExampleVsix\"\t",
56 + "CustomAction:vumLa9TyFoAVwf8JmA0_ZJHA69J2fo\t3186\tVS_VSIX_INSTALLER_PATH\t/q /u:\"ExampleVsix\" /admin\t",
57 + "CustomAction:vuuMpl8IvFSDAzTulrmpAzBwAmCRTQ\t1138\tVS_VSIX_INSTALLER_PATH\t/q /u:\"ExampleVsix\"\t",
58 + "CustomAction:Vwd2012VsixWhenVSAbsent\t51\tVS_VSIX_INSTALLER_PATH\t[VWD2012_VSIX_INSTALL_ROOT]\\Common7\\IDE\\VSIXInstaller.exe\t",
59 + "CustomAction:Vwd2013VsixWhenVSAbsent\t51\tVS_VSIX_INSTALLER_PATH\t[VWD2013_VSIX_INSTALL_ROOT]\\Common7\\IDE\\VSIXInstaller.exe\t",
60 + "CustomAction:Vwd2015VsixWhenVSAbsent\t51\tVS_VSIX_INSTALLER_PATH\t[VWD2015_VSIX_INSTALL_ROOT]\\Common7\\IDE\\VSIXInstaller.exe\t",
61 + "CustomAction:Wix4VSFindInstances_A64\t257\tVSCA_A64\tFindInstances\t",
62 + }, results);
63 + }
64 +
65 private static void Build(string[] args)
66 {
67 var result = WixRunner.Execute(args)
68 .AssertSuccess();
69 }
70 +
71 + private static void BuildARM64(string[] args)
72 + {
73 + var newArgs = args.ToList();
74 + newArgs.Add("-platform");
75 + newArgs.Add("arm64");
76 +
77 + var result = WixRunner.Execute(newArgs.ToArray());
78 + result.AssertSuccess();
79 + }
80 }
81 }
src/ext/VisualStudio/wixext/VSCompiler.cs
+1 -1
@@ -76,7 +76,7 @@ namespace WixToolset.VisualStudio
76
77 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
78
79 - this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "Wix4VSFindInstances", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64);
79 + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "Wix4VSFindInstances", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM64);
80 }
81
82 private void ParseVsixPackageElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId)
src/ext/VisualStudio/wixlib/VS2017.wxs
+1 -8
@@ -1,4 +1,4 @@
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. -->
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
4 <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
@@ -91,7 +91,6 @@
91 <!-- C# language tools were installed as a part of VS 2017 setup. -->
92 <Fragment>
93 <Property Id="VS2017_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED" Secure="yes" />
94 - <CustomActionRef Id="VSFindInstances" />
94 </Fragment>
95
96 <!-- Indicates whether the Visual Basic project system is installed as a part of -->
@@ -100,7 +99,6 @@
99 <!-- Basic language tools were installed as a part of VS 2017 setup. -->
100 <Fragment>
101 <Property Id="VS2017_IDE_VB_PROJECTSYSTEM_INSTALLED" Secure="yes" />
103 - <CustomActionRef Id="VSFindInstances" />
102 </Fragment>
103
104 <!-- Indicates whether the Visual Web Developer project system is installed as a part of -->
@@ -109,7 +107,6 @@
107 <!-- Web Developer language tools were installed as a part of VS 2017 setup. -->
108 <Fragment>
109 <Property Id="VS2017_IDE_VWD_PROJECTSYSTEM_INSTALLED" Secure="yes" />
112 - <CustomActionRef Id="VSFindInstances" />
110 </Fragment>
111
112 <!-- Indicates whether the Visual C++ project system is installed as a part of -->
@@ -118,24 +115,20 @@
115 <!-- C++ language tools were installed as a part of VS 2017 setup. -->
116 <Fragment>
117 <Property Id="VS2017_IDE_VC_PROJECTSYSTEM_INSTALLED" Secure="yes" />
121 - <CustomActionRef Id="VSFindInstances" />
118 </Fragment>
119
120 <!-- Indicates whether the Visual Studio 2017 Team Test project system is installed -->
121 <Fragment>
122 <Property Id="VS2017_IDE_VSTS_TESTSYSTEM_INSTALLED" Secure="yes" />
127 - <CustomActionRef Id="VSFindInstances" />
123 </Fragment>
124
125 <!-- Indicates whether the Visual Studio Modeling project system is installed -->
126 <Fragment>
127 <Property Id="VS2017_IDE_MODELING_PROJECTSYSTEM_INSTALLED" Secure="yes" />
133 - <CustomActionRef Id="VSFindInstances" />
128 </Fragment>
129
130 <!-- Indicates whether the Visual Studio F# project system is installed -->
131 <Fragment>
132 <Property Id="VS2017_IDE_FSHARP_PROJECTSYSTEM_INSTALLED" Secure="yes" />
139 - <CustomActionRef Id="VSFindInstances" />
133 </Fragment>
134 </Wix>
src/ext/VisualStudio/wixlib/VS2019.wxs
+1 -8
@@ -1,4 +1,4 @@
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. -->
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
4 <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
@@ -91,7 +91,6 @@
91 <!-- C# language tools were installed as a part of VS 2019 setup. -->
92 <Fragment>
93 <Property Id="VS2019_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED" Secure="yes" />
94 - <CustomActionRef Id="VSFindInstances" />
94 </Fragment>
95
96 <!-- Indicates whether the Visual Basic project system is installed as a part of -->
@@ -100,7 +99,6 @@
99 <!-- Basic language tools were installed as a part of VS 2019 setup. -->
100 <Fragment>
101 <Property Id="VS2019_IDE_VB_PROJECTSYSTEM_INSTALLED" Secure="yes" />
103 - <CustomActionRef Id="VSFindInstances" />
102 </Fragment>
103
104 <!-- Indicates whether the Visual Web Developer project system is installed as a part of -->
@@ -109,7 +107,6 @@
107 <!-- Web Developer language tools were installed as a part of VS 2019 setup. -->
108 <Fragment>
109 <Property Id="VS2019_IDE_VWD_PROJECTSYSTEM_INSTALLED" Secure="yes" />
112 - <CustomActionRef Id="VSFindInstances" />
110 </Fragment>
111
112 <!-- Indicates whether the Visual C++ project system is installed as a part of -->
@@ -118,24 +115,20 @@
115 <!-- C++ language tools were installed as a part of VS 2019 setup. -->
116 <Fragment>
117 <Property Id="VS2019_IDE_VC_PROJECTSYSTEM_INSTALLED" Secure="yes" />
121 - <CustomActionRef Id="VSFindInstances" />
118 </Fragment>
119
120 <!-- Indicates whether the Visual Studio 2019 Team Test project system is installed -->
121 <Fragment>
122 <Property Id="VS2019_IDE_VSTS_TESTSYSTEM_INSTALLED" Secure="yes" />
127 - <CustomActionRef Id="VSFindInstances" />
123 </Fragment>
124
125 <!-- Indicates whether the Visual Studio Modeling project system is installed -->
126 <Fragment>
127 <Property Id="VS2019_IDE_MODELING_PROJECTSYSTEM_INSTALLED" Secure="yes" />
133 - <CustomActionRef Id="VSFindInstances" />
128 </Fragment>
129
130 <!-- Indicates whether the Visual Studio F# project system is installed -->
131 <Fragment>
132 <Property Id="VS2019_IDE_FSHARP_PROJECTSYSTEM_INSTALLED" Secure="yes" />
139 - <CustomActionRef Id="VSFindInstances" />
133 </Fragment>
134 </Wix>
src/ext/VisualStudio/wixlib/VS2022.wxs
+1 -8
@@ -1,4 +1,4 @@
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. -->
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
4 <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
@@ -91,7 +91,6 @@
91 <!-- C# language tools were installed as a part of VS 2019 setup. -->
92 <Fragment>
93 <Property Id="VS2022_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED" Secure="yes" />
94 - <CustomActionRef Id="VSFindInstances" />
94 </Fragment>
95
96 <!-- Indicates whether the Visual Basic project system is installed as a part of -->
@@ -100,7 +99,6 @@
99 <!-- Basic language tools were installed as a part of VS 2019 setup. -->
100 <Fragment>
101 <Property Id="VS2022_IDE_VB_PROJECTSYSTEM_INSTALLED" Secure="yes" />
103 - <CustomActionRef Id="VSFindInstances" />
102 </Fragment>
103
104 <!-- Indicates whether the Visual Web Developer project system is installed as a part of -->
@@ -109,7 +107,6 @@
107 <!-- Web Developer language tools were installed as a part of VS 2019 setup. -->
108 <Fragment>
109 <Property Id="VS2022_IDE_VWD_PROJECTSYSTEM_INSTALLED" Secure="yes" />
112 - <CustomActionRef Id="VSFindInstances" />
110 </Fragment>
111
112 <!-- Indicates whether the Visual C++ project system is installed as a part of -->
@@ -118,24 +115,20 @@
115 <!-- C++ language tools were installed as a part of VS 2019 setup. -->
116 <Fragment>
117 <Property Id="VS2022_IDE_VC_PROJECTSYSTEM_INSTALLED" Secure="yes" />
121 - <CustomActionRef Id="VSFindInstances" />
118 </Fragment>
119
120 <!-- Indicates whether the Visual Studio 2019 Team Test project system is installed -->
121 <Fragment>
122 <Property Id="VS2022_IDE_VSTS_TESTSYSTEM_INSTALLED" Secure="yes" />
127 - <CustomActionRef Id="VSFindInstances" />
123 </Fragment>
124
125 <!-- Indicates whether the Visual Studio Modeling project system is installed -->
126 <Fragment>
127 <Property Id="VS2022_IDE_MODELING_PROJECTSYSTEM_INSTALLED" Secure="yes" />
133 - <CustomActionRef Id="VSFindInstances" />
128 </Fragment>
129
130 <!-- Indicates whether the Visual Studio F# project system is installed -->
131 <Fragment>
132 <Property Id="VS2022_IDE_FSHARP_PROJECTSYSTEM_INSTALLED" Secure="yes" />
139 - <CustomActionRef Id="VSFindInstances" />
133 </Fragment>
134 </Wix>
src/ext/VisualStudio/wixlib/VSExtension_arm64.wxs new
+8
@@ -0,0 +1,8 @@
1 +<?xml version="1.0"?>
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 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
6 + <?define platform=arm64 ?>
7 + <?include VSExtension_Platform.wxi ?>
8 +</Wix>
src/ext/VisualStudio/wixlib/vs.wixproj
+1
@@ -11,6 +11,7 @@
11 <ItemGroup>
12 <ProjectReference Include="..\ca\vsca.vcxproj" Properties="Platform=x86" ReferenceOutputAssembly="false" />
13 <ProjectReference Include="..\ca\vsca.vcxproj" Properties="Platform=x64" ReferenceOutputAssembly="false" />
14 + <ProjectReference Include="..\ca\vsca.vcxproj" Properties="Platform=ARM64" ReferenceOutputAssembly="false" />
15 </ItemGroup>
16
17 <ItemGroup>
src/wix/WixToolset.Converters/WixConverter.cs
+27 -21
@@ -1532,13 +1532,6 @@ namespace WixToolset.Converters
1532 newElementName = "QueryNativeMachine";
1533 break;
1534 case "VS2017_ROOT_FOLDER":
1535 - case "VS2017DEVENV":
1536 - case "VS2017_EXTENSIONS_DIR":
1537 - case "VS2017_ITEMTEMPLATES_DIR":
1538 - case "VS2017_PROJECTTEMPLATES_DIR":
1539 - case "VS2017_SCHEMAS_DIR":
1540 - case "VS2017_IDE_DIR":
1541 - case "VS2017_BOOTSTRAPPER_PACKAGE_FOLDER":
1535 case "VS2017_IDE_FSHARP_PROJECTSYSTEM_INSTALLED":
1536 case "VS2017_IDE_VB_PROJECTSYSTEM_INSTALLED":
1537 case "VS2017_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED":
@@ -1547,13 +1540,6 @@ namespace WixToolset.Converters
1540 case "VS2017_IDE_VWD_PROJECTSYSTEM_INSTALLED":
1541 case "VS2017_IDE_MODELING_PROJECTSYSTEM_INSTALLED":
1542 case "VS2019_ROOT_FOLDER":
1550 - case "VS2019DEVENV":
1551 - case "VS2019_EXTENSIONS_DIR":
1552 - case "VS2019_ITEMTEMPLATES_DIR":
1553 - case "VS2019_PROJECTTEMPLATES_DIR":
1554 - case "VS2019_SCHEMAS_DIR":
1555 - case "VS2019_IDE_DIR":
1556 - case "VS2019_BOOTSTRAPPER_PACKAGE_FOLDER":
1543 case "VS2019_IDE_FSHARP_PROJECTSYSTEM_INSTALLED":
1544 case "VS2019_IDE_VB_PROJECTSYSTEM_INSTALLED":
1545 case "VS2019_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED":
@@ -1562,13 +1548,6 @@ namespace WixToolset.Converters
1548 case "VS2019_IDE_VWD_PROJECTSYSTEM_INSTALLED":
1549 case "VS2019_IDE_MODELING_PROJECTSYSTEM_INSTALLED":
1550 case "VS2022_ROOT_FOLDER":
1565 - case "VS2022DEVENV":
1566 - case "VS2022_EXTENSIONS_DIR":
1567 - case "VS2022_ITEMTEMPLATES_DIR":
1568 - case "VS2022_PROJECTTEMPLATES_DIR":
1569 - case "VS2022_SCHEMAS_DIR":
1570 - case "VS2022_IDE_DIR":
1571 - case "VS2022_BOOTSTRAPPER_PACKAGE_FOLDER":
1551 case "VS2022_IDE_FSHARP_PROJECTSYSTEM_INSTALLED":
1552 case "VS2022_IDE_VB_PROJECTSYSTEM_INSTALLED":
1553 case "VS2022_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED":
@@ -1576,6 +1555,33 @@ namespace WixToolset.Converters
1555 case "VS2022_IDE_VC_PROJECTSYSTEM_INSTALLED":
1556 case "VS2022_IDE_VWD_PROJECTSYSTEM_INSTALLED":
1557 case "VS2022_IDE_MODELING_PROJECTSYSTEM_INSTALLED":
1558 + newElementName = "FindVisualStudio";
1559 + newNamespace = WixVSNamespace;
1560 + newNamespaceName = "vs";
1561 + break;
1562 + case "VS2017DEVENV":
1563 + case "VS2017_EXTENSIONS_DIR":
1564 + case "VS2017_ITEMTEMPLATES_DIR":
1565 + case "VS2017_PROJECTTEMPLATES_DIR":
1566 + case "VS2017_SCHEMAS_DIR":
1567 + case "VS2017_IDE_DIR":
1568 + case "VS2017_BOOTSTRAPPER_PACKAGE_FOLDER":
1569 + case "VS2019DEVENV":
1570 + case "VS2019_EXTENSIONS_DIR":
1571 + case "VS2019_ITEMTEMPLATES_DIR":
1572 + case "VS2019_PROJECTTEMPLATES_DIR":
1573 + case "VS2019_SCHEMAS_DIR":
1574 + case "VS2019_IDE_DIR":
1575 + case "VS2019_BOOTSTRAPPER_PACKAGE_FOLDER":
1576 + case "VS2022DEVENV":
1577 + case "VS2022_EXTENSIONS_DIR":
1578 + case "VS2022_ITEMTEMPLATES_DIR":
1579 + case "VS2022_PROJECTTEMPLATES_DIR":
1580 + case "VS2022_SCHEMAS_DIR":
1581 + case "VS2022_IDE_DIR":
1582 + case "VS2022_BOOTSTRAPPER_PACKAGE_FOLDER":
1583 + // These PropertyRefs need to stay (in addition to the `FindVisualStudio`
1584 + // addition) because they're constructed from deeper AppSearches.
1585 newElementName = "FindVisualStudio";
1586 newNamespace = WixVSNamespace;
1587 newNamespaceName = "vs";
src/wix/test/WixToolsetTest.Converters/VSExtensionFixture.cs
+1 -1
@@ -27,7 +27,7 @@ namespace WixToolsetTest.Converters
27 {
28 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:vs=\"http://wixtoolset.org/schemas/v4/wxs/vs\">",
29 " <Fragment>",
30 - " <vs:FindVisualStudio /><PropertyRef Id=\"VS2019_ROOT_FOLDER\" />",
30 + " <vs:FindVisualStudio />",
31 " <vs:FindVisualStudio /><PropertyRef Id=\"VS2022_BOOTSTRAPPER_PACKAGE_FOLDER\" />",
32 " <CustomActionRef Id=\"VS2017Setup\" />",
33 " </Fragment>",