From 74ca49020e2f382437337f166711ea87556865bd Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 19 Jan 2019 20:31:52 -0600 Subject: Integrate into latest v4. --- src/Cpp.Build.props | 104 ++++++++++++ src/Directory.Build.props | 26 +++ src/Directory.Build.targets | 48 ++++++ src/FindLocalWix.props | 8 + src/ca/custommsierrors.h | 4 + src/ca/dllmain.cpp | 26 +++ src/ca/mqexec.cpp | 38 +---- src/ca/mqqueueexec.cpp | 4 +- src/ca/mqqueueexec.h | 4 +- src/ca/mqqueuesched.cpp | 4 +- src/ca/mqqueuesched.h | 4 +- src/ca/mqsched.cpp | 31 +--- src/ca/msmqca.def | 12 ++ src/ca/msmqca.vcxproj | 71 ++++++++ src/ca/packages.config | 5 + src/ca/precomp.h | 23 +++ .../WixToolsetTest.Msmq/MsmqExtensionFixture.cs | 32 ++++ .../TestData/UsingMessageQueue/Package.en-us.wxl | 11 ++ .../TestData/UsingMessageQueue/Package.wxs | 22 +++ .../UsingMessageQueue/PackageComponents.wxs | 12 ++ .../TestData/UsingMessageQueue/example.txt | 1 + .../WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj | 38 +++++ src/wixext/MsmqCompiler.cs | 188 ++++++++++----------- src/wixext/MsmqDecompiler.cs | 4 +- src/wixext/MsmqErrors.cs | 71 ++++++++ src/wixext/MsmqExtensionData.cs | 50 +----- src/wixext/MsmqExtensionFactory.cs | 18 ++ src/wixext/MsmqWarnings.cs | 30 ++++ src/wixext/MsmqWindowsInstallerBackendExtension.cs | 31 ++++ .../Tuples/MessageQueueGroupPermissionTuple.cs | 79 +++++++++ src/wixext/Tuples/MessageQueueTuple.cs | 127 ++++++++++++++ .../Tuples/MessageQueueUserPermissionTuple.cs | 79 +++++++++ src/wixext/Tuples/MsmqTupleDefinitions.cs | 47 ++++++ src/wixext/WixMsmqExtension.csproj | 49 ------ src/wixext/WixToolset.Msmq.wixext.csproj | 32 ++++ src/wixext/WixToolset.Msmq.wixext.targets | 11 ++ src/wixext/messages.xml | 77 --------- src/wixlib/MsmqExtension.wixproj | 24 --- src/wixlib/MsmqExtension.wxs | 15 +- src/wixlib/caerr.wxi | 96 +++++++++++ src/wixlib/msmq.wixproj | 40 +++++ src/wixlib/packages.config | 5 + 42 files changed, 1234 insertions(+), 367 deletions(-) create mode 100644 src/Cpp.Build.props create mode 100644 src/Directory.Build.props create mode 100644 src/Directory.Build.targets create mode 100644 src/FindLocalWix.props create mode 100644 src/ca/custommsierrors.h create mode 100644 src/ca/dllmain.cpp create mode 100644 src/ca/msmqca.def create mode 100644 src/ca/msmqca.vcxproj create mode 100644 src/ca/packages.config create mode 100644 src/ca/precomp.h create mode 100644 src/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs create mode 100644 src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/Package.wxs create mode 100644 src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/example.txt create mode 100644 src/test/WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj create mode 100644 src/wixext/MsmqErrors.cs create mode 100644 src/wixext/MsmqExtensionFactory.cs create mode 100644 src/wixext/MsmqWarnings.cs create mode 100644 src/wixext/MsmqWindowsInstallerBackendExtension.cs create mode 100644 src/wixext/Tuples/MessageQueueGroupPermissionTuple.cs create mode 100644 src/wixext/Tuples/MessageQueueTuple.cs create mode 100644 src/wixext/Tuples/MessageQueueUserPermissionTuple.cs create mode 100644 src/wixext/Tuples/MsmqTupleDefinitions.cs delete mode 100644 src/wixext/WixMsmqExtension.csproj create mode 100644 src/wixext/WixToolset.Msmq.wixext.csproj create mode 100644 src/wixext/WixToolset.Msmq.wixext.targets delete mode 100644 src/wixext/messages.xml delete mode 100644 src/wixlib/MsmqExtension.wixproj create mode 100644 src/wixlib/caerr.wxi create mode 100644 src/wixlib/msmq.wixproj create mode 100644 src/wixlib/packages.config (limited to 'src') diff --git a/src/Cpp.Build.props b/src/Cpp.Build.props new file mode 100644 index 00000000..0e00132b --- /dev/null +++ b/src/Cpp.Build.props @@ -0,0 +1,104 @@ + + + + + + Win32 + $(BaseIntermediateOutputPath)$(Configuration)\$(Platform)\ + $(OutputPath)$(Platform)\ + + + + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) + + + + + $(DisableSpecificCompilerWarnings) + Level4 + $(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0501;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + Use + precomp.h + StdCall + true + false + -YlprecompDefine + /Zc:threadSafeInit- %(AdditionalOptions) + true + + + $(ArmPreprocessorDefinitions);%(PreprocessorDefinitions) + $(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories) + + + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories) + + + $(ProjectSubSystem) + $(ProjectModuleDefinitionFile) + $(ResourceOnlyDll) + true + $(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies) + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories) + /IGNORE:4099 %(AdditionalOptions) + + + + + + NoExtensions + + + + + CDecl + + + + + OldStyle + true + true + + + + + Disabled + EnableFastChecks + _DEBUG;DEBUG;%(PreprocessorDefinitions) + MultiThreadedDebug + + + + + + MultiThreadedDebugDll + + + + + MinSpace + NDEBUG;%(PreprocessorDefinitions) + true + true + MultiThreaded + + + true + true + + + + + + MultiThreadedDll + + + + + $(LinkKeyFile) + $(LinkDelaySign) + + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000..e853e22d --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,26 @@ + + + + + + Debug + false + + $(MSBuildProjectName) + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\)) + $(BaseOutputPath)obj\$(ProjectName)\ + $(BaseOutputPath)$(Configuration)\ + + WiX Toolset Team + WiX Toolset + Copyright (c) .NET Foundation and contributors. All rights reserved. + MS-RL + WiX Toolset + + + + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets new file mode 100644 index 00000000..dac7452a --- /dev/null +++ b/src/Directory.Build.targets @@ -0,0 +1,48 @@ + + + + + + + true + $(SolutionPath) + $(NCrunchOriginalSolutionPath) + + + + + + + $([System.IO.File]::ReadAllText($(TheSolutionPath))) + $([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) )) + (?<="[PackageName]", ")(.*)(?=", ") + + + + + + %(Identity) + $(SolutionFileContent.Contains('\%(Identity).csproj')) + + + + + $(RegexPattern.Replace('[PackageName]','%(PackageName)') ) + $([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)')) + + + + + + + + + + + diff --git a/src/FindLocalWix.props b/src/FindLocalWix.props new file mode 100644 index 00000000..a784e352 --- /dev/null +++ b/src/FindLocalWix.props @@ -0,0 +1,8 @@ + + + + + + $(MSBuildThisFileDirectory)..\..\Tools\build\Debug\net461\wix.targets + + diff --git a/src/ca/custommsierrors.h b/src/ca/custommsierrors.h new file mode 100644 index 00000000..0c1b23b7 --- /dev/null +++ b/src/ca/custommsierrors.h @@ -0,0 +1,4 @@ +#pragma once +// 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. + +#define msierrMsmqCannotConnect 28101 diff --git a/src/ca/dllmain.cpp b/src/ca/dllmain.cpp new file mode 100644 index 00000000..35ae6d1c --- /dev/null +++ b/src/ca/dllmain.cpp @@ -0,0 +1,26 @@ +// 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. + +#include "precomp.h" + +/******************************************************************** +DllMain - standard entry point for all WiX custom actions + +********************************************************************/ +extern "C" BOOL WINAPI DllMain( + IN HINSTANCE hInst, + IN ULONG ulReason, + IN LPVOID) +{ + switch(ulReason) + { + case DLL_PROCESS_ATTACH: + WcaGlobalInitialize(hInst); + break; + + case DLL_PROCESS_DETACH: + WcaGlobalFinalize(); + break; + } + + return TRUE; +} diff --git a/src/ca/mqexec.cpp b/src/ca/mqexec.cpp index bac54f31..ff7e9b14 100644 --- a/src/ca/mqexec.cpp +++ b/src/ca/mqexec.cpp @@ -2,28 +2,6 @@ #include "precomp.h" -/******************************************************************** - DllMain - standard entry point for all WiX CustomActions - -********************************************************************/ -extern "C" BOOL WINAPI DllMain( - IN HINSTANCE hInst, - IN ULONG ulReason, - IN LPVOID) -{ - switch(ulReason) - { - case DLL_PROCESS_ATTACH: - WcaGlobalInitialize(hInst); - break; - - case DLL_PROCESS_DETACH: - WcaGlobalFinalize(); - break; - } - - return TRUE; -} /******************************************************************** MessageQueuingExecuteInstall - CUSTOM ACTION ENTRY POINT @@ -42,7 +20,7 @@ extern "C" UINT __stdcall MessageQueuingExecuteInstall(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "MessageQueuingExecuteInstall"); ExitOnFailure(hr, "Failed to initialize MessageQueuingExecuteInstall"); - hr = MqiInitialize(); + hr = MqiExecInitialize(); ExitOnFailure(hr, "Failed to initialize"); // get custom action data @@ -67,7 +45,7 @@ LExit: ReleaseStr(pwzCustomActionData); // uninitialize - MqiUninitialize(); + MqiExecUninitialize(); er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); @@ -90,7 +68,7 @@ extern "C" UINT __stdcall MessageQueuingRollbackInstall(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "MessageQueuingRollbackInstall"); ExitOnFailure(hr, "Failed to initialize MessageQueuingRollbackInstall"); - hr = MqiInitialize(); + hr = MqiExecInitialize(); ExitOnFailure(hr, "Failed to initialize"); // get custom action data @@ -113,7 +91,7 @@ LExit: ReleaseStr(pwzCustomActionData); // uninitialize - MqiUninitialize(); + MqiExecUninitialize(); er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); @@ -136,7 +114,7 @@ extern "C" UINT __stdcall MessageQueuingExecuteUninstall(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "MessageQueuingExecuteUninstall"); ExitOnFailure(hr, "Failed to initialize MessageQueuingExecuteUninstall"); - hr = MqiInitialize(); + hr = MqiExecInitialize(); ExitOnFailure(hr, "Failed to initialize"); // get custom action data @@ -161,7 +139,7 @@ LExit: ReleaseStr(pwzCustomActionData); // uninitialize - MqiUninitialize(); + MqiExecUninitialize(); er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); @@ -184,7 +162,7 @@ extern "C" UINT __stdcall MessageQueuingRollbackUninstall(MSIHANDLE hInstall) hr = WcaInitialize(hInstall, "MessageQueuingRollbackUninstall"); ExitOnFailure(hr, "Failed to initialize MessageQueuingRollbackUninstall"); - hr = MqiInitialize(); + hr = MqiExecInitialize(); ExitOnFailure(hr, "Failed to initialize"); // get custom action data @@ -207,7 +185,7 @@ LExit: ReleaseStr(pwzCustomActionData); // uninitialize - MqiUninitialize(); + MqiExecUninitialize(); er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); diff --git a/src/ca/mqqueueexec.cpp b/src/ca/mqqueueexec.cpp index f5b99da7..e4304ab8 100644 --- a/src/ca/mqqueueexec.cpp +++ b/src/ca/mqqueueexec.cpp @@ -119,7 +119,7 @@ static MQSetQueueSecurityFunc gpfnMQSetQueueSecurity; // function definitions -HRESULT MqiInitialize() +HRESULT MqiExecInitialize() { HRESULT hr = S_OK; @@ -153,7 +153,7 @@ LExit: return hr; } -void MqiUninitialize() +void MqiExecUninitialize() { if (ghMQRT) ::FreeLibrary(ghMQRT); diff --git a/src/ca/mqqueueexec.h b/src/ca/mqqueueexec.h index 37ceea50..76bc2023 100644 --- a/src/ca/mqqueueexec.h +++ b/src/ca/mqqueueexec.h @@ -2,8 +2,8 @@ // 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. -HRESULT MqiInitialize(); -void MqiUninitialize(); +HRESULT MqiExecInitialize(); +void MqiExecUninitialize(); HRESULT MqiCreateMessageQueues( LPWSTR* ppwzData ); diff --git a/src/ca/mqqueuesched.cpp b/src/ca/mqqueuesched.cpp index 4f40a4aa..01777ea4 100644 --- a/src/ca/mqqueuesched.cpp +++ b/src/ca/mqqueuesched.cpp @@ -51,7 +51,7 @@ static MQPathNameToFormatNameFunc gpfnMQPathNameToFormatName; // function definitions -HRESULT MqiInitialize() +HRESULT MqiSchedInitialize() { HRESULT hr = S_OK; @@ -72,7 +72,7 @@ LExit: return hr; } -void MqiUninitialize() +void MqiSchedUninitialize() { if (ghMQRT) { diff --git a/src/ca/mqqueuesched.h b/src/ca/mqqueuesched.h index b063ca28..c9381e0a 100644 --- a/src/ca/mqqueuesched.h +++ b/src/ca/mqqueuesched.h @@ -54,8 +54,8 @@ struct MQI_MESSAGE_QUEUE_PERMISSION_LIST // function prototypes -HRESULT MqiInitialize(); -void MqiUninitialize(); +HRESULT MqiSchedInitialize(); +void MqiSchedUninitialize(); HRESULT MqiMessageQueueRead( MQI_MESSAGE_QUEUE_LIST* pList ); diff --git a/src/ca/mqsched.cpp b/src/ca/mqsched.cpp index cefce853..4c994901 100644 --- a/src/ca/mqsched.cpp +++ b/src/ca/mqsched.cpp @@ -3,29 +3,6 @@ #include "precomp.h" -/******************************************************************** - DllMain - standard entry point for all WiX CustomActions - -********************************************************************/ -extern "C" BOOL WINAPI DllMain( - IN HINSTANCE hInst, - IN ULONG ulReason, - IN LPVOID) -{ - switch(ulReason) - { - case DLL_PROCESS_ATTACH: - WcaGlobalInitialize(hInst); - break; - - case DLL_PROCESS_DETACH: - WcaGlobalFinalize(); - break; - } - - return TRUE; -} - /******************************************************************** MessageQueuingInstall - CUSTOM ACTION ENTRY POINT for installing MSMQ message queues @@ -51,7 +28,7 @@ extern "C" UINT __stdcall MessageQueuingInstall(MSIHANDLE hInstall) do { - hr = MqiInitialize(); + hr = MqiSchedInitialize(); if (S_FALSE == hr) { WcaLog(LOGMSG_STANDARD, "Failed to load mqrt.dll."); @@ -118,7 +95,7 @@ LExit: ReleaseStr(pwzExecuteActionData); // uninitialize - MqiUninitialize(); + MqiSchedUninitialize(); er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); @@ -150,7 +127,7 @@ extern "C" UINT __stdcall MessageQueuingUninstall(MSIHANDLE hInstall) do { - hr = MqiInitialize(); + hr = MqiSchedInitialize(); if (S_FALSE == hr) { WcaLog(LOGMSG_STANDARD, "Failed to load mqrt.dll."); @@ -212,7 +189,7 @@ LExit: ReleaseStr(pwzExecuteActionData); // uninitialize - MqiUninitialize(); + MqiSchedUninitialize(); er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; return WcaFinalize(er); diff --git a/src/ca/msmqca.def b/src/ca/msmqca.def new file mode 100644 index 00000000..4902858f --- /dev/null +++ b/src/ca/msmqca.def @@ -0,0 +1,12 @@ +; 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. + + +LIBRARY "msmqca" + +EXPORTS + MessageQueuingInstall + MessageQueuingUninstall + MessageQueuingExecuteInstall + MessageQueuingRollbackInstall + MessageQueuingExecuteUninstall + MessageQueuingRollbackUninstall diff --git a/src/ca/msmqca.vcxproj b/src/ca/msmqca.vcxproj new file mode 100644 index 00000000..507a2f93 --- /dev/null +++ b/src/ca/msmqca.vcxproj @@ -0,0 +1,71 @@ + + + + + + + + + + Debug + Win32 + + + Release + Win32 + + + + + {CAD56A7E-342B-4324-9DCB-BCEB8F3BC80D} + DynamicLibrary + msmqca + v141 + Unicode + msmqca.def + WiX Toolset MSMQ CustomAction + + + + + + + msi.lib + + + + + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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}. + + + + + diff --git a/src/ca/packages.config b/src/ca/packages.config new file mode 100644 index 00000000..b87f9ab4 --- /dev/null +++ b/src/ca/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/ca/precomp.h b/src/ca/precomp.h new file mode 100644 index 00000000..cbbff6ea --- /dev/null +++ b/src/ca/precomp.h @@ -0,0 +1,23 @@ +#pragma once +// 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. + + +#include +#include +#include +#include +#include +#include + +#include "wcautil.h" +#include "memutil.h" +#include "strutil.h" +#include "wiutil.h" + +#include "CustomMsiErrors.h" + +#include "mqcost.h" +#include "mqutilsched.h" +#include "mqqueuesched.h" +#include "mqutilexec.h" +#include "mqqueueexec.h" diff --git a/src/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs b/src/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs new file mode 100644 index 00000000..af64517d --- /dev/null +++ b/src/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs @@ -0,0 +1,32 @@ +// 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. + +namespace WixToolsetTest.Msmq +{ + using System.Linq; + using WixBuildTools.TestSupport; + using WixToolset.Core.TestPackage; + using WixToolset.Msmq; + using Xunit; + + public class MsmqExtensionFixture + { + [Fact] + public void CanBuildUsingMessageQueue() + { + var folder = TestData.Get(@"TestData\UsingMessageQueue"); + var build = new Builder(folder, typeof(MsmqExtensionFactory), new[] { folder }); + + var results = build.BuildAndQuery(Build, "MessageQueue"); + Assert.Equal(new[] + { + "MessageQueue:TestMQ\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\t0\t0\tMQLabel\t\tMQPath\t0\t0\t\t0", + }, results.OrderBy(s => s).ToArray()); + } + + private static void Build(string[] args) + { + var result = WixRunner.Execute(args) + .AssertSuccess(); + } + } +} diff --git a/src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/Package.en-us.wxl b/src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/Package.wxs b/src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/Package.wxs new file mode 100644 index 00000000..68ff98fd --- /dev/null +++ b/src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/PackageComponents.wxs b/src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/PackageComponents.wxs new file mode 100644 index 00000000..ff9f7d92 --- /dev/null +++ b/src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/PackageComponents.wxs @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/example.txt b/src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/example.txt new file mode 100644 index 00000000..1b4ffe8a --- /dev/null +++ b/src/test/WixToolsetTest.Msmq/TestData/UsingMessageQueue/example.txt @@ -0,0 +1 @@ +This is example.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj b/src/test/WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj new file mode 100644 index 00000000..bb03f716 --- /dev/null +++ b/src/test/WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj @@ -0,0 +1,38 @@ + + + + + + netcoreapp2.1 + false + + + + NU1701 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixext/MsmqCompiler.cs b/src/wixext/MsmqCompiler.cs index b40e2dc1..5365f0fb 100644 --- a/src/wixext/MsmqCompiler.cs +++ b/src/wixext/MsmqCompiler.cs @@ -1,30 +1,19 @@ // 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. -namespace WixToolset.Extensions +namespace WixToolset.Msmq { using System; - using System.Collections; using System.Collections.Generic; - using System.Globalization; - using System.Reflection; - using System.Xml; using System.Xml.Linq; - using System.Xml.Schema; using WixToolset.Data; using WixToolset.Extensibility; /// - /// The compiler for the WiX Toolset Internet Information Services Extension. + /// The compiler for the WiX Toolset MSMQ Extension. /// - public sealed class MsmqCompiler : CompilerExtension + public sealed class MsmqCompiler : BaseCompilerExtension { - /// - /// Instantiate a new MsmqCompiler. - /// - public MsmqCompiler() - { - this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/msmq"; - } + public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/msmq"; /// /// @@ -75,7 +64,7 @@ namespace WixToolset.Extensions /// Parent element of element to process. /// Element to process. /// Extra information about the context in which this element is being parsed. - public override void ParseElement(XElement parentElement, XElement element, IDictionary context) + public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary context) { switch (parentElement.Name.LocalName) { @@ -86,18 +75,18 @@ namespace WixToolset.Extensions switch (element.Name.LocalName) { case "MessageQueue": - this.ParseMessageQueueElement(element, componentId); + this.ParseMessageQueueElement(intermediate, section, element, componentId); break; case "MessageQueuePermission": - this.ParseMessageQueuePermissionElement(element, componentId, null); + this.ParseMessageQueuePermissionElement(intermediate, section, element, componentId, null); break; default: - this.Core.UnexpectedElement(parentElement, element); + this.ParseHelper.UnexpectedElement(parentElement, element); break; } break; default: - this.Core.UnexpectedElement(parentElement, element); + this.ParseHelper.UnexpectedElement(parentElement, element); break; } } @@ -107,11 +96,11 @@ namespace WixToolset.Extensions /// /// Element to parse. /// Identifier of parent component. - private void ParseMessageQueueElement(XElement node, string componentId) + private void ParseMessageQueueElement(Intermediate intermediate, IntermediateSection section, XElement node, string componentId) { - SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); - string id = null; + Identifier id = null; int basePriority = CompilerConstants.IntegerNotSet; int journalQuota = CompilerConstants.IntegerNotSet; string label = null; @@ -129,10 +118,10 @@ namespace WixToolset.Extensions switch (attrib.Name.LocalName) { case "Id": - id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); break; case "Authenticate": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { attributes |= (int)MqiMessageQueueAttributes.Authenticate; } @@ -142,10 +131,10 @@ namespace WixToolset.Extensions } break; case "BasePriority": - basePriority = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue); + basePriority = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue); break; case "Journal": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { attributes |= (int)MqiMessageQueueAttributes.Journal; } @@ -155,19 +144,19 @@ namespace WixToolset.Extensions } break; case "JournalQuota": - journalQuota = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); + journalQuota = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); break; case "Label": - label = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + label = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); break; case "MulticastAddress": - multicastAddress = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + multicastAddress = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); break; case "PathName": - pathName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + pathName = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); break; case "PrivLevel": - string privLevelAttr = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + string privLevelAttr = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); switch (privLevelAttr) { case "none": @@ -180,15 +169,15 @@ namespace WixToolset.Extensions privLevel = (int)MqiMessageQueuePrivacyLevel.Body; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, "MessageQueue", "PrivLevel", privLevelAttr, "none", "body", "optional")); + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, "MessageQueue", "PrivLevel", privLevelAttr, "none", "body", "optional")); break; } break; case "Quota": - quota = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); + quota = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); break; case "Transactional": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { attributes |= (int)MqiMessageQueueAttributes.Transactional; } @@ -198,16 +187,16 @@ namespace WixToolset.Extensions } break; case "ServiceTypeGuid": - serviceTypeGuid = TryFormatGuidValue(this.Core.GetAttributeValue(sourceLineNumbers, attrib)); + serviceTypeGuid = this.TryFormatGuidValue(this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib)); break; default: - this.Core.UnexpectedAttribute(node, attrib); + this.ParseHelper.UnexpectedAttribute(node, attrib); break; } } else { - this.Core.ParseExtensionAttribute(node, attrib); + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); } } @@ -218,46 +207,45 @@ namespace WixToolset.Extensions switch (child.Name.LocalName) { case "MessageQueuePermission": - this.ParseMessageQueuePermissionElement(child, componentId, id); + this.ParseMessageQueuePermissionElement(intermediate, section, child, componentId, id?.Id); break; default: - this.Core.UnexpectedElement(node, child); + this.ParseHelper.UnexpectedElement(node, child); break; } } else { - this.Core.ParseExtensionElement(node, child); + this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, node, child); } } - Row row = this.Core.CreateRow(sourceLineNumbers, "MessageQueue"); - row[0] = id; - row[1] = componentId; + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "MessageQueue", id); + row.Set(1, componentId); if (CompilerConstants.IntegerNotSet != basePriority) { - row[2] = basePriority; + row.Set(2, basePriority); } if (CompilerConstants.IntegerNotSet != journalQuota) { - row[3] = journalQuota; + row.Set(3, journalQuota); } - row[4] = label; - row[5] = multicastAddress; - row[6] = pathName; + row.Set(4, label); + row.Set(5, multicastAddress); + row.Set(6, pathName); if (CompilerConstants.IntegerNotSet != privLevel) { - row[7] = privLevel; + row.Set(7, privLevel); } if (CompilerConstants.IntegerNotSet != quota) { - row[8] = quota; + row.Set(8, quota); } - row[9] = serviceTypeGuid; - row[10] = attributes; + row.Set(9, serviceTypeGuid); + row.Set(10, attributes); - this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "MessageQueuingInstall"); - this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "MessageQueuingUninstall"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "MessageQueuingInstall"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "MessageQueuingUninstall"); } /// @@ -266,11 +254,11 @@ namespace WixToolset.Extensions /// Element to parse. /// Identifier of parent component. /// Optional identifier of parent message queue. - private void ParseMessageQueuePermissionElement(XElement node, string componentId, string messageQueueId) + private void ParseMessageQueuePermissionElement(Intermediate intermediate, IntermediateSection section, XElement node, string componentId, string messageQueueId) { - SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); - string id = null; + Identifier id = null; string user = null; string group = null; int permissions = 0; @@ -282,34 +270,34 @@ namespace WixToolset.Extensions switch (attrib.Name.LocalName) { case "Id": - id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); break; case "MessageQueue": if (null != messageQueueId) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); + this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); } - messageQueueId = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - this.Core.CreateSimpleReference(sourceLineNumbers, "MessageQueue", messageQueueId); + messageQueueId = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "MessageQueue", messageQueueId); break; case "User": if (null != group) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "User", "Group")); + this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "User", "Group")); } - user = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - this.Core.CreateSimpleReference(sourceLineNumbers, "User", user); + user = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "User", user); break; case "Group": if (null != user) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Group", "User")); + this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Group", "User")); } - group = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - this.Core.CreateSimpleReference(sourceLineNumbers, "Group", group); + group = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Group", group); break; case "DeleteMessage": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.DeleteMessage; } @@ -319,7 +307,7 @@ namespace WixToolset.Extensions } break; case "PeekMessage": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.PeekMessage; } @@ -329,7 +317,7 @@ namespace WixToolset.Extensions } break; case "WriteMessage": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.WriteMessage; } @@ -339,7 +327,7 @@ namespace WixToolset.Extensions } break; case "DeleteJournalMessage": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.DeleteJournalMessage; } @@ -349,7 +337,7 @@ namespace WixToolset.Extensions } break; case "SetQueueProperties": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.SetQueueProperties; } @@ -359,7 +347,7 @@ namespace WixToolset.Extensions } break; case "GetQueueProperties": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.GetQueueProperties; } @@ -369,7 +357,7 @@ namespace WixToolset.Extensions } break; case "DeleteQueue": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.DeleteQueue; } @@ -379,7 +367,7 @@ namespace WixToolset.Extensions } break; case "GetQueuePermissions": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.GetQueuePermissions; } @@ -389,7 +377,7 @@ namespace WixToolset.Extensions } break; case "ChangeQueuePermissions": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.ChangeQueuePermissions; } @@ -399,7 +387,7 @@ namespace WixToolset.Extensions } break; case "TakeQueueOwnership": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.TakeQueueOwnership; } @@ -409,7 +397,7 @@ namespace WixToolset.Extensions } break; case "ReceiveMessage": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.ReceiveMessage; } @@ -419,7 +407,7 @@ namespace WixToolset.Extensions } break; case "ReceiveJournalMessage": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.ReceiveJournalMessage; } @@ -429,7 +417,7 @@ namespace WixToolset.Extensions } break; case "QueueGenericRead": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.QueueGenericRead; } @@ -439,7 +427,7 @@ namespace WixToolset.Extensions } break; case "QueueGenericWrite": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.QueueGenericWrite; } @@ -449,7 +437,7 @@ namespace WixToolset.Extensions } break; case "QueueGenericExecute": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.QueueGenericExecute; } @@ -459,7 +447,7 @@ namespace WixToolset.Extensions } break; case "QueueGenericAll": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { permissions |= (int)MqiMessageQueuePermission.QueueGenericAll; } @@ -469,44 +457,42 @@ namespace WixToolset.Extensions } break; default: - this.Core.UnexpectedAttribute(node, attrib); + this.ParseHelper.UnexpectedAttribute(node, attrib); break; } } else { - this.Core.ParseExtensionAttribute(node, attrib); + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); } } if (null == messageQueueId) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "MessageQueue")); + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "MessageQueue")); } if (null == user && null == group) { - this.Core.OnMessage(WixErrors.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "User", "Group")); + this.Messaging.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "User", "Group")); } - this.Core.ParseForExtensionElements(node); + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node); if (null != user) { - Row row = this.Core.CreateRow(sourceLineNumbers, "MessageQueueUserPermission"); - row[0] = id; - row[1] = componentId; - row[2] = messageQueueId; - row[3] = user; - row[4] = permissions; + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "MessageQueueUserPermission", id); + row.Set(1, componentId); + row.Set(2, messageQueueId); + row.Set(3, user); + row.Set(4, permissions); } if (null != group) { - Row row = this.Core.CreateRow(sourceLineNumbers, "MessageQueueGroupPermission"); - row[0] = id; - row[1] = componentId; - row[2] = messageQueueId; - row[3] = group; - row[4] = permissions; + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "MessageQueueGroupPermission", id); + row.Set(1, componentId); + row.Set(2, messageQueueId); + row.Set(3, group); + row.Set(4, permissions); } } diff --git a/src/wixext/MsmqDecompiler.cs b/src/wixext/MsmqDecompiler.cs index 396fc49a..aa8c34b6 100644 --- a/src/wixext/MsmqDecompiler.cs +++ b/src/wixext/MsmqDecompiler.cs @@ -1,7 +1,8 @@ // 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. -namespace WixToolset.Extensions +namespace WixToolset.Msmq { +#if TODO_CONSIDER_DECOMPILER using System; using System.Collections; using System.Globalization; @@ -300,4 +301,5 @@ namespace WixToolset.Extensions } } } +#endif } diff --git a/src/wixext/MsmqErrors.cs b/src/wixext/MsmqErrors.cs new file mode 100644 index 00000000..4342e1cf --- /dev/null +++ b/src/wixext/MsmqErrors.cs @@ -0,0 +1,71 @@ +// 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. + +namespace WixToolset.Data +{ + using System; + using System.Resources; + + public static class MsmqErrors + { + public static Message IllegalAttributeWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) + { + return Message(sourceLineNumbers, Ids.IllegalAttributeWithoutComponent, "The {0}/@{1} attribute cannot be specified unless the element has a component as an ancestor. A {0} that does not have a component ancestor is not installed.", elementName, attributeName); + } + + public static Message IllegalElementWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName) + { + return Message(sourceLineNumbers, Ids.IllegalElementWithoutComponent, "The {0} element cannot be specified unless the element has a component as an ancestor. A {0} that does not have a component ancestor is not installed.", elementName); + } + + public static Message RequiredAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2) + { + return Message(sourceLineNumbers, Ids.RequiredAttribute, "A {0} element must have either a {1} attribute or a {2} attribute, or both set.", elementName, attributeName1, attributeName2); + } + + public static Message RequiredAttributeNotUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2) + { + return Message(sourceLineNumbers, Ids.RequiredAttributeNotUnderComponent, "A {0} element not nested under a component must have either a {1} attribute or a {2} attribute, or both set.", elementName, attributeName1, attributeName2); + } + + public static Message RequiredAttributeUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) + { + return Message(sourceLineNumbers, Ids.RequiredAttributeUnderComponent, "The {0}/@{1} attribute must be provided when {0} element is nested under a component.", elementName, attributeName); + } + + public static Message UnexpectedAttributeWithOtherValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName, string otherValue) + { + return Message(sourceLineNumbers, Ids.UnexpectedAttributeWithOtherValue, "The {0}/@{1} attribute cannot coexist with the {2} attribute's value of '{3}'.", elementName, attributeName, otherAttributeName, otherValue); + } + + public static Message UnexpectedAttributeWithOtherValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string otherAttributeName, string otherValue) + { + return Message(sourceLineNumbers, Ids.UnexpectedAttributeWithOtherValue, "The {0}/@{1} attribute's value, '{2}', cannot coexist with the {3} attribute's value of '{4}'.", elementName, attributeName, value, otherAttributeName, otherValue); + } + + public static Message UnexpectedAttributeWithoutOtherValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName, string otherValue) + { + return Message(sourceLineNumbers, Ids.UnexpectedAttributeWithoutOtherValue, "The {0}/@{1} cannot be provided unless the {2} attribute is provided with a value of '{3}'.", elementName, attributeName, otherAttributeName, otherValue); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args); + } + + public enum Ids + { + IllegalAttributeWithoutComponent = 6000, + IllegalElementWithoutComponent = 6001, + UnexpectedAttributeWithOtherValue = 6002, + UnexpectedAttributeWithoutOtherValue = 6003, + RequiredAttributeUnderComponent = 6004, + RequiredAttribute = 6005, + RequiredAttributeNotUnderComponent = 6006, + } + } +} diff --git a/src/wixext/MsmqExtensionData.cs b/src/wixext/MsmqExtensionData.cs index 81d53ce7..dd1694f4 100644 --- a/src/wixext/MsmqExtensionData.cs +++ b/src/wixext/MsmqExtensionData.cs @@ -1,64 +1,30 @@ // 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. -namespace WixToolset.Extensions +namespace WixToolset.Msmq { - using System; - using System.Reflection; using WixToolset.Data; using WixToolset.Extensibility; /// /// The WiX Toolset MSMQ Extension. /// - public sealed class MsmqExtensionData : ExtensionData + public sealed class MsmqExtensionData : BaseExtensionData { /// /// Gets the default culture. /// /// The default culture. - public override string DefaultCulture - { - get { return "en-us"; } - } - - /// - /// Gets the optional table definitions for this extension. - /// - /// The optional table definitions for this extension. - public override TableDefinitionCollection TableDefinitions - { - get - { - return MsmqExtensionData.GetExtensionTableDefinitions(); - } - } - - /// - /// Gets the library associated with this extension. - /// - /// The table definitions to use while loading the library. - /// The loaded library. - public override Library GetLibrary(TableDefinitionCollection tableDefinitions) - { - return MsmqExtensionData.GetExtensionLibrary(tableDefinitions); - } + public override string DefaultCulture => "en-US"; - /// - /// Internal mechanism to access the extension's table definitions. - /// - /// Extension's table definitions. - internal static TableDefinitionCollection GetExtensionTableDefinitions() + public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) { - return ExtensionData.LoadTableDefinitionHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.tables.xml"); + tupleDefinition = MsmqTupleDefinitions.ByName(name); + return tupleDefinition != null; } - /// - /// Internal mechanism to access the extension's library. - /// - /// Extension's library. - internal static Library GetExtensionLibrary(TableDefinitionCollection tableDefinitions) + public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions) { - return ExtensionData.LoadLibraryHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.msmq.wixlib", tableDefinitions); + return Intermediate.Load(typeof(MsmqExtensionData).Assembly, "WixToolset.Msmq.msmq.wixlib", tupleDefinitions); } } } diff --git a/src/wixext/MsmqExtensionFactory.cs b/src/wixext/MsmqExtensionFactory.cs new file mode 100644 index 00000000..14dd5188 --- /dev/null +++ b/src/wixext/MsmqExtensionFactory.cs @@ -0,0 +1,18 @@ +// 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. + +namespace WixToolset.Msmq +{ + using System; + using System.Collections.Generic; + using WixToolset.Extensibility; + + public class MsmqExtensionFactory : BaseExtensionFactory + { + protected override IEnumerable ExtensionTypes => new[] + { + typeof(MsmqCompiler), + typeof(MsmqExtensionData), + typeof(MsmqWindowsInstallerBackendBinderExtension), + }; + } +} diff --git a/src/wixext/MsmqWarnings.cs b/src/wixext/MsmqWarnings.cs new file mode 100644 index 00000000..41d160e9 --- /dev/null +++ b/src/wixext/MsmqWarnings.cs @@ -0,0 +1,30 @@ +// 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. + +namespace WixToolset.Data +{ + using System; + using System.Resources; + + public static class MsmqWarnings + { + public static Message MissingComponents(SourceLineNumber sourceLineNumbers) + { + return Message(sourceLineNumbers, Ids.MissingComponents, "The MsmqAssembly element has a Type attribute with a value of 'native', but the element does not contain any MsmqComponent elements. All components contained in a native assembly must be listed, or they will not be correctly removed during uninstall."); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, resourceManager, resourceName, args); + } + + public enum Ids + { + MissingComponents = 6007, + } + } +} diff --git a/src/wixext/MsmqWindowsInstallerBackendExtension.cs b/src/wixext/MsmqWindowsInstallerBackendExtension.cs new file mode 100644 index 00000000..d7e5c4e1 --- /dev/null +++ b/src/wixext/MsmqWindowsInstallerBackendExtension.cs @@ -0,0 +1,31 @@ +// 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. + +namespace WixToolset.Msmq +{ + using System.Linq; + using System.Xml; + using WixToolset.Data.WindowsInstaller; + using WixToolset.Extensibility; + + public class MsmqWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension + { + public MsmqWindowsInstallerBackendBinderExtension() + { + + } + + private static readonly TableDefinition[] Tables = LoadTables(); + + protected override TableDefinition[] TableDefinitionsForTuples => Tables; + + private static TableDefinition[] LoadTables() + { + using (var resourceStream = typeof(MsmqWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.Msmq.tables.xml")) + using (var reader = XmlReader.Create(resourceStream)) + { + var tables = TableDefinitionCollection.Load(reader); + return tables.ToArray(); + } + } + } +} diff --git a/src/wixext/Tuples/MessageQueueGroupPermissionTuple.cs b/src/wixext/Tuples/MessageQueueGroupPermissionTuple.cs new file mode 100644 index 00000000..cc690f9a --- /dev/null +++ b/src/wixext/Tuples/MessageQueueGroupPermissionTuple.cs @@ -0,0 +1,79 @@ +// 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. + +namespace WixToolset.Msmq +{ + using WixToolset.Data; + using WixToolset.Msmq.Tuples; + + public static partial class MsmqTupleDefinitions + { + public static readonly IntermediateTupleDefinition MessageQueueGroupPermission = new IntermediateTupleDefinition( + MsmqTupleDefinitionType.MessageQueueGroupPermission.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(MessageQueueGroupPermissionTupleFields.MessageQueueGroupPermission), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueGroupPermissionTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueGroupPermissionTupleFields.MessageQueue_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueGroupPermissionTupleFields.Group_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueGroupPermissionTupleFields.Permissions), IntermediateFieldType.Number), + }, + typeof(MessageQueueGroupPermissionTuple)); + } +} + +namespace WixToolset.Msmq.Tuples +{ + using WixToolset.Data; + + public enum MessageQueueGroupPermissionTupleFields + { + MessageQueueGroupPermission, + Component_, + MessageQueue_, + Group_, + Permissions, + } + + public class MessageQueueGroupPermissionTuple : IntermediateTuple + { + public MessageQueueGroupPermissionTuple() : base(MsmqTupleDefinitions.MessageQueueGroupPermission, null, null) + { + } + + public MessageQueueGroupPermissionTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(MsmqTupleDefinitions.MessageQueueGroupPermission, sourceLineNumber, id) + { + } + + public IntermediateField this[MessageQueueGroupPermissionTupleFields index] => this.Fields[(int)index]; + + public string MessageQueueGroupPermission + { + get => this.Fields[(int)MessageQueueGroupPermissionTupleFields.MessageQueueGroupPermission].AsString(); + set => this.Set((int)MessageQueueGroupPermissionTupleFields.MessageQueueGroupPermission, value); + } + + public string Component_ + { + get => this.Fields[(int)MessageQueueGroupPermissionTupleFields.Component_].AsString(); + set => this.Set((int)MessageQueueGroupPermissionTupleFields.Component_, value); + } + + public string MessageQueue_ + { + get => this.Fields[(int)MessageQueueGroupPermissionTupleFields.MessageQueue_].AsString(); + set => this.Set((int)MessageQueueGroupPermissionTupleFields.MessageQueue_, value); + } + + public string Group_ + { + get => this.Fields[(int)MessageQueueGroupPermissionTupleFields.Group_].AsString(); + set => this.Set((int)MessageQueueGroupPermissionTupleFields.Group_, value); + } + + public int Permissions + { + get => this.Fields[(int)MessageQueueGroupPermissionTupleFields.Permissions].AsNumber(); + set => this.Set((int)MessageQueueGroupPermissionTupleFields.Permissions, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/MessageQueueTuple.cs b/src/wixext/Tuples/MessageQueueTuple.cs new file mode 100644 index 00000000..86f7f2a4 --- /dev/null +++ b/src/wixext/Tuples/MessageQueueTuple.cs @@ -0,0 +1,127 @@ +// 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. + +namespace WixToolset.Msmq +{ + using WixToolset.Data; + using WixToolset.Msmq.Tuples; + + public static partial class MsmqTupleDefinitions + { + public static readonly IntermediateTupleDefinition MessageQueue = new IntermediateTupleDefinition( + MsmqTupleDefinitionType.MessageQueue.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.MessageQueue), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.BasePriority), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.JournalQuota), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.Label), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.MulticastAddress), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.PathName), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.PrivLevel), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.Quota), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.ServiceTypeGuid), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.Attributes), IntermediateFieldType.Number), + }, + typeof(MessageQueueTuple)); + } +} + +namespace WixToolset.Msmq.Tuples +{ + using WixToolset.Data; + + public enum MessageQueueTupleFields + { + MessageQueue, + Component_, + BasePriority, + JournalQuota, + Label, + MulticastAddress, + PathName, + PrivLevel, + Quota, + ServiceTypeGuid, + Attributes, + } + + public class MessageQueueTuple : IntermediateTuple + { + public MessageQueueTuple() : base(MsmqTupleDefinitions.MessageQueue, null, null) + { + } + + public MessageQueueTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(MsmqTupleDefinitions.MessageQueue, sourceLineNumber, id) + { + } + + public IntermediateField this[MessageQueueTupleFields index] => this.Fields[(int)index]; + + public string MessageQueue + { + get => this.Fields[(int)MessageQueueTupleFields.MessageQueue].AsString(); + set => this.Set((int)MessageQueueTupleFields.MessageQueue, value); + } + + public string Component_ + { + get => this.Fields[(int)MessageQueueTupleFields.Component_].AsString(); + set => this.Set((int)MessageQueueTupleFields.Component_, value); + } + + public int BasePriority + { + get => this.Fields[(int)MessageQueueTupleFields.BasePriority].AsNumber(); + set => this.Set((int)MessageQueueTupleFields.BasePriority, value); + } + + public int JournalQuota + { + get => this.Fields[(int)MessageQueueTupleFields.JournalQuota].AsNumber(); + set => this.Set((int)MessageQueueTupleFields.JournalQuota, value); + } + + public string Label + { + get => this.Fields[(int)MessageQueueTupleFields.Label].AsString(); + set => this.Set((int)MessageQueueTupleFields.Label, value); + } + + public string MulticastAddress + { + get => this.Fields[(int)MessageQueueTupleFields.MulticastAddress].AsString(); + set => this.Set((int)MessageQueueTupleFields.MulticastAddress, value); + } + + public string PathName + { + get => this.Fields[(int)MessageQueueTupleFields.PathName].AsString(); + set => this.Set((int)MessageQueueTupleFields.PathName, value); + } + + public int PrivLevel + { + get => this.Fields[(int)MessageQueueTupleFields.PrivLevel].AsNumber(); + set => this.Set((int)MessageQueueTupleFields.PrivLevel, value); + } + + public int Quota + { + get => this.Fields[(int)MessageQueueTupleFields.Quota].AsNumber(); + set => this.Set((int)MessageQueueTupleFields.Quota, value); + } + + public string ServiceTypeGuid + { + get => this.Fields[(int)MessageQueueTupleFields.ServiceTypeGuid].AsString(); + set => this.Set((int)MessageQueueTupleFields.ServiceTypeGuid, value); + } + + public int Attributes + { + get => this.Fields[(int)MessageQueueTupleFields.Attributes].AsNumber(); + set => this.Set((int)MessageQueueTupleFields.Attributes, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/MessageQueueUserPermissionTuple.cs b/src/wixext/Tuples/MessageQueueUserPermissionTuple.cs new file mode 100644 index 00000000..8c5e6ade --- /dev/null +++ b/src/wixext/Tuples/MessageQueueUserPermissionTuple.cs @@ -0,0 +1,79 @@ +// 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. + +namespace WixToolset.Msmq +{ + using WixToolset.Data; + using WixToolset.Msmq.Tuples; + + public static partial class MsmqTupleDefinitions + { + public static readonly IntermediateTupleDefinition MessageQueueUserPermission = new IntermediateTupleDefinition( + MsmqTupleDefinitionType.MessageQueueUserPermission.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(MessageQueueUserPermissionTupleFields.MessageQueueUserPermission), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueUserPermissionTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueUserPermissionTupleFields.MessageQueue_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueUserPermissionTupleFields.User_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MessageQueueUserPermissionTupleFields.Permissions), IntermediateFieldType.Number), + }, + typeof(MessageQueueUserPermissionTuple)); + } +} + +namespace WixToolset.Msmq.Tuples +{ + using WixToolset.Data; + + public enum MessageQueueUserPermissionTupleFields + { + MessageQueueUserPermission, + Component_, + MessageQueue_, + User_, + Permissions, + } + + public class MessageQueueUserPermissionTuple : IntermediateTuple + { + public MessageQueueUserPermissionTuple() : base(MsmqTupleDefinitions.MessageQueueUserPermission, null, null) + { + } + + public MessageQueueUserPermissionTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(MsmqTupleDefinitions.MessageQueueUserPermission, sourceLineNumber, id) + { + } + + public IntermediateField this[MessageQueueUserPermissionTupleFields index] => this.Fields[(int)index]; + + public string MessageQueueUserPermission + { + get => this.Fields[(int)MessageQueueUserPermissionTupleFields.MessageQueueUserPermission].AsString(); + set => this.Set((int)MessageQueueUserPermissionTupleFields.MessageQueueUserPermission, value); + } + + public string Component_ + { + get => this.Fields[(int)MessageQueueUserPermissionTupleFields.Component_].AsString(); + set => this.Set((int)MessageQueueUserPermissionTupleFields.Component_, value); + } + + public string MessageQueue_ + { + get => this.Fields[(int)MessageQueueUserPermissionTupleFields.MessageQueue_].AsString(); + set => this.Set((int)MessageQueueUserPermissionTupleFields.MessageQueue_, value); + } + + public string User_ + { + get => this.Fields[(int)MessageQueueUserPermissionTupleFields.User_].AsString(); + set => this.Set((int)MessageQueueUserPermissionTupleFields.User_, value); + } + + public int Permissions + { + get => this.Fields[(int)MessageQueueUserPermissionTupleFields.Permissions].AsNumber(); + set => this.Set((int)MessageQueueUserPermissionTupleFields.Permissions, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/MsmqTupleDefinitions.cs b/src/wixext/Tuples/MsmqTupleDefinitions.cs new file mode 100644 index 00000000..e6accdc6 --- /dev/null +++ b/src/wixext/Tuples/MsmqTupleDefinitions.cs @@ -0,0 +1,47 @@ +// 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. + +namespace WixToolset.Msmq +{ + using System; + using WixToolset.Data; + + public enum MsmqTupleDefinitionType + { + MessageQueue, + MessageQueueGroupPermission, + MessageQueueUserPermission, + } + + public static partial class MsmqTupleDefinitions + { + public static readonly Version Version = new Version("4.0.0"); + + public static IntermediateTupleDefinition ByName(string name) + { + if (!Enum.TryParse(name, out MsmqTupleDefinitionType type)) + { + return null; + } + + return ByType(type); + } + + public static IntermediateTupleDefinition ByType(MsmqTupleDefinitionType type) + { + switch (type) + { + case MsmqTupleDefinitionType.MessageQueue: + return MsmqTupleDefinitions.MessageQueue; + + case MsmqTupleDefinitionType.MessageQueueGroupPermission: + return MsmqTupleDefinitions.MessageQueueGroupPermission; + + case MsmqTupleDefinitionType.MessageQueueUserPermission: + return MsmqTupleDefinitions.MessageQueueUserPermission; + + default: + throw new ArgumentOutOfRangeException(nameof(type)); + } + } + } +} diff --git a/src/wixext/WixMsmqExtension.csproj b/src/wixext/WixMsmqExtension.csproj deleted file mode 100644 index e37d62a3..00000000 --- a/src/wixext/WixMsmqExtension.csproj +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - {B990D81B-9F60-4EEE-B31D-B5D1EAA799EE} - WixMsmqExtension - Library - WixToolset.Extensions - - - - - - - - $(RootNamespace).Data.tables.xml - - - $(RootNamespace).Xsd.msmq.xsd - - - WixToolset.Data.Serialize - WixToolset.Extensions.Serialize.Msmq - - - msmq.xsd - PreserveNewest - - - Data\msmq.wixlib - - - - - - - - - - - - false - - - - - diff --git a/src/wixext/WixToolset.Msmq.wixext.csproj b/src/wixext/WixToolset.Msmq.wixext.csproj new file mode 100644 index 00000000..2db75ff7 --- /dev/null +++ b/src/wixext/WixToolset.Msmq.wixext.csproj @@ -0,0 +1,32 @@ + + + + + + netstandard2.0 + WixToolset.Msmq + WiX Toolset MSMQ Extension + WiX Toolset MSMQ Extension + true + build + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixext/WixToolset.Msmq.wixext.targets b/src/wixext/WixToolset.Msmq.wixext.targets new file mode 100644 index 00000000..5f69fe48 --- /dev/null +++ b/src/wixext/WixToolset.Msmq.wixext.targets @@ -0,0 +1,11 @@ + + + + + + $(MSBuildThisFileDirectory)..\tools\WixToolset.Msmq.wixext.dll + + + + + diff --git a/src/wixext/messages.xml b/src/wixext/messages.xml deleted file mode 100644 index 5ab6417f..00000000 --- a/src/wixext/messages.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - The {0}/@{1} attribute cannot be specified unless the element has a component as an ancestor. A {0} that does not have a component ancestor is not installed. - - - - - - - The {0} element cannot be specified unless the element has a component as an ancestor. A {0} that does not have a component ancestor is not installed. - - - - - - The {0}/@{1} attribute cannot coexist with the {2} attribute's value of '{3}'. - - - - - - - The {0}/@{1} attribute's value, '{2}', cannot coexist with the {3} attribute's value of '{4}'. - - - - - - - - - - The {0}/@{1} cannot be provided unless the {2} attribute is provided with a value of '{3}'. - - - - - - - - - The {0}/@{1} attribute must be provided when {0} element is nested under a component. - - - - - - - A {0} element must have either a {1} attribute or a {2} attribute, or both set. - - - - - - - - A {0} element not nested under a component must have either a {1} attribute or a {2} attribute, or both set. - - - - - - - - - The MsmqAssembly element has a Type attribute with a value of 'native', but the element does not contain any MsmqComponent elements. All components contained in a native assembly must be listed, or they will not be correctly removed during uninstall. - - - - - diff --git a/src/wixlib/MsmqExtension.wixproj b/src/wixlib/MsmqExtension.wixproj deleted file mode 100644 index 6dcdfbc7..00000000 --- a/src/wixlib/MsmqExtension.wixproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - {42493058-5FC8-4F85-9884-FF3190E084B6} - msmq - Library - true - - - - - - - - - - - - - - diff --git a/src/wixlib/MsmqExtension.wxs b/src/wixlib/MsmqExtension.wxs index b8622580..eecdb22e 100644 --- a/src/wixlib/MsmqExtension.wxs +++ b/src/wixlib/MsmqExtension.wxs @@ -11,12 +11,12 @@ !(loc.MessageQueuingExecuteUninstall) - - - - - - + + + + + + VersionNT >= 500 @@ -25,7 +25,6 @@ - - + diff --git a/src/wixlib/caerr.wxi b/src/wixlib/caerr.wxi new file mode 100644 index 00000000..141942f2 --- /dev/null +++ b/src/wixlib/caerr.wxi @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/wixlib/msmq.wixproj b/src/wixlib/msmq.wixproj new file mode 100644 index 00000000..a0e28ba7 --- /dev/null +++ b/src/wixlib/msmq.wixproj @@ -0,0 +1,40 @@ + + + + + + + {42493058-5FC8-4F85-9884-FF3190E084B6} + msmq + Library + true + + + + + + + + + + + + + msmqca + {CAD56A7E-342B-4324-9DCB-BCEB8F3BC80D} + + + + + + + + + + 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}. + + + + + + diff --git a/src/wixlib/packages.config b/src/wixlib/packages.config new file mode 100644 index 00000000..f3d424e1 --- /dev/null +++ b/src/wixlib/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file -- cgit v1.2.3-55-g6feb