diff --git a/src/ext/ComPlus/ca/cpapproleexec.cpp b/src/ext/ComPlus/ca/cpapproleexec.cpp index e3b71e932..4b38b23c5 100644 --- a/src/ext/ComPlus/ca/cpapproleexec.cpp +++ b/src/ext/ComPlus/ca/cpapproleexec.cpp @@ -74,7 +74,7 @@ HRESULT CpiConfigureApplicationRoles( hr = CpiActionStartMessage(ppwzData, FALSE); ExitOnFailure(hr, "Failed to send action start message"); - // ger count + // get count int iCnt = 0; hr = WcaReadIntegerFromCaData(ppwzData, &iCnt); ExitOnFailure(hr, "Failed to read count"); @@ -218,7 +218,7 @@ HRESULT CpiConfigureUsersInApplicationRoles( hr = CpiActionStartMessage(ppwzData, FALSE); ExitOnFailure(hr, "Failed to send action start message"); - // ger count + // get count int iCnt = 0; hr = WcaReadIntegerFromCaData(ppwzData, &iCnt); ExitOnFailure(hr, "Failed to read count"); diff --git a/src/ext/ComPlus/ca/cpapprolesched.cpp b/src/ext/ComPlus/ca/cpapprolesched.cpp index 04de6b65a..a92c340c5 100644 --- a/src/ext/ComPlus/ca/cpapprolesched.cpp +++ b/src/ext/ComPlus/ca/cpapprolesched.cpp @@ -10,13 +10,13 @@ LPCWSTR vcsApplicationRoleQuery = enum eApplicationRoleQuery { arqApplicationRole = 1, arqApplication, arqComponent, arqName }; LPCWSTR vcsUserInApplicationRoleQuery = - L"SELECT `UserInApplicationRole`, `ApplicationRole_`, `ComPlusUserInApplicationRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusUserInApplicationRole`, `Wix4User` WHERE `User_` = `User`"; + L"SELECT `UserInApplicationRole`, `ApplicationRole_`, `Wix4ComPlusUserInAppRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusUserInAppRole`, `Wix4User` WHERE `User_` = `User`"; LPCWSTR vcsGroupInApplicationRoleQuery = - L"SELECT `GroupInApplicationRole`, `ApplicationRole_`, `ComPlusGroupInApplicationRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusGroupInApplicationRole`, `Wix4Group` WHERE `Group_` = `Group`"; + L"SELECT `GroupInApplicationRole`, `ApplicationRole_`, `Wix4ComPlusGroupInAppRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusGroupInAppRole`, `Wix4Group` WHERE `Group_` = `Group`"; enum eTrusteeInApplicationRoleQuery { tiarqUserInApplicationRole = 1, tiarqApplicationRole, tiarqComponent, tiarqDomain, tiarqName }; LPCWSTR vcsApplicationRolePropertyQuery = - L"SELECT `Name`, `Value` FROM `Wix4ComPlusApplicationRoleProperty` WHERE `ApplicationRole_` = ?"; + L"SELECT `Name`, `Value` FROM `Wix4ComPlusAppRoleProperty` WHERE `ApplicationRole_` = ?"; // property definitions @@ -95,7 +95,7 @@ HRESULT CpiApplicationRolesRead( // loop through all application roles hr = WcaOpenExecuteView(vcsApplicationRoleQuery, &hView); - ExitOnFailure(hr, "Failed to execute view on ComPlusApplicationRole table"); + ExitOnFailure(hr, "Failed to execute view on Wix4ComPlusApplicationRole table"); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { @@ -205,7 +205,7 @@ HRESULT CpiApplicationRolesVerifyInstall( if (!pItm->fReferencedForInstall && !(pItm->fHasComponent && WcaIsInstalling(pItm->isInstalled, pItm->isAction))) continue; - // if the role is referensed and is not a locater, it must be installed + // if the role is referenced and is not a locater, it must be installed if (pItm->fReferencedForInstall && pItm->fHasComponent && !CpiWillBeInstalled(pItm->isInstalled, pItm->isAction)) MessageExitOnFailure(hr = E_FAIL, msierrComPlusApplicationRoleDependency, "An application role is used by another entity being installed, but is not installed itself, key: %S", pItm->wzKey); @@ -235,7 +235,7 @@ HRESULT CpiApplicationRolesVerifyInstall( switch (er) { case IDABORT: - ExitOnFailure(hr = E_FAIL, "An application with a conflictiong name exists, key: %S", pItm->wzKey); + ExitOnFailure(hr = E_FAIL, "An application with a conflicting name exists, key: %S", pItm->wzKey); break; case IDRETRY: break; @@ -319,7 +319,7 @@ HRESULT CpiApplicationRolesInstall( int iActionType; // add action text - hr = CpiAddActionTextToActionData(L"CreateComPlusApplicationRoles", ppwzActionData); + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"CreateComPlusApplicationRoles"), ppwzActionData); ExitOnFailure(hr, "Failed to add action text to custom action data"); // add count to action data @@ -371,7 +371,7 @@ HRESULT CpiApplicationRolesUninstall( int iActionType; // add action text - hr = CpiAddActionTextToActionData(L"RemoveComPlusApplicationRoles", ppwzActionData); + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"RemoveComPlusApplicationRoles"), ppwzActionData); ExitOnFailure(hr, "Failed to add action text to custom action data"); // add count to action data @@ -477,7 +477,7 @@ HRESULT CpiUsersInApplicationRolesInstall( int iActionType; // add action text - hr = CpiAddActionTextToActionData(L"AddUsersToComPlusApplicationRoles", ppwzActionData); + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"AddUsersToComPlusApplicationRoles"), ppwzActionData); ExitOnFailure(hr, "Failed to add action text to custom action data"); // add count to action data @@ -529,7 +529,7 @@ HRESULT CpiUsersInApplicationRolesUninstall( int iActionType; // add action text - hr = CpiAddActionTextToActionData(L"RemoveUsersFromComPlusAppRoles", ppwzActionData); + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"RemoveUsersFromComPlusAppRoles"), ppwzActionData); ExitOnFailure(hr, "Failed to add action text to custom action data"); // add count to action data diff --git a/src/ext/ComPlus/ca/cpappsched.cpp b/src/ext/ComPlus/ca/cpappsched.cpp index 4d867f6bd..bcd3bb75b 100644 --- a/src/ext/ComPlus/ca/cpappsched.cpp +++ b/src/ext/ComPlus/ca/cpappsched.cpp @@ -255,7 +255,7 @@ HRESULT CpiApplicationsVerifyInstall( if (!pItm->fReferencedForInstall && !(pItm->fHasComponent && WcaIsInstalling(pItm->isInstalled, pItm->isAction))) continue; - // if the application is referensed and is not a locater, it must be installed + // if the application is referenced and is not a locater, it must be installed if (pItm->fReferencedForInstall && pItm->fHasComponent && !CpiWillBeInstalled(pItm->isInstalled, pItm->isAction)) MessageExitOnFailure(hr = E_FAIL, msierrComPlusApplicationDependency, "An application is used by another entity being installed, but is not installed itself, key: %S", pItm->wzKey); diff --git a/src/ext/ComPlus/ca/cpasmexec.cpp b/src/ext/ComPlus/ca/cpasmexec.cpp index 3d140027c..af6c7eff2 100644 --- a/src/ext/ComPlus/ca/cpasmexec.cpp +++ b/src/ext/ComPlus/ca/cpasmexec.cpp @@ -1,7 +1,7 @@ // 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" - +#include // GAC related declarations @@ -61,13 +61,11 @@ IAssemblyCache : public IUnknown typedef HRESULT (__stdcall *LoadLibraryShimFunc)(LPCWSTR szDllName, LPCWSTR szVersion, LPVOID pvReserved, HMODULE *phModDll); typedef HRESULT (__stdcall *CreateAssemblyCacheFunc)(IAssemblyCache **ppAsmCache, DWORD dwReserved); +typedef HRESULT (__stdcall *GetFileVersionFnPtr)(LPCWSTR szFilename, _Out_writes_to_opt_(cchBuffer, *dwLength) LPWSTR szBuffer, DWORD cchBuffer, DWORD* dwLength); +typedef HRESULT (__stdcall *CorBindToRuntimeExFnPtr)(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, DWORD startupFlags, REFCLSID rclsid, REFIID riid, LPVOID FAR* ppv); // RegistrationHelper related declarations - -static const GUID CLSID_RegistrationHelper = - { 0x89a86e7b, 0xc229, 0x4008, { 0x9b, 0xaa, 0x2f, 0x5c, 0x84, 0x11, 0xd7, 0xe0 } }; - enum eInstallationFlags { ifConfigureComponentsOnly = 16, ifFindOrCreateTargetApplication = 4, @@ -156,7 +154,8 @@ static HRESULT UnregisterAssembly( static void InitAssemblyExec(); static void UninitAssemblyExec(); static HRESULT GetRegistrationHelper( - IDispatch** ppiRegHlp + IDispatch** ppiRegHlp, + LPCWSTR pwzAssemblyPath ); static HRESULT GetAssemblyCacheObject( IAssemblyCache** ppAssemblyCache @@ -722,15 +721,44 @@ static void UninitAssemblyExec() } static HRESULT GetRegistrationHelper( - IDispatch** ppiRegHlp + IDispatch** ppiRegHlp, + LPCWSTR pwzAssemblyPath ) { HRESULT hr = S_OK; + wchar_t pwzVersion[MAX_PATH]; + DWORD pcchVersionLen = MAX_PATH; + ICLRRuntimeHost* runtimeHost = NULL; + + if (!ghMscoree) + { + ghMscoree = ::LoadLibraryW(L"mscoree.dll"); + ExitOnNull(ghMscoree, hr, E_FAIL, "Failed to load mscoree.dll"); + } + GetFileVersionFnPtr GetFileVersion = (GetFileVersionFnPtr)::GetProcAddress(ghMscoree, "GetFileVersion"); + ExitOnNull(GetFileVersion, hr, E_FAIL, "Failed to GetProcAddress for 'GetFileVersion' from 'mscoree.dll'"); + hr = GetFileVersion(pwzAssemblyPath, pwzVersion, pcchVersionLen, &pcchVersionLen); if (!gpiRegHlp) { + CLSID CLSID_RegistrationHelper{}; + hr = ::CLSIDFromProgID(OLESTR("System.EnterpriseServices.RegistrationHelper"), &CLSID_RegistrationHelper); + ExitOnFailure(hr, "Failed to identify CLSID for 'System.EnterpriseServices.RegistrationHelper'"); + + // NOTE: The 'CoreBindToRuntimeEx' method is DEPRECATED in .NET v4. + // HOWEVER, we might be running in an earlier context at this point so we don't want to rely upon stuff that is particularly v4 dependent. + // Even if we are about to try to fire up a v4 runtime. + // The .NET v4 runtime with STARTUP_LOADER_SAFEMODE flag (to disable version checking of loaded assemblies) is what lets us launch the + // RegistrationHelper. The v4 RegistrationHelper is able to register both v4 and v3 assemblies however, so if we can get it, we most as well + // use it. + CorBindToRuntimeExFnPtr CorBindToRuntimeEx = (CorBindToRuntimeExFnPtr)::GetProcAddress(ghMscoree, "CorBindToRuntimeEx"); + hr = CorBindToRuntimeEx(L"v4.0.30319", L"wks", STARTUP_LOADER_SAFEMODE, CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (LPVOID*)&runtimeHost); + // we ignore the HRESULT here. If it worked, great, we'll use it moving forward. If it didn't work, we'll end up trying to resort to legacy .NET FW + // when we just try the COM Create below + // create registration helper object - hr = ::CoCreateInstance(CLSID_RegistrationHelper, NULL, CLSCTX_ALL, IID_IDispatch, (void**)&gpiRegHlp); + // This will be created in the .NET FW 4 version if we managed to launch it above, or in the .NET FW <4 version based on the COM dispatch otherwise + hr = ::CoCreateInstance(CLSID_RegistrationHelper, NULL, CLSCTX_ALL, IID_IDispatch, (void**)&gpiRegHlp); ExitOnFailure(hr, "Failed to create registration helper object"); } @@ -883,7 +911,7 @@ static HRESULT RegisterDotNetAssembly( } // get registration helper object - hr = GetRegistrationHelper(&piRegHlp); + hr = GetRegistrationHelper(&piRegHlp, pAttrs->pwzDllPath); ExitOnFailure(hr, "Failed to get registration helper object"); // get dispatch id of InstallAssembly() method @@ -979,7 +1007,7 @@ static HRESULT RegisterNativeAssembly( ExitOnNull(bstrTlbPath, hr, E_OUTOFMEMORY, "Failed to allocate BSTR for tlb path"); bstrPSDllPath = ::SysAllocString(pAttrs->pwzPSDllPath ? pAttrs->pwzPSDllPath : L""); - ExitOnNull(bstrPSDllPath, hr, E_OUTOFMEMORY, "Failed to allocate BSTR for tlb path"); + ExitOnNull(bstrPSDllPath, hr, E_OUTOFMEMORY, "Failed to allocate BSTR for proxy/stub dll path"); // get catalog hr = CpiExecGetAdminCatalog(&piCatalog); @@ -1089,7 +1117,7 @@ static HRESULT UnregisterDotNetAssembly( ExitOnNull(bstrDllPath, hr, E_OUTOFMEMORY, "Failed to allocate BSTR for dll path"); // get registration helper object - hr = GetRegistrationHelper(&piRegHlp); + hr = GetRegistrationHelper(&piRegHlp, pAttrs->pwzDllPath); ExitOnFailure(hr, "Failed to get registration helper object"); // get dispatch id of UninstallAssembly() method diff --git a/src/ext/ComPlus/ca/cpasmsched.cpp b/src/ext/ComPlus/ca/cpasmsched.cpp index 325808dee..044b2ef89 100644 --- a/src/ext/ComPlus/ca/cpasmsched.cpp +++ b/src/ext/ComPlus/ca/cpasmsched.cpp @@ -408,7 +408,7 @@ HRESULT CpiAssembliesVerifyInstall( if (!pItm->fReferencedForInstall && !pItm->iRoleAssignmentsInstallCount && !WcaIsInstalling(pItm->isInstalled, pItm->isAction)) continue; - // if the assembly is referensed, it must be installed + // if the assembly is referenced, it must be installed if ((pItm->fReferencedForInstall || pItm->iRoleAssignmentsInstallCount) && !CpiWillBeInstalled(pItm->isInstalled, pItm->isAction)) MessageExitOnFailure(hr = E_FAIL, msierrComPlusAssemblyDependency, "An assembly is used by another entity being installed, but is not installed itself, key: %S", pItm->wzKey); } diff --git a/src/ext/ComPlus/ca/cpexec.cpp b/src/ext/ComPlus/ca/cpexec.cpp index 9b1691fc3..a915dd341 100644 --- a/src/ext/ComPlus/ca/cpexec.cpp +++ b/src/ext/ComPlus/ca/cpexec.cpp @@ -180,7 +180,7 @@ extern "C" UINT __stdcall ComPlusInstallExecute(MSIHANDLE hInstall) if (INVALID_HANDLE_VALUE != hRollbackFile) ::CloseHandle(hRollbackFile); - // unitialize + // uninitialize CpiExecFinalize(); if (fInitializedCom) @@ -258,7 +258,7 @@ extern "C" UINT __stdcall ComPlusInstallExecuteCommit(MSIHANDLE hInstall) if (INVALID_HANDLE_VALUE != hRollbackFile) ::CloseHandle(hRollbackFile); - // unitialize + // uninitialize CpiExecFinalize(); if (fInitializedCom) @@ -415,7 +415,7 @@ extern "C" UINT __stdcall ComPlusRollbackInstallExecute(MSIHANDLE hInstall) if (prdSubscriptions) CpiFreeRollbackDataList(prdSubscriptions); - // unitialize + // uninitialize CpiExecFinalize(); if (fInitializedCom) @@ -521,7 +521,7 @@ extern "C" UINT __stdcall ComPlusUninstallExecute(MSIHANDLE hInstall) if (INVALID_HANDLE_VALUE != hRollbackFile) ::CloseHandle(hRollbackFile); - // unitialize + // uninitialize CpiExecFinalize(); if (fInitializedCom) @@ -670,7 +670,7 @@ extern "C" UINT __stdcall ComPlusRollbackUninstallExecute(MSIHANDLE hInstall) if (prdSubscriptions) CpiFreeRollbackDataList(prdSubscriptions); - // unitialize + // uninitialize CpiExecFinalize(); if (fInitializedCom) diff --git a/src/ext/ComPlus/ca/cppartexec.cpp b/src/ext/ComPlus/ca/cppartexec.cpp index 673bdaf9f..06aa16f49 100644 --- a/src/ext/ComPlus/ca/cppartexec.cpp +++ b/src/ext/ComPlus/ca/cppartexec.cpp @@ -34,6 +34,7 @@ static HRESULT ReadPartitionAttributes( static void FreePartitionAttributes( CPI_PARTITION_ATTRIBUTES* pAttrs ); +static HRESULT CpiEnsurePartitionsEnabled(); static HRESULT CreatePartition( CPI_PARTITION_ATTRIBUTES* pAttrs ); @@ -71,7 +72,7 @@ HRESULT CpiConfigurePartitions( hr = CpiActionStartMessage(ppwzData, FALSE); ExitOnFailure(hr, "Failed to send action start message"); - // ger partition count + // get partition count int iCnt = 0; hr = WcaReadIntegerFromCaData(ppwzData, &iCnt); ExitOnFailure(hr, "Failed to read count"); @@ -215,7 +216,7 @@ HRESULT CpiConfigurePartitionUsers( hr = CpiActionStartMessage(ppwzData, FALSE); ExitOnFailure(hr, "Failed to send action start message"); - // ger partition count + // get partition count int iCnt = 0; hr = WcaReadIntegerFromCaData(ppwzData, &iCnt); ExitOnFailure(hr, "Failed to read count"); @@ -384,6 +385,69 @@ static void FreePartitionAttributes( CpiFreePropertyList(pAttrs->pPropList); } +static HRESULT CpiEnsurePartitionsEnabled() +{ + HRESULT hr = S_OK; + + ICatalogCollection* piLocalComputerColl = NULL; + IDispatch* piDisp = NULL; + ICatalogObject* piLocalComputerObj = NULL; + VARIANT vtVal; + BSTR bsPartitionsEnabledName = ::SysAllocString(L"PartitionsEnabled"); + long numChanges = 0; + + ::VariantInit(&vtVal); + + // get collection + hr = CpiExecGetCatalogCollection(L"LocalComputer", &piLocalComputerColl); + ExitOnFailure(hr, "Failed to get catalog collection"); + + // find object, there will be only one in the LocalComputer collection + hr = piLocalComputerColl->get_Item(0, &piDisp); + ExitOnFailure(hr, "Failed to get object from collection"); + + hr = piDisp->QueryInterface(IID_ICatalogObject, (void**)&piLocalComputerObj); + ExitOnFailure(hr, "Failed to get IID_ICatalogObject interface"); + + // and then we get the value of the PartitionsEnabled property + hr = piLocalComputerObj->get_Value(bsPartitionsEnabledName, &vtVal); + if (!vtVal.boolVal) + { + vtVal.boolVal = true; + hr = piLocalComputerObj->put_Value(bsPartitionsEnabledName, vtVal); + ExitOnFailure(hr, "Failed to put value to Enable COM+ PartitionsEnabled property"); + hr = piLocalComputerColl->SaveChanges(&numChanges); + ExitOnFailure(hr, "Failed to save PartitionsEnabled property"); + + // we'll read back the hopefully updated values of the PartitionsEnabled property + // if it's still False, then we're on a Windows Desktop that doesn't allow Partitions + // (as of Windows Server2003 Microsoft limited Partitions to only ServerOS platforms) + hr = piLocalComputerObj->get_Value(bsPartitionsEnabledName, &vtVal); + ExitOnFailure(hr, "Failed to read PartitionsEnabled property"); + } + + if (vtVal.boolVal) + { + // everything went well, we have the Partitioning available + hr = S_OK; + } + else + { + // we're on a Desktop OS, or couldn't otherwise enable partitioning + WcaLog(LOGMSG_STANDARD, "Failed to Enable COM+ PartitionEnabled property. This suggests Partitioning was attempted on a Desktop OS, which is not supported"); + hr = S_FALSE; + } + +LExit: + // clean up + ReleaseObject(piLocalComputerColl); + ReleaseObject(piLocalComputerObj); + ReleaseBSTR(bsPartitionsEnabledName); + ::VariantClear(&vtVal); + + return hr; +} + static HRESULT CreatePartition( CPI_PARTITION_ATTRIBUTES* pAttrs ) @@ -408,6 +472,9 @@ static HRESULT CreatePartition( if (S_FALSE == hr) { + hr = CpiEnsurePartitionsEnabled(); + ExitOnFailure(hr, "Failed to enable partitions"); + // create partition hr = CpiAddCollectionObject(piPartColl, &piPartObj); ExitOnFailure(hr, "Failed to add partition to collection"); diff --git a/src/ext/ComPlus/ca/cppartroleexec.cpp b/src/ext/ComPlus/ca/cppartroleexec.cpp index 4a503c79c..910473e00 100644 --- a/src/ext/ComPlus/ca/cppartroleexec.cpp +++ b/src/ext/ComPlus/ca/cppartroleexec.cpp @@ -49,7 +49,7 @@ HRESULT CpiConfigureUsersInPartitionRoles( hr = CpiActionStartMessage(ppwzData, FALSE); ExitOnFailure(hr, "Failed to send action start message"); - // ger count + // get count int iCnt = 0; hr = WcaReadIntegerFromCaData(ppwzData, &iCnt); ExitOnFailure(hr, "Failed to read count"); diff --git a/src/ext/ComPlus/ca/cppartrolesched.cpp b/src/ext/ComPlus/ca/cppartrolesched.cpp index 0ca4bf0c5..b2fb51186 100644 --- a/src/ext/ComPlus/ca/cppartrolesched.cpp +++ b/src/ext/ComPlus/ca/cppartrolesched.cpp @@ -10,9 +10,9 @@ LPCWSTR vcsPartitionRoleQuery = enum ePartitionRoleQuery { prqPartitionRole = 1, prqPartition, prqComponent, prqName }; LPCWSTR vcsUserInPartitionRoleQuery = - L"SELECT `UserInPartitionRole`, `PartitionRole_`, `ComPlusUserInPartitionRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusUserInPartitionRole`, `Wix4User` WHERE `User_` = `User`"; + L"SELECT `UserInPartitionRole`, `PartitionRole_`, `Wix4ComPlusUserInPartitionRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusUserInPartitionRole`, `Wix4User` WHERE `User_` = `User`"; LPCWSTR vcsGroupInPartitionRoleQuery = - L"SELECT `GroupInPartitionRole`, `PartitionRole_`, `ComPlusGroupInPartitionRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusGroupInPartitionRole`, `Wix4Group` WHERE `Group_` = `Group`"; + L"SELECT `GroupInPartitionRole`, `PartitionRole_`, `Wix4ComPlusGroupInPartitionRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusGroupInPartitionRole`, `Wix4Group` WHERE `Group_` = `Group`"; enum eTrusteeInPartitionRoleQuery { tiprqUserInPartitionRole = 1, tiprqPartitionRole, tiprqComponent, tiprqDomain, tiprqName }; diff --git a/src/ext/ComPlus/ca/cppartsched.cpp b/src/ext/ComPlus/ca/cppartsched.cpp index d4065d34e..b4c1c3141 100644 --- a/src/ext/ComPlus/ca/cppartsched.cpp +++ b/src/ext/ComPlus/ca/cppartsched.cpp @@ -13,7 +13,7 @@ LPCWSTR vcsPartitionPropertyQuery = L"SELECT `Name`, `Value` FROM `Wix4ComPlusPartitionProperty` WHERE `Partition_` = ?"; LPCWSTR vcsPartitionUserQuery = - L"SELECT `PartitionUser`, `Partition_`, `ComPlusPartitionUser`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusPartitionUser`, `Wix4User` WHERE `User_` = `User`"; + L"SELECT `PartitionUser`, `Partition_`, `Wix4ComPlusPartitionUser`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusPartitionUser`, `Wix4User` WHERE `User_` = `User`"; enum ePartitionUserQuery { puqPartitionUser = 1, puqPartition, puqComponent, puqDomain, puqName }; @@ -192,7 +192,7 @@ HRESULT CpiPartitionsVerifyInstall( if (!pItm->fReferencedForInstall && !(pItm->fHasComponent && WcaIsInstalling(pItm->isInstalled, pItm->isAction))) continue; - // if the partition is referensed and is not a locater, it must be installed + // if the partition is referenced and is not a locater, it must be installed if (pItm->fReferencedForInstall && pItm->fHasComponent && !CpiWillBeInstalled(pItm->isInstalled, pItm->isAction)) MessageExitOnFailure(hr = E_FAIL, msierrComPlusPartitionDependency, "A partition is used by another entity being installed, but is not installed itself, key: %S", pItm->wzKey); @@ -281,7 +281,7 @@ HRESULT CpiPartitionsVerifyInstall( { case IDCANCEL: case IDABORT: - ExitOnFailure(hr = E_FAIL, "A partition with a conflictiong name or id exists, key: %S", pItm->wzKey); + ExitOnFailure(hr = E_FAIL, "A partition with a conflicting name or id exists, key: %S", pItm->wzKey); break; case IDRETRY: break; @@ -403,7 +403,7 @@ HRESULT CpiPartitionsInstall( int iActionType; // add action text - hr = CpiAddActionTextToActionData(L"CreateComPlusPartitions", ppwzActionData); + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"CreateComPlusPartitions"), ppwzActionData); ExitOnFailure(hr, "Failed to add action text to custom action data"); // add partition count to action data @@ -455,7 +455,7 @@ HRESULT CpiPartitionsUninstall( int iActionType; // add action text - hr = CpiAddActionTextToActionData(L"RemoveComPlusPartitions", ppwzActionData); + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"RemoveComPlusPartitions"), ppwzActionData); ExitOnFailure(hr, "Failed to add action text to custom action data"); // add partition count to action data @@ -735,7 +735,7 @@ HRESULT CpiPartitionUsersInstall( int iActionType; // add action text - hr = CpiAddActionTextToActionData(L"AddComPlusPartitionUsers", ppwzActionData); + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"AddComPlusPartitionUsers"), ppwzActionData); ExitOnFailure(hr, "Failed to add action text to custom action data"); // add partition count to action data @@ -787,7 +787,7 @@ HRESULT CpiPartitionUsersUninstall( int iActionType; // add action text - hr = CpiAddActionTextToActionData(L"RemoveComPlusPartitionUsers", ppwzActionData); + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"RemoveComPlusPartitionUsers"), ppwzActionData); ExitOnFailure(hr, "Failed to add action text to custom action data"); // add partition count to action data diff --git a/src/ext/ComPlus/ca/cpsched.cpp b/src/ext/ComPlus/ca/cpsched.cpp index ebc547ae0..acde3cd31 100644 --- a/src/ext/ComPlus/ca/cpsched.cpp +++ b/src/ext/ComPlus/ca/cpsched.cpp @@ -3,31 +3,17 @@ #include "precomp.h" -#ifdef _WIN64 -#define CP_COMPLUSROLLBACKINSTALLPREPARE L"ComPlusRollbackInstallPrepare_64" -#define CP_COMPLUSINSTALLPREPARE L"ComPlusInstallPrepare_64" -#define CP_COMPLUSROLLBACKINSTALLEXECUTE L"ComPlusRollbackInstallExecute_64" -#define CP_COMPLUSINSTALLEXECUTE L"ComPlusInstallExecute_64" -#define CP_COMPLUSINSTALLEXECUTECOMMIT L"ComPlusInstallExecuteCommit_64" -#define CP_COMPLUSINSTALLCOMMIT L"ComPlusInstallCommit_64" -#define CP_COMPLUSROLLBACKINSTALLPREPARE L"ComPlusRollbackInstallPrepare_64" -#define CP_COMPLUSINSTALLPREPARE L"ComPlusInstallPrepare_64" -#define CP_COMPLUSROLLBACKUNINSTALLEXECUTE L"ComPlusRollbackUninstallExecute_64" -#define CP_COMPLUSUNINSTALLEXECUTE L"ComPlusUninstallExecute_64" -#define CP_COMPLUSINSTALLCOMMIT L"ComPlusInstallCommit_64" -#else -#define CP_COMPLUSROLLBACKINSTALLPREPARE L"ComPlusRollbackInstallPrepare" -#define CP_COMPLUSINSTALLPREPARE L"ComPlusInstallPrepare" -#define CP_COMPLUSROLLBACKINSTALLEXECUTE L"ComPlusRollbackInstallExecute" -#define CP_COMPLUSINSTALLEXECUTE L"ComPlusInstallExecute" -#define CP_COMPLUSINSTALLEXECUTECOMMIT L"ComPlusInstallExecuteCommit" -#define CP_COMPLUSINSTALLCOMMIT L"ComPlusInstallCommit" -#define CP_COMPLUSROLLBACKINSTALLPREPARE L"ComPlusRollbackInstallPrepare" -#define CP_COMPLUSINSTALLPREPARE L"ComPlusInstallPrepare" -#define CP_COMPLUSROLLBACKUNINSTALLEXECUTE L"ComPlusRollbackUninstallExecute" -#define CP_COMPLUSUNINSTALLEXECUTE L"ComPlusUninstallExecute" -#define CP_COMPLUSINSTALLCOMMIT L"ComPlusInstallCommit" -#endif +#define CP_COMPLUSROLLBACKINSTALLPREPARE CUSTOM_ACTION_DECORATION(L"ComPlusRollbackInstallPrepare") +#define CP_COMPLUSINSTALLPREPARE CUSTOM_ACTION_DECORATION(L"ComPlusInstallPrepare") +#define CP_COMPLUSROLLBACKINSTALLEXECUTE CUSTOM_ACTION_DECORATION(L"ComPlusRollbackInstallExecute") +#define CP_COMPLUSINSTALLEXECUTE CUSTOM_ACTION_DECORATION(L"ComPlusInstallExecute") +#define CP_COMPLUSINSTALLEXECUTECOMMIT CUSTOM_ACTION_DECORATION(L"ComPlusInstallExecuteCommit") +#define CP_COMPLUSINSTALLCOMMIT CUSTOM_ACTION_DECORATION(L"ComPlusInstallCommit") +#define CP_COMPLUSROLLBACKINSTALLPREPARE CUSTOM_ACTION_DECORATION(L"ComPlusRollbackInstallPrepare") +#define CP_COMPLUSINSTALLPREPARE CUSTOM_ACTION_DECORATION(L"ComPlusInstallPrepare") +#define CP_COMPLUSROLLBACKUNINSTALLEXECUTE CUSTOM_ACTION_DECORATION(L"ComPlusRollbackUninstallExecute") +#define CP_COMPLUSUNINSTALLEXECUTE CUSTOM_ACTION_DECORATION(L"ComPlusUninstallExecute") +#define CP_COMPLUSINSTALLCOMMIT CUSTOM_ACTION_DECORATION(L"ComPlusInstallCommit") /******************************************************************** ConfigureComPlusInstall - CUSTOM ACTION ENTRY POINT for installing COM+ components @@ -81,7 +67,7 @@ extern "C" UINT __stdcall ConfigureComPlusInstall(MSIHANDLE hInstall) CpiSchedInitialize(); - // check for the prerequsite tables + // check for the prerequisite tables if (!CpiTableExists(cptComPlusPartition) && !CpiTableExists(cptComPlusApplication) && !CpiTableExists(cptComPlusAssembly)) { WcaLog(LOGMSG_VERBOSE, "skipping install COM+ CustomAction, no ComPlusPartition, ComPlusApplication or ComPlusAssembly table present"); @@ -117,55 +103,55 @@ extern "C" UINT __stdcall ConfigureComPlusInstall(MSIHANDLE hInstall) if (502 <= iVersionNT && CpiTableExists(cptComPlusPartition)) { hr = CpiPartitionsRead(&partList); - MessageExitOnFailure(hr, msierrComPlusPartitionReadFailed, "Failed to read ComPlusPartitions table"); + MessageExitOnFailure(hr, msierrComPlusPartitionReadFailed, "Failed to read Wix4ComPlusPartitions table"); } if (502 <= iVersionNT && CpiTableExists(cptComPlusPartitionRole)) { hr = CpiPartitionRolesRead(&partList, &partRoleList); - MessageExitOnFailure(hr, msierrComPlusPartitionRoleReadFailed, "Failed to read ComPlusPartitionRole table"); + MessageExitOnFailure(hr, msierrComPlusPartitionRoleReadFailed, "Failed to read Wix4ComPlusPartitionRole table"); } if (502 <= iVersionNT && (CpiTableExists(cptComPlusUserInPartitionRole) || CpiTableExists(cptComPlusGroupInPartitionRole))) { hr = CpiUsersInPartitionRolesRead(&partRoleList, &usrInPartRoleList); - MessageExitOnFailure(hr, msierrComPlusUserInPartitionRoleReadFailed, "Failed to read ComPlusUserInPartitionRole table"); + MessageExitOnFailure(hr, msierrComPlusUserInPartitionRoleReadFailed, "Failed to read Wix4ComPlusUserInPartitionRole table"); } if (502 <= iVersionNT && CpiTableExists(cptComPlusPartitionUser)) { hr = CpiPartitionUsersRead(&partList, &partUsrList); - MessageExitOnFailure(hr, msierrComPlusPartitionUserReadFailed, "Failed to read ComPlusPartitionUser table"); + MessageExitOnFailure(hr, msierrComPlusPartitionUserReadFailed, "Failed to read Wix4ComPlusPartitionUser table"); } if (CpiTableExists(cptComPlusApplication)) { hr = CpiApplicationsRead(&partList, &appList); - MessageExitOnFailure(hr, msierrComPlusApplicationReadFailed, "Failed to read ComPlusApplication table"); + MessageExitOnFailure(hr, msierrComPlusApplicationReadFailed, "Failed to read Wix4ComPlusApplication table"); } if (CpiTableExists(cptComPlusApplicationRole)) { hr = CpiApplicationRolesRead(&appList, &appRoleList); - MessageExitOnFailure(hr, msierrComPlusApplicationRoleReadFailed, "Failed to read ComPlusApplicationRole table"); + MessageExitOnFailure(hr, msierrComPlusApplicationRoleReadFailed, "Failed to read Wix4ComPlusApplicationRole table"); } if (CpiTableExists(cptComPlusUserInApplicationRole) || CpiTableExists(cptComPlusGroupInApplicationRole)) { hr = CpiUsersInApplicationRolesRead(&appRoleList, &usrInAppRoleList); - MessageExitOnFailure(hr, msierrComPlusUserInApplicationRoleReadFailed, "Failed to read ComPlusUserInApplicationRole table"); + MessageExitOnFailure(hr, msierrComPlusUserInApplicationRoleReadFailed, "Failed to read Wix4ComPlusUserInApplicationRole table"); } if (CpiTableExists(cptComPlusAssembly)) { hr = CpiAssembliesRead(&appList, &appRoleList, &asmList); - MessageExitOnFailure(hr, msierrComPlusAssembliesReadFailed, "Failed to read ComPlusAssembly table"); + MessageExitOnFailure(hr, msierrComPlusAssembliesReadFailed, "Failed to read Wix4ComPlusAssembly table"); } if (CpiTableExists(cptComPlusSubscription)) { hr = CpiSubscriptionsRead(&asmList, &subList); - MessageExitOnFailure(hr, msierrComPlusSubscriptionReadFailed, "Failed to read ComPlusSubscription table"); + MessageExitOnFailure(hr, msierrComPlusSubscriptionReadFailed, "Failed to read Wix4ComPlusSubscription table"); } // verify elements @@ -295,7 +281,7 @@ extern "C" UINT __stdcall ConfigureComPlusInstall(MSIHANDLE hInstall) CpiAssemblyListFree(&asmList); CpiSubscriptionListFree(&subList); - // unitialize + // uninitialize CpiSchedFinalize(); if (fInitializedCom) @@ -359,7 +345,7 @@ extern "C" UINT __stdcall ConfigureComPlusUninstall(MSIHANDLE hInstall) // check for the prerequsite tables if (!CpiTableExists(cptComPlusPartition) && !CpiTableExists(cptComPlusApplication) && !CpiTableExists(cptComPlusAssembly)) { - WcaLog(LOGMSG_VERBOSE, "skipping uninstall COM+ CustomAction, no ComPlusPartition, ComPlusApplication or ComPlusAssembly table present"); + WcaLog(LOGMSG_VERBOSE, "skipping uninstall COM+ CustomAction, no Wix4ComPlusPartition, Wix4ComPlusApplication or Wix4ComPlusAssembly table present"); ExitFunction1(hr = S_FALSE); } @@ -392,55 +378,55 @@ extern "C" UINT __stdcall ConfigureComPlusUninstall(MSIHANDLE hInstall) if (502 <= iVersionNT && CpiTableExists(cptComPlusPartition)) { hr = CpiPartitionsRead(&partList); - MessageExitOnFailure(hr, msierrComPlusPartitionReadFailed, "Failed to read ComPlusPartitions table"); + MessageExitOnFailure(hr, msierrComPlusPartitionReadFailed, "Failed to read Wix4ComPlusPartitions table"); } if (502 <= iVersionNT && CpiTableExists(cptComPlusPartitionRole)) { hr = CpiPartitionRolesRead(&partList, &partRoleList); - MessageExitOnFailure(hr, msierrComPlusPartitionRoleReadFailed, "Failed to read ComPlusPartitionRole table"); + MessageExitOnFailure(hr, msierrComPlusPartitionRoleReadFailed, "Failed to read Wix4ComPlusPartitionRole table"); } if (502 <= iVersionNT && (CpiTableExists(cptComPlusUserInPartitionRole) || CpiTableExists(cptComPlusGroupInPartitionRole))) { hr = CpiUsersInPartitionRolesRead(&partRoleList, &usrInPartRoleList); - MessageExitOnFailure(hr, msierrComPlusUserInPartitionRoleReadFailed, "Failed to read ComPlusUserInPartitionRole table"); + MessageExitOnFailure(hr, msierrComPlusUserInPartitionRoleReadFailed, "Failed to read Wix4ComPlusUserInPartitionRole table"); } if (502 <= iVersionNT && CpiTableExists(cptComPlusPartitionUser)) { hr = CpiPartitionUsersRead(&partList, &partUsrList); - MessageExitOnFailure(hr, msierrComPlusPartitionUserReadFailed, "Failed to read ComPlusPartitionUser table"); + MessageExitOnFailure(hr, msierrComPlusPartitionUserReadFailed, "Failed to read Wix4ComPlusPartitionUser table"); } if (CpiTableExists(cptComPlusApplication)) { hr = CpiApplicationsRead(&partList, &appList); - MessageExitOnFailure(hr, msierrComPlusApplicationReadFailed, "Failed to read ComPlusApplication table"); + MessageExitOnFailure(hr, msierrComPlusApplicationReadFailed, "Failed to read Wix4ComPlusApplication table"); } if (CpiTableExists(cptComPlusApplicationRole)) { hr = CpiApplicationRolesRead(&appList, &appRoleList); - MessageExitOnFailure(hr, msierrComPlusApplicationRoleReadFailed, "Failed to read ComPlusApplicationRole table"); + MessageExitOnFailure(hr, msierrComPlusApplicationRoleReadFailed, "Failed to read Wix4ComPlusApplicationRole table"); } if (CpiTableExists(cptComPlusUserInApplicationRole) || CpiTableExists(cptComPlusGroupInApplicationRole)) { hr = CpiUsersInApplicationRolesRead(&appRoleList, &usrInAppRoleList); - MessageExitOnFailure(hr, msierrComPlusUserInApplicationRoleReadFailed, "Failed to read ComPlusUserInApplicationRole table"); + MessageExitOnFailure(hr, msierrComPlusUserInApplicationRoleReadFailed, "Failed to read Wix4ComPlusUserInApplicationRole table"); } if (CpiTableExists(cptComPlusAssembly)) { hr = CpiAssembliesRead(&appList, &appRoleList, &asmList); - MessageExitOnFailure(hr, msierrComPlusAssembliesReadFailed, "Failed to read ComPlusAssembly table"); + MessageExitOnFailure(hr, msierrComPlusAssembliesReadFailed, "Failed to read Wix4ComPlusAssembly table"); } if (CpiTableExists(cptComPlusSubscription)) { hr = CpiSubscriptionsRead(&asmList, &subList); - MessageExitOnFailure(hr, msierrComPlusSubscriptionReadFailed, "Failed to read ComPlusSubscription table"); + MessageExitOnFailure(hr, msierrComPlusSubscriptionReadFailed, "Failed to read Wix4ComPlusSubscription table"); } // verify elements @@ -555,7 +541,7 @@ extern "C" UINT __stdcall ConfigureComPlusUninstall(MSIHANDLE hInstall) CpiAssemblyListFree(&asmList); CpiSubscriptionListFree(&subList); - // unitialize + // uninitialize CpiSchedFinalize(); if (fInitializedCom) diff --git a/src/ext/ComPlus/ca/cpsubsexec.cpp b/src/ext/ComPlus/ca/cpsubsexec.cpp index bbcf98537..ab32b856a 100644 --- a/src/ext/ComPlus/ca/cpsubsexec.cpp +++ b/src/ext/ComPlus/ca/cpsubsexec.cpp @@ -54,7 +54,7 @@ HRESULT CpiConfigureSubscriptions( hr = CpiActionStartMessage(ppwzData, FALSE); ExitOnFailure(hr, "Failed to send action start message"); - // ger count + // get count int iCnt = 0; hr = WcaReadIntegerFromCaData(ppwzData, &iCnt); ExitOnFailure(hr, "Failed to read count"); @@ -127,7 +127,7 @@ HRESULT CpiRollbackConfigureSubscriptions( hr = CpiActionStartMessage(ppwzData, NULL == pRollbackDataList); ExitOnFailure(hr, "Failed to send action start message"); - // ger count + // get count int iCnt = 0; hr = WcaReadIntegerFromCaData(ppwzData, &iCnt); ExitOnFailure(hr, "Failed to read count"); diff --git a/src/ext/ComPlus/ca/cputilsched.cpp b/src/ext/ComPlus/ca/cputilsched.cpp index 4a2fdfc60..760b5ec9c 100644 --- a/src/ext/ComPlus/ca/cputilsched.cpp +++ b/src/ext/ComPlus/ca/cputilsched.cpp @@ -53,31 +53,31 @@ void CpiSchedInitialize() // tables giTables = 0; - if (S_OK == WcaTableExists(L"ComPlusPartition")) giTables |= cptComPlusPartition; - if (S_OK == WcaTableExists(L"ComPlusPartitionProperty")) giTables |= cptComPlusPartitionProperty; - if (S_OK == WcaTableExists(L"ComPlusPartitionRole")) giTables |= cptComPlusPartitionRole; - if (S_OK == WcaTableExists(L"ComPlusUserInPartitionRole")) giTables |= cptComPlusUserInPartitionRole; - if (S_OK == WcaTableExists(L"ComPlusGroupInPartitionRole")) giTables |= cptComPlusGroupInPartitionRole; - if (S_OK == WcaTableExists(L"ComPlusPartitionUser")) giTables |= cptComPlusPartitionUser; - if (S_OK == WcaTableExists(L"ComPlusApplication")) giTables |= cptComPlusApplication; - if (S_OK == WcaTableExists(L"ComPlusApplicationProperty")) giTables |= cptComPlusApplicationProperty; - if (S_OK == WcaTableExists(L"ComPlusApplicationRole")) giTables |= cptComPlusApplicationRole; - if (S_OK == WcaTableExists(L"ComPlusApplicationRoleProperty")) giTables |= cptComPlusApplicationRoleProperty; - if (S_OK == WcaTableExists(L"ComPlusUserInApplicationRole")) giTables |= cptComPlusUserInApplicationRole; - if (S_OK == WcaTableExists(L"ComPlusGroupInApplicationRole")) giTables |= cptComPlusGroupInApplicationRole; - if (S_OK == WcaTableExists(L"ComPlusAssembly")) giTables |= cptComPlusAssembly; - if (S_OK == WcaTableExists(L"ComPlusAssemblyDependency")) giTables |= cptComPlusAssemblyDependency; - if (S_OK == WcaTableExists(L"ComPlusComponent")) giTables |= cptComPlusComponent; - if (S_OK == WcaTableExists(L"ComPlusComponentProperty")) giTables |= cptComPlusComponentProperty; - if (S_OK == WcaTableExists(L"ComPlusRoleForComponent")) giTables |= cptComPlusRoleForComponent; - if (S_OK == WcaTableExists(L"ComPlusInterface")) giTables |= cptComPlusInterface; - if (S_OK == WcaTableExists(L"ComPlusInterfaceProperty")) giTables |= cptComPlusInterfaceProperty; - if (S_OK == WcaTableExists(L"ComPlusRoleForInterface")) giTables |= cptComPlusRoleForInterface; - if (S_OK == WcaTableExists(L"ComPlusMethod")) giTables |= cptComPlusMethod; - if (S_OK == WcaTableExists(L"ComPlusMethodProperty")) giTables |= cptComPlusMethodProperty; - if (S_OK == WcaTableExists(L"ComPlusRoleForMethod")) giTables |= cptComPlusRoleForMethod; - if (S_OK == WcaTableExists(L"ComPlusSubscription")) giTables |= cptComPlusSubscription; - if (S_OK == WcaTableExists(L"ComPlusSubscriptionProperty")) giTables |= cptComPlusSubscriptionProperty; + if (S_OK == WcaTableExists(L"Wix4ComPlusPartition")) giTables |= cptComPlusPartition; + if (S_OK == WcaTableExists(L"Wix4ComPlusPartitionProperty")) giTables |= cptComPlusPartitionProperty; + if (S_OK == WcaTableExists(L"Wix4ComPlusPartitionRole")) giTables |= cptComPlusPartitionRole; + if (S_OK == WcaTableExists(L"Wix4ComPlusUserInPartitionRole")) giTables |= cptComPlusUserInPartitionRole; + if (S_OK == WcaTableExists(L"Wix4ComPlusGroupInPartitionRole")) giTables |= cptComPlusGroupInPartitionRole; + if (S_OK == WcaTableExists(L"Wix4ComPlusPartitionUser")) giTables |= cptComPlusPartitionUser; + if (S_OK == WcaTableExists(L"Wix4ComPlusApplication")) giTables |= cptComPlusApplication; + if (S_OK == WcaTableExists(L"Wix4ComPlusApplicationProperty")) giTables |= cptComPlusApplicationProperty; + if (S_OK == WcaTableExists(L"Wix4ComPlusApplicationRole")) giTables |= cptComPlusApplicationRole; + if (S_OK == WcaTableExists(L"Wix4ComPlusAppRoleProperty")) giTables |= cptComPlusApplicationRoleProperty; + if (S_OK == WcaTableExists(L"Wix4ComPlusUserInAppRole")) giTables |= cptComPlusUserInApplicationRole; + if (S_OK == WcaTableExists(L"Wix4ComPlusGroupInAppRole")) giTables |= cptComPlusGroupInApplicationRole; + if (S_OK == WcaTableExists(L"Wix4ComPlusAssembly")) giTables |= cptComPlusAssembly; + if (S_OK == WcaTableExists(L"Wix4ComPlusAssemblyDependency")) giTables |= cptComPlusAssemblyDependency; + if (S_OK == WcaTableExists(L"Wix4ComPlusComponent")) giTables |= cptComPlusComponent; + if (S_OK == WcaTableExists(L"Wix4ComPlusComponentProperty")) giTables |= cptComPlusComponentProperty; + if (S_OK == WcaTableExists(L"Wix4ComPlusRoleForComponent")) giTables |= cptComPlusRoleForComponent; + if (S_OK == WcaTableExists(L"Wix4ComPlusInterface")) giTables |= cptComPlusInterface; + if (S_OK == WcaTableExists(L"Wix4ComPlusInterfaceProperty")) giTables |= cptComPlusInterfaceProperty; + if (S_OK == WcaTableExists(L"Wix4ComPlusRoleForInterface")) giTables |= cptComPlusRoleForInterface; + if (S_OK == WcaTableExists(L"Wix4ComPlusMethod")) giTables |= cptComPlusMethod; + if (S_OK == WcaTableExists(L"Wix4ComPlusMethodProperty")) giTables |= cptComPlusMethodProperty; + if (S_OK == WcaTableExists(L"Wix4ComPlusRoleForMethod")) giTables |= cptComPlusRoleForMethod; + if (S_OK == WcaTableExists(L"Wix4ComPlusSubscription")) giTables |= cptComPlusSubscription; + if (S_OK == WcaTableExists(L"Wix4ComPlusSubscriptionProperty")) giTables |= cptComPlusSubscriptionProperty; } void CpiSchedFinalize() @@ -137,7 +137,7 @@ HRESULT CpiSchedGetCatalogCollection( hr = CpiSchedGetAdminCatalog(&piCatalog); ExitOnFailure(hr, "Failed to get COM+ admin catalog"); - // get collecton from catalog + // get collection from catalog hr = piCatalog->GetCollection(bstrName, &piDisp); ExitOnFailure(hr, "Failed to get collection"); diff --git a/src/ext/ComPlus/ca/precomp.h b/src/ext/ComPlus/ca/precomp.h index 74c328d2d..97aa8e976 100644 --- a/src/ext/ComPlus/ca/precomp.h +++ b/src/ext/ComPlus/ca/precomp.h @@ -31,3 +31,5 @@ #include "cpapprolesched.h" #include "cpasmsched.h" #include "cpsubssched.h" + +#include "..\..\caDecor.h" diff --git a/src/ext/ComPlus/wixext/ComPlusTableDefinitions.cs b/src/ext/ComPlus/wixext/ComPlusTableDefinitions.cs index 6af5045cd..cffaff0da 100644 --- a/src/ext/ComPlus/wixext/ComPlusTableDefinitions.cs +++ b/src/ext/ComPlus/wixext/ComPlusTableDefinitions.cs @@ -123,7 +123,7 @@ public static class ComPlusTableDefinitions ); public static readonly TableDefinition ComPlusApplicationRoleProperty = new TableDefinition( - "Wix4ComPlusApplicationRoleProperty", + "Wix4ComPlusAppRoleProperty", ComPlusSymbolDefinitions.ComPlusApplicationRoleProperty, new[] { @@ -135,7 +135,7 @@ public static class ComPlusTableDefinitions ); public static readonly TableDefinition ComPlusUserInApplicationRole = new TableDefinition( - "Wix4ComPlusUserInApplicationRole", + "Wix4ComPlusUserInAppRole", ComPlusSymbolDefinitions.ComPlusUserInApplicationRole, new[] { @@ -148,7 +148,7 @@ public static class ComPlusTableDefinitions ); public static readonly TableDefinition ComPlusGroupInApplicationRole = new TableDefinition( - "Wix4ComPlusGroupInApplicationRole", + "Wix4ComPlusGroupInAppRole", ComPlusSymbolDefinitions.ComPlusGroupInApplicationRole, new[] { diff --git a/src/internal/SetBuildNumber/Directory.Packages.props.pp b/src/internal/SetBuildNumber/Directory.Packages.props.pp index 721771d0c..7bf377d4c 100644 --- a/src/internal/SetBuildNumber/Directory.Packages.props.pp +++ b/src/internal/SetBuildNumber/Directory.Packages.props.pp @@ -33,6 +33,7 @@ + diff --git a/src/test/burn/WixTestTools/RuntimeFactAttribute.cs b/src/test/burn/WixTestTools/RuntimeFactAttribute.cs index f73c87a29..573a9de20 100644 --- a/src/test/burn/WixTestTools/RuntimeFactAttribute.cs +++ b/src/test/burn/WixTestTools/RuntimeFactAttribute.cs @@ -5,6 +5,7 @@ namespace WixTestTools using System; using System.Security.Principal; using WixInternal.TestSupport.XunitExtensions; + using System.Runtime.InteropServices; public class RuntimeFactAttribute : SkippableFactAttribute { @@ -12,6 +13,16 @@ public class RuntimeFactAttribute : SkippableFactAttribute public static bool RuntimeTestsEnabled { get; } public static bool RunningAsAdministrator { get; } + public static bool RunningOnWindowsServer { get; } + + [DllImport("shlwapi.dll", SetLastError = true, EntryPoint = "#437")] + private static extern bool IsOS(int os); + private static bool IsWindowsServer() + { + const int OS_ANYSERVER = 29; + return IsOS(OS_ANYSERVER); + } + static RuntimeFactAttribute() { @@ -21,6 +32,25 @@ static RuntimeFactAttribute() var testsEnabledString = Environment.GetEnvironmentVariable(RequiredEnvironmentVariableName); RuntimeTestsEnabled = Boolean.TryParse(testsEnabledString, out var testsEnabled) && testsEnabled; + + RunningOnWindowsServer = IsWindowsServer(); + } + + private bool _RequireWindowsServer; + public bool RequireWindowsServer + { + get + { + return _RequireWindowsServer; + } + set + { + _RequireWindowsServer = value; + if (_RequireWindowsServer && !RunningOnWindowsServer) + { + this.Skip = $"These tests are only run on Windows Server"; + } + } } public RuntimeFactAttribute() diff --git a/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET3.dll b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET3.dll new file mode 100644 index 000000000..b46be6494 Binary files /dev/null and b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET3.dll differ diff --git a/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET3.tlb b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET3.tlb new file mode 100644 index 000000000..87419ee1c Binary files /dev/null and b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET3.tlb differ diff --git a/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET4.dll b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET4.dll new file mode 100644 index 000000000..e0fd3deef Binary files /dev/null and b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET4.dll differ diff --git a/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET4.tlb b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET4.tlb new file mode 100644 index 000000000..63647bdc6 Binary files /dev/null and b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET4.tlb differ diff --git a/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNative.dll b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNative.dll new file mode 100644 index 000000000..dbcb5807a Binary files /dev/null and b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNative.dll differ diff --git a/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET3WithoutPartitions/InstallUninstallNET3WithoutPartitions.wixproj b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET3WithoutPartitions/InstallUninstallNET3WithoutPartitions.wixproj new file mode 100644 index 000000000..19382c83f --- /dev/null +++ b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET3WithoutPartitions/InstallUninstallNET3WithoutPartitions.wixproj @@ -0,0 +1,15 @@ + + + + + {A3E0B539-63F9-4B43-9E34-F33AE1C6E06D} + true + + + + + + + + + diff --git a/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET3WithoutPartitions/product.wxs b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET3WithoutPartitions/product.wxs new file mode 100644 index 000000000..129669cc9 --- /dev/null +++ b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET3WithoutPartitions/product.wxs @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET4WithoutPartitions/InstallUninstallNET4WithoutPartitions.wixproj b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET4WithoutPartitions/InstallUninstallNET4WithoutPartitions.wixproj new file mode 100644 index 000000000..19382c83f --- /dev/null +++ b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET4WithoutPartitions/InstallUninstallNET4WithoutPartitions.wixproj @@ -0,0 +1,15 @@ + + + + + {A3E0B539-63F9-4B43-9E34-F33AE1C6E06D} + true + + + + + + + + + diff --git a/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET4WithoutPartitions/product.wxs b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET4WithoutPartitions/product.wxs new file mode 100644 index 000000000..eabd77942 --- /dev/null +++ b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET4WithoutPartitions/product.wxs @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNativeWithoutPartitions/InstallUninstallNativeWithoutPartitions.wixproj b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNativeWithoutPartitions/InstallUninstallNativeWithoutPartitions.wixproj new file mode 100644 index 000000000..19382c83f --- /dev/null +++ b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNativeWithoutPartitions/InstallUninstallNativeWithoutPartitions.wixproj @@ -0,0 +1,15 @@ + + + + + {A3E0B539-63F9-4B43-9E34-F33AE1C6E06D} + true + + + + + + + + + diff --git a/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNativeWithoutPartitions/product.wxs b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNativeWithoutPartitions/product.wxs new file mode 100644 index 000000000..ee3c4d8fa --- /dev/null +++ b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNativeWithoutPartitions/product.wxs @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallWithPartitions/InstallUninstallWithPartitions.wixproj b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallWithPartitions/InstallUninstallWithPartitions.wixproj new file mode 100644 index 000000000..19382c83f --- /dev/null +++ b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallWithPartitions/InstallUninstallWithPartitions.wixproj @@ -0,0 +1,15 @@ + + + + + {A3E0B539-63F9-4B43-9E34-F33AE1C6E06D} + true + + + + + + + + + diff --git a/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallWithPartitions/product.wxs b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallWithPartitions/product.wxs new file mode 100644 index 000000000..92dc892b9 --- /dev/null +++ b/src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallWithPartitions/product.wxs @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/msi/WixToolsetTest.MsiE2E/ComPlusExtensionTests.cs b/src/test/msi/WixToolsetTest.MsiE2E/ComPlusExtensionTests.cs new file mode 100644 index 000000000..b143c19d0 --- /dev/null +++ b/src/test/msi/WixToolsetTest.MsiE2E/ComPlusExtensionTests.cs @@ -0,0 +1,50 @@ +// 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.MsiE2E +{ + using System; + using WixTestTools; + using Xunit; + using Xunit.Abstractions; + + public class ComPlusExtensionTests : MsiE2ETests + { + public ComPlusExtensionTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + [RuntimeFact] + public void CanInstallUninstallNativeWithoutPartitions() + { + var product = this.CreatePackageInstaller("InstallUninstallNativeWithoutPartitions"); + product.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); + + product.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); + } + + [RuntimeFact] + public void CanInstallUninstallNET3WithoutPartitions() + { + var product = this.CreatePackageInstaller("InstallUninstallNET3WithoutPartitions"); + product.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); + + product.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); + } + + [RuntimeFact] + public void CanInstallUninstallNET4WithoutPartitions() + { + var product = this.CreatePackageInstaller("InstallUninstallNET4WithoutPartitions"); + product.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); + + product.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); + } + + [RuntimeFact(RequireWindowsServer = true)] + public void CanInstallAndUninstallWithPartitions() + { + var product = this.CreatePackageInstaller("InstallUninstallWithPartitions"); + product.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); + + product.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); + } + } +}