@joebigelow / wix / commits / ee41358b

Fix up COM+ to be back in working order under Wix4+ Table names updated for Wix4 prefix. Custom action names similarly updated. Table names Wix4ComPlusUserInApplicationRole, Wix4ComPlusGroupInApplicationRole and Wix4ComPlusApplicationRoleProperty had to be shortened to fit within MSI 31 character table name limit. Migrated from fixed GUID for RegistrationHelper to use CLSIDFromProgID in an attempt to fix behaviour under .NET 4+ DLLs. Added setting of Partition enable if a Partition is configured in authoring, new Windows config has Partitions disabled by default, and they don't work at all under Windows workstation (non-server) versions.

Fix up COM+ to be back in working order under Wix4+ Table names updated for Wix4 prefix. Custom action names similarly updated. Table names Wix4ComPlusUserInApplicationRole, Wix4ComPlusGroupInApplicationRole and Wix4ComPlusApplicationRoleProperty had to be shortened to fit within MSI 31 character table name limit. Migrated from fixed GUID for RegistrationHelper to use CLSIDFromProgID in an attempt to fix behaviour under .NET 4+ DLLs. Added setting of Partition enable if a Partition is configured in authoring, new Windows config has Partitions disabled by default, and they don't work at all under Windows workstation (non-server) versions. Added a new Runtime condition for `RequireWindowsServer` which will skip execution of Runtime test on workstation/desktop OSes, since COM+ Partitions only work correctly under Windows Server. Quite a lot of basic typos fixed also. Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>

Bevan Weiss committed Jul 28, 2024 at 00:12 UTC ee41358bb583619ef4fe6707958dc3c6c62cd13f
31 files changed +446 -120
src/ext/ComPlus/ca/cpapproleexec.cpp
+2 -2
@@ -74,7 +74,7 @@ HRESULT CpiConfigureApplicationRoles(
74 hr = CpiActionStartMessage(ppwzData, FALSE);
75 ExitOnFailure(hr, "Failed to send action start message");
76
77 - // ger count
77 + // get count
78 int iCnt = 0;
79 hr = WcaReadIntegerFromCaData(ppwzData, &iCnt);
80 ExitOnFailure(hr, "Failed to read count");
@@ -218,7 +218,7 @@ HRESULT CpiConfigureUsersInApplicationRoles(
218 hr = CpiActionStartMessage(ppwzData, FALSE);
219 ExitOnFailure(hr, "Failed to send action start message");
220
221 - // ger count
221 + // get count
222 int iCnt = 0;
223 hr = WcaReadIntegerFromCaData(ppwzData, &iCnt);
224 ExitOnFailure(hr, "Failed to read count");
src/ext/ComPlus/ca/cpapprolesched.cpp
+10 -10
@@ -10,13 +10,13 @@ LPCWSTR vcsApplicationRoleQuery =
10 enum eApplicationRoleQuery { arqApplicationRole = 1, arqApplication, arqComponent, arqName };
11
12 LPCWSTR vcsUserInApplicationRoleQuery =
13 - L"SELECT `UserInApplicationRole`, `ApplicationRole_`, `ComPlusUserInApplicationRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusUserInApplicationRole`, `Wix4User` WHERE `User_` = `User`";
13 + L"SELECT `UserInApplicationRole`, `ApplicationRole_`, `Wix4ComPlusUserInAppRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusUserInAppRole`, `Wix4User` WHERE `User_` = `User`";
14 LPCWSTR vcsGroupInApplicationRoleQuery =
15 - L"SELECT `GroupInApplicationRole`, `ApplicationRole_`, `ComPlusGroupInApplicationRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusGroupInApplicationRole`, `Wix4Group` WHERE `Group_` = `Group`";
15 + L"SELECT `GroupInApplicationRole`, `ApplicationRole_`, `Wix4ComPlusGroupInAppRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusGroupInAppRole`, `Wix4Group` WHERE `Group_` = `Group`";
16 enum eTrusteeInApplicationRoleQuery { tiarqUserInApplicationRole = 1, tiarqApplicationRole, tiarqComponent, tiarqDomain, tiarqName };
17
18 LPCWSTR vcsApplicationRolePropertyQuery =
19 - L"SELECT `Name`, `Value` FROM `Wix4ComPlusApplicationRoleProperty` WHERE `ApplicationRole_` = ?";
19 + L"SELECT `Name`, `Value` FROM `Wix4ComPlusAppRoleProperty` WHERE `ApplicationRole_` = ?";
20
21
22 // property definitions
@@ -95,7 +95,7 @@ HRESULT CpiApplicationRolesRead(
95
96 // loop through all application roles
97 hr = WcaOpenExecuteView(vcsApplicationRoleQuery, &hView);
98 - ExitOnFailure(hr, "Failed to execute view on ComPlusApplicationRole table");
98 + ExitOnFailure(hr, "Failed to execute view on Wix4ComPlusApplicationRole table");
99
100 while (S_OK == (hr = WcaFetchRecord(hView, &hRec)))
101 {
@@ -205,7 +205,7 @@ HRESULT CpiApplicationRolesVerifyInstall(
205 if (!pItm->fReferencedForInstall && !(pItm->fHasComponent && WcaIsInstalling(pItm->isInstalled, pItm->isAction)))
206 continue;
207
208 - // if the role is referensed and is not a locater, it must be installed
208 + // if the role is referenced and is not a locater, it must be installed
209 if (pItm->fReferencedForInstall && pItm->fHasComponent && !CpiWillBeInstalled(pItm->isInstalled, pItm->isAction))
210 MessageExitOnFailure(hr = E_FAIL, msierrComPlusApplicationRoleDependency, "An application role is used by another entity being installed, but is not installed itself, key: %S", pItm->wzKey);
211
@@ -235,7 +235,7 @@ HRESULT CpiApplicationRolesVerifyInstall(
235 switch (er)
236 {
237 case IDABORT:
238 - ExitOnFailure(hr = E_FAIL, "An application with a conflictiong name exists, key: %S", pItm->wzKey);
238 + ExitOnFailure(hr = E_FAIL, "An application with a conflicting name exists, key: %S", pItm->wzKey);
239 break;
240 case IDRETRY:
241 break;
@@ -319,7 +319,7 @@ HRESULT CpiApplicationRolesInstall(
319 int iActionType;
320
321 // add action text
322 - hr = CpiAddActionTextToActionData(L"CreateComPlusApplicationRoles", ppwzActionData);
322 + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"CreateComPlusApplicationRoles"), ppwzActionData);
323 ExitOnFailure(hr, "Failed to add action text to custom action data");
324
325 // add count to action data
@@ -371,7 +371,7 @@ HRESULT CpiApplicationRolesUninstall(
371 int iActionType;
372
373 // add action text
374 - hr = CpiAddActionTextToActionData(L"RemoveComPlusApplicationRoles", ppwzActionData);
374 + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"RemoveComPlusApplicationRoles"), ppwzActionData);
375 ExitOnFailure(hr, "Failed to add action text to custom action data");
376
377 // add count to action data
@@ -477,7 +477,7 @@ HRESULT CpiUsersInApplicationRolesInstall(
477 int iActionType;
478
479 // add action text
480 - hr = CpiAddActionTextToActionData(L"AddUsersToComPlusApplicationRoles", ppwzActionData);
480 + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"AddUsersToComPlusApplicationRoles"), ppwzActionData);
481 ExitOnFailure(hr, "Failed to add action text to custom action data");
482
483 // add count to action data
@@ -529,7 +529,7 @@ HRESULT CpiUsersInApplicationRolesUninstall(
529 int iActionType;
530
531 // add action text
532 - hr = CpiAddActionTextToActionData(L"RemoveUsersFromComPlusAppRoles", ppwzActionData);
532 + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"RemoveUsersFromComPlusAppRoles"), ppwzActionData);
533 ExitOnFailure(hr, "Failed to add action text to custom action data");
534
535 // add count to action data
src/ext/ComPlus/ca/cpappsched.cpp
+1 -1
@@ -255,7 +255,7 @@ HRESULT CpiApplicationsVerifyInstall(
255 if (!pItm->fReferencedForInstall && !(pItm->fHasComponent && WcaIsInstalling(pItm->isInstalled, pItm->isAction)))
256 continue;
257
258 - // if the application is referensed and is not a locater, it must be installed
258 + // if the application is referenced and is not a locater, it must be installed
259 if (pItm->fReferencedForInstall && pItm->fHasComponent && !CpiWillBeInstalled(pItm->isInstalled, pItm->isAction))
260 MessageExitOnFailure(hr = E_FAIL, msierrComPlusApplicationDependency, "An application is used by another entity being installed, but is not installed itself, key: %S", pItm->wzKey);
261
src/ext/ComPlus/ca/cpasmexec.cpp
+39 -11
@@ -1,7 +1,7 @@
1 // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3 #include "precomp.h"
4 -
4 +#include <mscoree.h>
5
6 // GAC related declarations
7
@@ -61,13 +61,11 @@ public:
61
62 typedef HRESULT (__stdcall *LoadLibraryShimFunc)(LPCWSTR szDllName, LPCWSTR szVersion, LPVOID pvReserved, HMODULE *phModDll);
63 typedef HRESULT (__stdcall *CreateAssemblyCacheFunc)(IAssemblyCache **ppAsmCache, DWORD dwReserved);
64 +typedef HRESULT (__stdcall *GetFileVersionFnPtr)(LPCWSTR szFilename, _Out_writes_to_opt_(cchBuffer, *dwLength) LPWSTR szBuffer, DWORD cchBuffer, DWORD* dwLength);
65 +typedef HRESULT (__stdcall *CorBindToRuntimeExFnPtr)(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, DWORD startupFlags, REFCLSID rclsid, REFIID riid, LPVOID FAR* ppv);
66
67
68 // RegistrationHelper related declarations
67 -
68 -static const GUID CLSID_RegistrationHelper =
69 - { 0x89a86e7b, 0xc229, 0x4008, { 0x9b, 0xaa, 0x2f, 0x5c, 0x84, 0x11, 0xd7, 0xe0 } };
70 -
69 enum eInstallationFlags {
70 ifConfigureComponentsOnly = 16,
71 ifFindOrCreateTargetApplication = 4,
@@ -156,7 +154,8 @@ static HRESULT UnregisterAssembly(
154 static void InitAssemblyExec();
155 static void UninitAssemblyExec();
156 static HRESULT GetRegistrationHelper(
159 - IDispatch** ppiRegHlp
157 + IDispatch** ppiRegHlp,
158 + LPCWSTR pwzAssemblyPath
159 );
160 static HRESULT GetAssemblyCacheObject(
161 IAssemblyCache** ppAssemblyCache
@@ -722,15 +721,44 @@ static void UninitAssemblyExec()
721 }
722
723 static HRESULT GetRegistrationHelper(
725 - IDispatch** ppiRegHlp
724 + IDispatch** ppiRegHlp,
725 + LPCWSTR pwzAssemblyPath
726 )
727 {
728 HRESULT hr = S_OK;
729 + wchar_t pwzVersion[MAX_PATH];
730 + DWORD pcchVersionLen = MAX_PATH;
731 + ICLRRuntimeHost* runtimeHost = NULL;
732 +
733 + if (!ghMscoree)
734 + {
735 + ghMscoree = ::LoadLibraryW(L"mscoree.dll");
736 + ExitOnNull(ghMscoree, hr, E_FAIL, "Failed to load mscoree.dll");
737 + }
738 + GetFileVersionFnPtr GetFileVersion = (GetFileVersionFnPtr)::GetProcAddress(ghMscoree, "GetFileVersion");
739 + ExitOnNull(GetFileVersion, hr, E_FAIL, "Failed to GetProcAddress for 'GetFileVersion' from 'mscoree.dll'");
740 + hr = GetFileVersion(pwzAssemblyPath, pwzVersion, pcchVersionLen, &pcchVersionLen);
741
742 if (!gpiRegHlp)
743 {
744 + CLSID CLSID_RegistrationHelper{};
745 + hr = ::CLSIDFromProgID(OLESTR("System.EnterpriseServices.RegistrationHelper"), &CLSID_RegistrationHelper);
746 + ExitOnFailure(hr, "Failed to identify CLSID for 'System.EnterpriseServices.RegistrationHelper'");
747 +
748 + // NOTE: The 'CoreBindToRuntimeEx' method is DEPRECATED in .NET v4.
749 + // 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.
750 + // Even if we are about to try to fire up a v4 runtime.
751 + // The .NET v4 runtime with STARTUP_LOADER_SAFEMODE flag (to disable version checking of loaded assemblies) is what lets us launch the
752 + // RegistrationHelper. The v4 RegistrationHelper is able to register both v4 and v3 assemblies however, so if we can get it, we most as well
753 + // use it.
754 + CorBindToRuntimeExFnPtr CorBindToRuntimeEx = (CorBindToRuntimeExFnPtr)::GetProcAddress(ghMscoree, "CorBindToRuntimeEx");
755 + hr = CorBindToRuntimeEx(L"v4.0.30319", L"wks", STARTUP_LOADER_SAFEMODE, CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (LPVOID*)&runtimeHost);
756 + // 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
757 + // when we just try the COM Create below
758 +
759 // create registration helper object
733 - hr = ::CoCreateInstance(CLSID_RegistrationHelper, NULL, CLSCTX_ALL, IID_IDispatch, (void**)&gpiRegHlp);
760 + // 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
761 + hr = ::CoCreateInstance(CLSID_RegistrationHelper, NULL, CLSCTX_ALL, IID_IDispatch, (void**)&gpiRegHlp);
762 ExitOnFailure(hr, "Failed to create registration helper object");
763 }
764
@@ -883,7 +911,7 @@ static HRESULT RegisterDotNetAssembly(
911 }
912
913 // get registration helper object
886 - hr = GetRegistrationHelper(&piRegHlp);
914 + hr = GetRegistrationHelper(&piRegHlp, pAttrs->pwzDllPath);
915 ExitOnFailure(hr, "Failed to get registration helper object");
916
917 // get dispatch id of InstallAssembly() method
@@ -979,7 +1007,7 @@ static HRESULT RegisterNativeAssembly(
1007 ExitOnNull(bstrTlbPath, hr, E_OUTOFMEMORY, "Failed to allocate BSTR for tlb path");
1008
1009 bstrPSDllPath = ::SysAllocString(pAttrs->pwzPSDllPath ? pAttrs->pwzPSDllPath : L"");
982 - ExitOnNull(bstrPSDllPath, hr, E_OUTOFMEMORY, "Failed to allocate BSTR for tlb path");
1010 + ExitOnNull(bstrPSDllPath, hr, E_OUTOFMEMORY, "Failed to allocate BSTR for proxy/stub dll path");
1011
1012 // get catalog
1013 hr = CpiExecGetAdminCatalog(&piCatalog);
@@ -1089,7 +1117,7 @@ static HRESULT UnregisterDotNetAssembly(
1117 ExitOnNull(bstrDllPath, hr, E_OUTOFMEMORY, "Failed to allocate BSTR for dll path");
1118
1119 // get registration helper object
1092 - hr = GetRegistrationHelper(&piRegHlp);
1120 + hr = GetRegistrationHelper(&piRegHlp, pAttrs->pwzDllPath);
1121 ExitOnFailure(hr, "Failed to get registration helper object");
1122
1123 // get dispatch id of UninstallAssembly() method
src/ext/ComPlus/ca/cpasmsched.cpp
+1 -1
@@ -408,7 +408,7 @@ HRESULT CpiAssembliesVerifyInstall(
408 if (!pItm->fReferencedForInstall && !pItm->iRoleAssignmentsInstallCount && !WcaIsInstalling(pItm->isInstalled, pItm->isAction))
409 continue;
410
411 - // if the assembly is referensed, it must be installed
411 + // if the assembly is referenced, it must be installed
412 if ((pItm->fReferencedForInstall || pItm->iRoleAssignmentsInstallCount) && !CpiWillBeInstalled(pItm->isInstalled, pItm->isAction))
413 MessageExitOnFailure(hr = E_FAIL, msierrComPlusAssemblyDependency, "An assembly is used by another entity being installed, but is not installed itself, key: %S", pItm->wzKey);
414 }
src/ext/ComPlus/ca/cpexec.cpp
+5 -5
@@ -180,7 +180,7 @@ LExit:
180 if (INVALID_HANDLE_VALUE != hRollbackFile)
181 ::CloseHandle(hRollbackFile);
182
183 - // unitialize
183 + // uninitialize
184 CpiExecFinalize();
185
186 if (fInitializedCom)
@@ -258,7 +258,7 @@ LExit:
258 if (INVALID_HANDLE_VALUE != hRollbackFile)
259 ::CloseHandle(hRollbackFile);
260
261 - // unitialize
261 + // uninitialize
262 CpiExecFinalize();
263
264 if (fInitializedCom)
@@ -415,7 +415,7 @@ LExit:
415 if (prdSubscriptions)
416 CpiFreeRollbackDataList(prdSubscriptions);
417
418 - // unitialize
418 + // uninitialize
419 CpiExecFinalize();
420
421 if (fInitializedCom)
@@ -521,7 +521,7 @@ LExit:
521 if (INVALID_HANDLE_VALUE != hRollbackFile)
522 ::CloseHandle(hRollbackFile);
523
524 - // unitialize
524 + // uninitialize
525 CpiExecFinalize();
526
527 if (fInitializedCom)
@@ -670,7 +670,7 @@ LExit:
670 if (prdSubscriptions)
671 CpiFreeRollbackDataList(prdSubscriptions);
672
673 - // unitialize
673 + // uninitialize
674 CpiExecFinalize();
675
676 if (fInitializedCom)
src/ext/ComPlus/ca/cppartexec.cpp
+69 -2
@@ -34,6 +34,7 @@ static HRESULT ReadPartitionAttributes(
34 static void FreePartitionAttributes(
35 CPI_PARTITION_ATTRIBUTES* pAttrs
36 );
37 +static HRESULT CpiEnsurePartitionsEnabled();
38 static HRESULT CreatePartition(
39 CPI_PARTITION_ATTRIBUTES* pAttrs
40 );
@@ -71,7 +72,7 @@ HRESULT CpiConfigurePartitions(
72 hr = CpiActionStartMessage(ppwzData, FALSE);
73 ExitOnFailure(hr, "Failed to send action start message");
74
74 - // ger partition count
75 + // get partition count
76 int iCnt = 0;
77 hr = WcaReadIntegerFromCaData(ppwzData, &iCnt);
78 ExitOnFailure(hr, "Failed to read count");
@@ -215,7 +216,7 @@ HRESULT CpiConfigurePartitionUsers(
216 hr = CpiActionStartMessage(ppwzData, FALSE);
217 ExitOnFailure(hr, "Failed to send action start message");
218
218 - // ger partition count
219 + // get partition count
220 int iCnt = 0;
221 hr = WcaReadIntegerFromCaData(ppwzData, &iCnt);
222 ExitOnFailure(hr, "Failed to read count");
@@ -384,6 +385,69 @@ static void FreePartitionAttributes(
385 CpiFreePropertyList(pAttrs->pPropList);
386 }
387
388 +static HRESULT CpiEnsurePartitionsEnabled()
389 +{
390 + HRESULT hr = S_OK;
391 +
392 + ICatalogCollection* piLocalComputerColl = NULL;
393 + IDispatch* piDisp = NULL;
394 + ICatalogObject* piLocalComputerObj = NULL;
395 + VARIANT vtVal;
396 + BSTR bsPartitionsEnabledName = ::SysAllocString(L"PartitionsEnabled");
397 + long numChanges = 0;
398 +
399 + ::VariantInit(&vtVal);
400 +
401 + // get collection
402 + hr = CpiExecGetCatalogCollection(L"LocalComputer", &piLocalComputerColl);
403 + ExitOnFailure(hr, "Failed to get catalog collection");
404 +
405 + // find object, there will be only one in the LocalComputer collection
406 + hr = piLocalComputerColl->get_Item(0, &piDisp);
407 + ExitOnFailure(hr, "Failed to get object from collection");
408 +
409 + hr = piDisp->QueryInterface(IID_ICatalogObject, (void**)&piLocalComputerObj);
410 + ExitOnFailure(hr, "Failed to get IID_ICatalogObject interface");
411 +
412 + // and then we get the value of the PartitionsEnabled property
413 + hr = piLocalComputerObj->get_Value(bsPartitionsEnabledName, &vtVal);
414 + if (!vtVal.boolVal)
415 + {
416 + vtVal.boolVal = true;
417 + hr = piLocalComputerObj->put_Value(bsPartitionsEnabledName, vtVal);
418 + ExitOnFailure(hr, "Failed to put value to Enable COM+ PartitionsEnabled property");
419 + hr = piLocalComputerColl->SaveChanges(&numChanges);
420 + ExitOnFailure(hr, "Failed to save PartitionsEnabled property");
421 +
422 + // we'll read back the hopefully updated values of the PartitionsEnabled property
423 + // if it's still False, then we're on a Windows Desktop that doesn't allow Partitions
424 + // (as of Windows Server2003 Microsoft limited Partitions to only ServerOS platforms)
425 + hr = piLocalComputerObj->get_Value(bsPartitionsEnabledName, &vtVal);
426 + ExitOnFailure(hr, "Failed to read PartitionsEnabled property");
427 + }
428 +
429 + if (vtVal.boolVal)
430 + {
431 + // everything went well, we have the Partitioning available
432 + hr = S_OK;
433 + }
434 + else
435 + {
436 + // we're on a Desktop OS, or couldn't otherwise enable partitioning
437 + WcaLog(LOGMSG_STANDARD, "Failed to Enable COM+ PartitionEnabled property. This suggests Partitioning was attempted on a Desktop OS, which is not supported");
438 + hr = S_FALSE;
439 + }
440 +
441 +LExit:
442 + // clean up
443 + ReleaseObject(piLocalComputerColl);
444 + ReleaseObject(piLocalComputerObj);
445 + ReleaseBSTR(bsPartitionsEnabledName);
446 + ::VariantClear(&vtVal);
447 +
448 + return hr;
449 +}
450 +
451 static HRESULT CreatePartition(
452 CPI_PARTITION_ATTRIBUTES* pAttrs
453 )
@@ -408,6 +472,9 @@ static HRESULT CreatePartition(
472
473 if (S_FALSE == hr)
474 {
475 + hr = CpiEnsurePartitionsEnabled();
476 + ExitOnFailure(hr, "Failed to enable partitions");
477 +
478 // create partition
479 hr = CpiAddCollectionObject(piPartColl, &piPartObj);
480 ExitOnFailure(hr, "Failed to add partition to collection");
src/ext/ComPlus/ca/cppartroleexec.cpp
+1 -1
@@ -49,7 +49,7 @@ HRESULT CpiConfigureUsersInPartitionRoles(
49 hr = CpiActionStartMessage(ppwzData, FALSE);
50 ExitOnFailure(hr, "Failed to send action start message");
51
52 - // ger count
52 + // get count
53 int iCnt = 0;
54 hr = WcaReadIntegerFromCaData(ppwzData, &iCnt);
55 ExitOnFailure(hr, "Failed to read count");
src/ext/ComPlus/ca/cppartrolesched.cpp
+2 -2
@@ -10,9 +10,9 @@ LPCWSTR vcsPartitionRoleQuery =
10 enum ePartitionRoleQuery { prqPartitionRole = 1, prqPartition, prqComponent, prqName };
11
12 LPCWSTR vcsUserInPartitionRoleQuery =
13 - L"SELECT `UserInPartitionRole`, `PartitionRole_`, `ComPlusUserInPartitionRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusUserInPartitionRole`, `Wix4User` WHERE `User_` = `User`";
13 + L"SELECT `UserInPartitionRole`, `PartitionRole_`, `Wix4ComPlusUserInPartitionRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusUserInPartitionRole`, `Wix4User` WHERE `User_` = `User`";
14 LPCWSTR vcsGroupInPartitionRoleQuery =
15 - L"SELECT `GroupInPartitionRole`, `PartitionRole_`, `ComPlusGroupInPartitionRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusGroupInPartitionRole`, `Wix4Group` WHERE `Group_` = `Group`";
15 + L"SELECT `GroupInPartitionRole`, `PartitionRole_`, `Wix4ComPlusGroupInPartitionRole`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusGroupInPartitionRole`, `Wix4Group` WHERE `Group_` = `Group`";
16 enum eTrusteeInPartitionRoleQuery { tiprqUserInPartitionRole = 1, tiprqPartitionRole, tiprqComponent, tiprqDomain, tiprqName };
17
18
src/ext/ComPlus/ca/cppartsched.cpp
+7 -7
@@ -13,7 +13,7 @@ LPCWSTR vcsPartitionPropertyQuery =
13 L"SELECT `Name`, `Value` FROM `Wix4ComPlusPartitionProperty` WHERE `Partition_` = ?";
14
15 LPCWSTR vcsPartitionUserQuery =
16 - L"SELECT `PartitionUser`, `Partition_`, `ComPlusPartitionUser`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusPartitionUser`, `Wix4User` WHERE `User_` = `User`";
16 + L"SELECT `PartitionUser`, `Partition_`, `Wix4ComPlusPartitionUser`.`Component_`, `Domain`, `Name` FROM `Wix4ComPlusPartitionUser`, `Wix4User` WHERE `User_` = `User`";
17 enum ePartitionUserQuery { puqPartitionUser = 1, puqPartition, puqComponent, puqDomain, puqName };
18
19
@@ -192,7 +192,7 @@ HRESULT CpiPartitionsVerifyInstall(
192 if (!pItm->fReferencedForInstall && !(pItm->fHasComponent && WcaIsInstalling(pItm->isInstalled, pItm->isAction)))
193 continue;
194
195 - // if the partition is referensed and is not a locater, it must be installed
195 + // if the partition is referenced and is not a locater, it must be installed
196 if (pItm->fReferencedForInstall && pItm->fHasComponent && !CpiWillBeInstalled(pItm->isInstalled, pItm->isAction))
197 MessageExitOnFailure(hr = E_FAIL, msierrComPlusPartitionDependency, "A partition is used by another entity being installed, but is not installed itself, key: %S", pItm->wzKey);
198
@@ -281,7 +281,7 @@ HRESULT CpiPartitionsVerifyInstall(
281 {
282 case IDCANCEL:
283 case IDABORT:
284 - ExitOnFailure(hr = E_FAIL, "A partition with a conflictiong name or id exists, key: %S", pItm->wzKey);
284 + ExitOnFailure(hr = E_FAIL, "A partition with a conflicting name or id exists, key: %S", pItm->wzKey);
285 break;
286 case IDRETRY:
287 break;
@@ -403,7 +403,7 @@ HRESULT CpiPartitionsInstall(
403 int iActionType;
404
405 // add action text
406 - hr = CpiAddActionTextToActionData(L"CreateComPlusPartitions", ppwzActionData);
406 + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"CreateComPlusPartitions"), ppwzActionData);
407 ExitOnFailure(hr, "Failed to add action text to custom action data");
408
409 // add partition count to action data
@@ -455,7 +455,7 @@ HRESULT CpiPartitionsUninstall(
455 int iActionType;
456
457 // add action text
458 - hr = CpiAddActionTextToActionData(L"RemoveComPlusPartitions", ppwzActionData);
458 + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"RemoveComPlusPartitions"), ppwzActionData);
459 ExitOnFailure(hr, "Failed to add action text to custom action data");
460
461 // add partition count to action data
@@ -735,7 +735,7 @@ HRESULT CpiPartitionUsersInstall(
735 int iActionType;
736
737 // add action text
738 - hr = CpiAddActionTextToActionData(L"AddComPlusPartitionUsers", ppwzActionData);
738 + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"AddComPlusPartitionUsers"), ppwzActionData);
739 ExitOnFailure(hr, "Failed to add action text to custom action data");
740
741 // add partition count to action data
@@ -787,7 +787,7 @@ HRESULT CpiPartitionUsersUninstall(
787 int iActionType;
788
789 // add action text
790 - hr = CpiAddActionTextToActionData(L"RemoveComPlusPartitionUsers", ppwzActionData);
790 + hr = CpiAddActionTextToActionData(CUSTOM_ACTION_DECORATION(L"RemoveComPlusPartitionUsers"), ppwzActionData);
791 ExitOnFailure(hr, "Failed to add action text to custom action data");
792
793 // add partition count to action data
src/ext/ComPlus/ca/cpsched.cpp
+33 -47
@@ -3,31 +3,17 @@
3 #include "precomp.h"
4
5
6 -#ifdef _WIN64
7 -#define CP_COMPLUSROLLBACKINSTALLPREPARE L"ComPlusRollbackInstallPrepare_64"
8 -#define CP_COMPLUSINSTALLPREPARE L"ComPlusInstallPrepare_64"
9 -#define CP_COMPLUSROLLBACKINSTALLEXECUTE L"ComPlusRollbackInstallExecute_64"
10 -#define CP_COMPLUSINSTALLEXECUTE L"ComPlusInstallExecute_64"
11 -#define CP_COMPLUSINSTALLEXECUTECOMMIT L"ComPlusInstallExecuteCommit_64"
12 -#define CP_COMPLUSINSTALLCOMMIT L"ComPlusInstallCommit_64"
13 -#define CP_COMPLUSROLLBACKINSTALLPREPARE L"ComPlusRollbackInstallPrepare_64"
14 -#define CP_COMPLUSINSTALLPREPARE L"ComPlusInstallPrepare_64"
15 -#define CP_COMPLUSROLLBACKUNINSTALLEXECUTE L"ComPlusRollbackUninstallExecute_64"
16 -#define CP_COMPLUSUNINSTALLEXECUTE L"ComPlusUninstallExecute_64"
17 -#define CP_COMPLUSINSTALLCOMMIT L"ComPlusInstallCommit_64"
18 -#else
19 -#define CP_COMPLUSROLLBACKINSTALLPREPARE L"ComPlusRollbackInstallPrepare"
20 -#define CP_COMPLUSINSTALLPREPARE L"ComPlusInstallPrepare"
21 -#define CP_COMPLUSROLLBACKINSTALLEXECUTE L"ComPlusRollbackInstallExecute"
22 -#define CP_COMPLUSINSTALLEXECUTE L"ComPlusInstallExecute"
23 -#define CP_COMPLUSINSTALLEXECUTECOMMIT L"ComPlusInstallExecuteCommit"
24 -#define CP_COMPLUSINSTALLCOMMIT L"ComPlusInstallCommit"
25 -#define CP_COMPLUSROLLBACKINSTALLPREPARE L"ComPlusRollbackInstallPrepare"
26 -#define CP_COMPLUSINSTALLPREPARE L"ComPlusInstallPrepare"
27 -#define CP_COMPLUSROLLBACKUNINSTALLEXECUTE L"ComPlusRollbackUninstallExecute"
28 -#define CP_COMPLUSUNINSTALLEXECUTE L"ComPlusUninstallExecute"
29 -#define CP_COMPLUSINSTALLCOMMIT L"ComPlusInstallCommit"
30 -#endif
6 +#define CP_COMPLUSROLLBACKINSTALLPREPARE CUSTOM_ACTION_DECORATION(L"ComPlusRollbackInstallPrepare")
7 +#define CP_COMPLUSINSTALLPREPARE CUSTOM_ACTION_DECORATION(L"ComPlusInstallPrepare")
8 +#define CP_COMPLUSROLLBACKINSTALLEXECUTE CUSTOM_ACTION_DECORATION(L"ComPlusRollbackInstallExecute")
9 +#define CP_COMPLUSINSTALLEXECUTE CUSTOM_ACTION_DECORATION(L"ComPlusInstallExecute")
10 +#define CP_COMPLUSINSTALLEXECUTECOMMIT CUSTOM_ACTION_DECORATION(L"ComPlusInstallExecuteCommit")
11 +#define CP_COMPLUSINSTALLCOMMIT CUSTOM_ACTION_DECORATION(L"ComPlusInstallCommit")
12 +#define CP_COMPLUSROLLBACKINSTALLPREPARE CUSTOM_ACTION_DECORATION(L"ComPlusRollbackInstallPrepare")
13 +#define CP_COMPLUSINSTALLPREPARE CUSTOM_ACTION_DECORATION(L"ComPlusInstallPrepare")
14 +#define CP_COMPLUSROLLBACKUNINSTALLEXECUTE CUSTOM_ACTION_DECORATION(L"ComPlusRollbackUninstallExecute")
15 +#define CP_COMPLUSUNINSTALLEXECUTE CUSTOM_ACTION_DECORATION(L"ComPlusUninstallExecute")
16 +#define CP_COMPLUSINSTALLCOMMIT CUSTOM_ACTION_DECORATION(L"ComPlusInstallCommit")
17
18 /********************************************************************
19 ConfigureComPlusInstall - CUSTOM ACTION ENTRY POINT for installing COM+ components
@@ -81,7 +67,7 @@ extern "C" UINT __stdcall ConfigureComPlusInstall(MSIHANDLE hInstall)
67
68 CpiSchedInitialize();
69
84 - // check for the prerequsite tables
70 + // check for the prerequisite tables
71 if (!CpiTableExists(cptComPlusPartition) && !CpiTableExists(cptComPlusApplication) && !CpiTableExists(cptComPlusAssembly))
72 {
73 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)
103 if (502 <= iVersionNT && CpiTableExists(cptComPlusPartition))
104 {
105 hr = CpiPartitionsRead(&partList);
120 - MessageExitOnFailure(hr, msierrComPlusPartitionReadFailed, "Failed to read ComPlusPartitions table");
106 + MessageExitOnFailure(hr, msierrComPlusPartitionReadFailed, "Failed to read Wix4ComPlusPartitions table");
107 }
108
109 if (502 <= iVersionNT && CpiTableExists(cptComPlusPartitionRole))
110 {
111 hr = CpiPartitionRolesRead(&partList, &partRoleList);
126 - MessageExitOnFailure(hr, msierrComPlusPartitionRoleReadFailed, "Failed to read ComPlusPartitionRole table");
112 + MessageExitOnFailure(hr, msierrComPlusPartitionRoleReadFailed, "Failed to read Wix4ComPlusPartitionRole table");
113 }
114
115 if (502 <= iVersionNT && (CpiTableExists(cptComPlusUserInPartitionRole) || CpiTableExists(cptComPlusGroupInPartitionRole)))
116 {
117 hr = CpiUsersInPartitionRolesRead(&partRoleList, &usrInPartRoleList);
132 - MessageExitOnFailure(hr, msierrComPlusUserInPartitionRoleReadFailed, "Failed to read ComPlusUserInPartitionRole table");
118 + MessageExitOnFailure(hr, msierrComPlusUserInPartitionRoleReadFailed, "Failed to read Wix4ComPlusUserInPartitionRole table");
119 }
120
121 if (502 <= iVersionNT && CpiTableExists(cptComPlusPartitionUser))
122 {
123 hr = CpiPartitionUsersRead(&partList, &partUsrList);
138 - MessageExitOnFailure(hr, msierrComPlusPartitionUserReadFailed, "Failed to read ComPlusPartitionUser table");
124 + MessageExitOnFailure(hr, msierrComPlusPartitionUserReadFailed, "Failed to read Wix4ComPlusPartitionUser table");
125 }
126
127 if (CpiTableExists(cptComPlusApplication))
128 {
129 hr = CpiApplicationsRead(&partList, &appList);
144 - MessageExitOnFailure(hr, msierrComPlusApplicationReadFailed, "Failed to read ComPlusApplication table");
130 + MessageExitOnFailure(hr, msierrComPlusApplicationReadFailed, "Failed to read Wix4ComPlusApplication table");
131 }
132
133 if (CpiTableExists(cptComPlusApplicationRole))
134 {
135 hr = CpiApplicationRolesRead(&appList, &appRoleList);
150 - MessageExitOnFailure(hr, msierrComPlusApplicationRoleReadFailed, "Failed to read ComPlusApplicationRole table");
136 + MessageExitOnFailure(hr, msierrComPlusApplicationRoleReadFailed, "Failed to read Wix4ComPlusApplicationRole table");
137 }
138
139 if (CpiTableExists(cptComPlusUserInApplicationRole) || CpiTableExists(cptComPlusGroupInApplicationRole))
140 {
141 hr = CpiUsersInApplicationRolesRead(&appRoleList, &usrInAppRoleList);
156 - MessageExitOnFailure(hr, msierrComPlusUserInApplicationRoleReadFailed, "Failed to read ComPlusUserInApplicationRole table");
142 + MessageExitOnFailure(hr, msierrComPlusUserInApplicationRoleReadFailed, "Failed to read Wix4ComPlusUserInApplicationRole table");
143 }
144
145 if (CpiTableExists(cptComPlusAssembly))
146 {
147 hr = CpiAssembliesRead(&appList, &appRoleList, &asmList);
162 - MessageExitOnFailure(hr, msierrComPlusAssembliesReadFailed, "Failed to read ComPlusAssembly table");
148 + MessageExitOnFailure(hr, msierrComPlusAssembliesReadFailed, "Failed to read Wix4ComPlusAssembly table");
149 }
150
151 if (CpiTableExists(cptComPlusSubscription))
152 {
153 hr = CpiSubscriptionsRead(&asmList, &subList);
168 - MessageExitOnFailure(hr, msierrComPlusSubscriptionReadFailed, "Failed to read ComPlusSubscription table");
154 + MessageExitOnFailure(hr, msierrComPlusSubscriptionReadFailed, "Failed to read Wix4ComPlusSubscription table");
155 }
156
157 // verify elements
@@ -295,7 +281,7 @@ LExit:
281 CpiAssemblyListFree(&asmList);
282 CpiSubscriptionListFree(&subList);
283
298 - // unitialize
284 + // uninitialize
285 CpiSchedFinalize();
286
287 if (fInitializedCom)
@@ -359,7 +345,7 @@ extern "C" UINT __stdcall ConfigureComPlusUninstall(MSIHANDLE hInstall)
345 // check for the prerequsite tables
346 if (!CpiTableExists(cptComPlusPartition) && !CpiTableExists(cptComPlusApplication) && !CpiTableExists(cptComPlusAssembly))
347 {
362 - WcaLog(LOGMSG_VERBOSE, "skipping uninstall COM+ CustomAction, no ComPlusPartition, ComPlusApplication or ComPlusAssembly table present");
348 + WcaLog(LOGMSG_VERBOSE, "skipping uninstall COM+ CustomAction, no Wix4ComPlusPartition, Wix4ComPlusApplication or Wix4ComPlusAssembly table present");
349 ExitFunction1(hr = S_FALSE);
350 }
351
@@ -392,55 +378,55 @@ extern "C" UINT __stdcall ConfigureComPlusUninstall(MSIHANDLE hInstall)
378 if (502 <= iVersionNT && CpiTableExists(cptComPlusPartition))
379 {
380 hr = CpiPartitionsRead(&partList);
395 - MessageExitOnFailure(hr, msierrComPlusPartitionReadFailed, "Failed to read ComPlusPartitions table");
381 + MessageExitOnFailure(hr, msierrComPlusPartitionReadFailed, "Failed to read Wix4ComPlusPartitions table");
382 }
383
384 if (502 <= iVersionNT && CpiTableExists(cptComPlusPartitionRole))
385 {
386 hr = CpiPartitionRolesRead(&partList, &partRoleList);
401 - MessageExitOnFailure(hr, msierrComPlusPartitionRoleReadFailed, "Failed to read ComPlusPartitionRole table");
387 + MessageExitOnFailure(hr, msierrComPlusPartitionRoleReadFailed, "Failed to read Wix4ComPlusPartitionRole table");
388 }
389
390 if (502 <= iVersionNT && (CpiTableExists(cptComPlusUserInPartitionRole) || CpiTableExists(cptComPlusGroupInPartitionRole)))
391 {
392 hr = CpiUsersInPartitionRolesRead(&partRoleList, &usrInPartRoleList);
407 - MessageExitOnFailure(hr, msierrComPlusUserInPartitionRoleReadFailed, "Failed to read ComPlusUserInPartitionRole table");
393 + MessageExitOnFailure(hr, msierrComPlusUserInPartitionRoleReadFailed, "Failed to read Wix4ComPlusUserInPartitionRole table");
394 }
395
396 if (502 <= iVersionNT && CpiTableExists(cptComPlusPartitionUser))
397 {
398 hr = CpiPartitionUsersRead(&partList, &partUsrList);
413 - MessageExitOnFailure(hr, msierrComPlusPartitionUserReadFailed, "Failed to read ComPlusPartitionUser table");
399 + MessageExitOnFailure(hr, msierrComPlusPartitionUserReadFailed, "Failed to read Wix4ComPlusPartitionUser table");
400 }
401
402 if (CpiTableExists(cptComPlusApplication))
403 {
404 hr = CpiApplicationsRead(&partList, &appList);
419 - MessageExitOnFailure(hr, msierrComPlusApplicationReadFailed, "Failed to read ComPlusApplication table");
405 + MessageExitOnFailure(hr, msierrComPlusApplicationReadFailed, "Failed to read Wix4ComPlusApplication table");
406 }
407
408 if (CpiTableExists(cptComPlusApplicationRole))
409 {
410 hr = CpiApplicationRolesRead(&appList, &appRoleList);
425 - MessageExitOnFailure(hr, msierrComPlusApplicationRoleReadFailed, "Failed to read ComPlusApplicationRole table");
411 + MessageExitOnFailure(hr, msierrComPlusApplicationRoleReadFailed, "Failed to read Wix4ComPlusApplicationRole table");
412 }
413
414 if (CpiTableExists(cptComPlusUserInApplicationRole) || CpiTableExists(cptComPlusGroupInApplicationRole))
415 {
416 hr = CpiUsersInApplicationRolesRead(&appRoleList, &usrInAppRoleList);
431 - MessageExitOnFailure(hr, msierrComPlusUserInApplicationRoleReadFailed, "Failed to read ComPlusUserInApplicationRole table");
417 + MessageExitOnFailure(hr, msierrComPlusUserInApplicationRoleReadFailed, "Failed to read Wix4ComPlusUserInApplicationRole table");
418 }
419
420 if (CpiTableExists(cptComPlusAssembly))
421 {
422 hr = CpiAssembliesRead(&appList, &appRoleList, &asmList);
437 - MessageExitOnFailure(hr, msierrComPlusAssembliesReadFailed, "Failed to read ComPlusAssembly table");
423 + MessageExitOnFailure(hr, msierrComPlusAssembliesReadFailed, "Failed to read Wix4ComPlusAssembly table");
424 }
425
426 if (CpiTableExists(cptComPlusSubscription))
427 {
428 hr = CpiSubscriptionsRead(&asmList, &subList);
443 - MessageExitOnFailure(hr, msierrComPlusSubscriptionReadFailed, "Failed to read ComPlusSubscription table");
429 + MessageExitOnFailure(hr, msierrComPlusSubscriptionReadFailed, "Failed to read Wix4ComPlusSubscription table");
430 }
431
432 // verify elements
@@ -555,7 +541,7 @@ LExit:
541 CpiAssemblyListFree(&asmList);
542 CpiSubscriptionListFree(&subList);
543
558 - // unitialize
544 + // uninitialize
545 CpiSchedFinalize();
546
547 if (fInitializedCom)
src/ext/ComPlus/ca/cpsubsexec.cpp
+2 -2
@@ -54,7 +54,7 @@ HRESULT CpiConfigureSubscriptions(
54 hr = CpiActionStartMessage(ppwzData, FALSE);
55 ExitOnFailure(hr, "Failed to send action start message");
56
57 - // ger count
57 + // get count
58 int iCnt = 0;
59 hr = WcaReadIntegerFromCaData(ppwzData, &iCnt);
60 ExitOnFailure(hr, "Failed to read count");
@@ -127,7 +127,7 @@ HRESULT CpiRollbackConfigureSubscriptions(
127 hr = CpiActionStartMessage(ppwzData, NULL == pRollbackDataList);
128 ExitOnFailure(hr, "Failed to send action start message");
129
130 - // ger count
130 + // get count
131 int iCnt = 0;
132 hr = WcaReadIntegerFromCaData(ppwzData, &iCnt);
133 ExitOnFailure(hr, "Failed to read count");
src/ext/ComPlus/ca/cputilsched.cpp
+26 -26
@@ -53,31 +53,31 @@ void CpiSchedInitialize()
53 // tables
54 giTables = 0;
55
56 - if (S_OK == WcaTableExists(L"ComPlusPartition")) giTables |= cptComPlusPartition;
57 - if (S_OK == WcaTableExists(L"ComPlusPartitionProperty")) giTables |= cptComPlusPartitionProperty;
58 - if (S_OK == WcaTableExists(L"ComPlusPartitionRole")) giTables |= cptComPlusPartitionRole;
59 - if (S_OK == WcaTableExists(L"ComPlusUserInPartitionRole")) giTables |= cptComPlusUserInPartitionRole;
60 - if (S_OK == WcaTableExists(L"ComPlusGroupInPartitionRole")) giTables |= cptComPlusGroupInPartitionRole;
61 - if (S_OK == WcaTableExists(L"ComPlusPartitionUser")) giTables |= cptComPlusPartitionUser;
62 - if (S_OK == WcaTableExists(L"ComPlusApplication")) giTables |= cptComPlusApplication;
63 - if (S_OK == WcaTableExists(L"ComPlusApplicationProperty")) giTables |= cptComPlusApplicationProperty;
64 - if (S_OK == WcaTableExists(L"ComPlusApplicationRole")) giTables |= cptComPlusApplicationRole;
65 - if (S_OK == WcaTableExists(L"ComPlusApplicationRoleProperty")) giTables |= cptComPlusApplicationRoleProperty;
66 - if (S_OK == WcaTableExists(L"ComPlusUserInApplicationRole")) giTables |= cptComPlusUserInApplicationRole;
67 - if (S_OK == WcaTableExists(L"ComPlusGroupInApplicationRole")) giTables |= cptComPlusGroupInApplicationRole;
68 - if (S_OK == WcaTableExists(L"ComPlusAssembly")) giTables |= cptComPlusAssembly;
69 - if (S_OK == WcaTableExists(L"ComPlusAssemblyDependency")) giTables |= cptComPlusAssemblyDependency;
70 - if (S_OK == WcaTableExists(L"ComPlusComponent")) giTables |= cptComPlusComponent;
71 - if (S_OK == WcaTableExists(L"ComPlusComponentProperty")) giTables |= cptComPlusComponentProperty;
72 - if (S_OK == WcaTableExists(L"ComPlusRoleForComponent")) giTables |= cptComPlusRoleForComponent;
73 - if (S_OK == WcaTableExists(L"ComPlusInterface")) giTables |= cptComPlusInterface;
74 - if (S_OK == WcaTableExists(L"ComPlusInterfaceProperty")) giTables |= cptComPlusInterfaceProperty;
75 - if (S_OK == WcaTableExists(L"ComPlusRoleForInterface")) giTables |= cptComPlusRoleForInterface;
76 - if (S_OK == WcaTableExists(L"ComPlusMethod")) giTables |= cptComPlusMethod;
77 - if (S_OK == WcaTableExists(L"ComPlusMethodProperty")) giTables |= cptComPlusMethodProperty;
78 - if (S_OK == WcaTableExists(L"ComPlusRoleForMethod")) giTables |= cptComPlusRoleForMethod;
79 - if (S_OK == WcaTableExists(L"ComPlusSubscription")) giTables |= cptComPlusSubscription;
80 - if (S_OK == WcaTableExists(L"ComPlusSubscriptionProperty")) giTables |= cptComPlusSubscriptionProperty;
56 + if (S_OK == WcaTableExists(L"Wix4ComPlusPartition")) giTables |= cptComPlusPartition;
57 + if (S_OK == WcaTableExists(L"Wix4ComPlusPartitionProperty")) giTables |= cptComPlusPartitionProperty;
58 + if (S_OK == WcaTableExists(L"Wix4ComPlusPartitionRole")) giTables |= cptComPlusPartitionRole;
59 + if (S_OK == WcaTableExists(L"Wix4ComPlusUserInPartitionRole")) giTables |= cptComPlusUserInPartitionRole;
60 + if (S_OK == WcaTableExists(L"Wix4ComPlusGroupInPartitionRole")) giTables |= cptComPlusGroupInPartitionRole;
61 + if (S_OK == WcaTableExists(L"Wix4ComPlusPartitionUser")) giTables |= cptComPlusPartitionUser;
62 + if (S_OK == WcaTableExists(L"Wix4ComPlusApplication")) giTables |= cptComPlusApplication;
63 + if (S_OK == WcaTableExists(L"Wix4ComPlusApplicationProperty")) giTables |= cptComPlusApplicationProperty;
64 + if (S_OK == WcaTableExists(L"Wix4ComPlusApplicationRole")) giTables |= cptComPlusApplicationRole;
65 + if (S_OK == WcaTableExists(L"Wix4ComPlusAppRoleProperty")) giTables |= cptComPlusApplicationRoleProperty;
66 + if (S_OK == WcaTableExists(L"Wix4ComPlusUserInAppRole")) giTables |= cptComPlusUserInApplicationRole;
67 + if (S_OK == WcaTableExists(L"Wix4ComPlusGroupInAppRole")) giTables |= cptComPlusGroupInApplicationRole;
68 + if (S_OK == WcaTableExists(L"Wix4ComPlusAssembly")) giTables |= cptComPlusAssembly;
69 + if (S_OK == WcaTableExists(L"Wix4ComPlusAssemblyDependency")) giTables |= cptComPlusAssemblyDependency;
70 + if (S_OK == WcaTableExists(L"Wix4ComPlusComponent")) giTables |= cptComPlusComponent;
71 + if (S_OK == WcaTableExists(L"Wix4ComPlusComponentProperty")) giTables |= cptComPlusComponentProperty;
72 + if (S_OK == WcaTableExists(L"Wix4ComPlusRoleForComponent")) giTables |= cptComPlusRoleForComponent;
73 + if (S_OK == WcaTableExists(L"Wix4ComPlusInterface")) giTables |= cptComPlusInterface;
74 + if (S_OK == WcaTableExists(L"Wix4ComPlusInterfaceProperty")) giTables |= cptComPlusInterfaceProperty;
75 + if (S_OK == WcaTableExists(L"Wix4ComPlusRoleForInterface")) giTables |= cptComPlusRoleForInterface;
76 + if (S_OK == WcaTableExists(L"Wix4ComPlusMethod")) giTables |= cptComPlusMethod;
77 + if (S_OK == WcaTableExists(L"Wix4ComPlusMethodProperty")) giTables |= cptComPlusMethodProperty;
78 + if (S_OK == WcaTableExists(L"Wix4ComPlusRoleForMethod")) giTables |= cptComPlusRoleForMethod;
79 + if (S_OK == WcaTableExists(L"Wix4ComPlusSubscription")) giTables |= cptComPlusSubscription;
80 + if (S_OK == WcaTableExists(L"Wix4ComPlusSubscriptionProperty")) giTables |= cptComPlusSubscriptionProperty;
81 }
82
83 void CpiSchedFinalize()
@@ -137,7 +137,7 @@ HRESULT CpiSchedGetCatalogCollection(
137 hr = CpiSchedGetAdminCatalog(&piCatalog);
138 ExitOnFailure(hr, "Failed to get COM+ admin catalog");
139
140 - // get collecton from catalog
140 + // get collection from catalog
141 hr = piCatalog->GetCollection(bstrName, &piDisp);
142 ExitOnFailure(hr, "Failed to get collection");
143
src/ext/ComPlus/ca/precomp.h
+2
@@ -31,3 +31,5 @@
31 #include "cpapprolesched.h"
32 #include "cpasmsched.h"
33 #include "cpsubssched.h"
34 +
35 +#include "..\..\caDecor.h"
src/ext/ComPlus/wixext/ComPlusTableDefinitions.cs
+3 -3
@@ -123,7 +123,7 @@ namespace WixToolset.ComPlus
123 );
124
125 public static readonly TableDefinition ComPlusApplicationRoleProperty = new TableDefinition(
126 - "Wix4ComPlusApplicationRoleProperty",
126 + "Wix4ComPlusAppRoleProperty",
127 ComPlusSymbolDefinitions.ComPlusApplicationRoleProperty,
128 new[]
129 {
@@ -135,7 +135,7 @@ namespace WixToolset.ComPlus
135 );
136
137 public static readonly TableDefinition ComPlusUserInApplicationRole = new TableDefinition(
138 - "Wix4ComPlusUserInApplicationRole",
138 + "Wix4ComPlusUserInAppRole",
139 ComPlusSymbolDefinitions.ComPlusUserInApplicationRole,
140 new[]
141 {
@@ -148,7 +148,7 @@ namespace WixToolset.ComPlus
148 );
149
150 public static readonly TableDefinition ComPlusGroupInApplicationRole = new TableDefinition(
151 - "Wix4ComPlusGroupInApplicationRole",
151 + "Wix4ComPlusGroupInAppRole",
152 ComPlusSymbolDefinitions.ComPlusGroupInApplicationRole,
153 new[]
154 {
src/internal/SetBuildNumber/Directory.Packages.props.pp
+1
@@ -33,6 +33,7 @@
33
34 <PackageVersion Include="WixToolset.Bal.wixext" Version="{packageversion}" />
35 <PackageVersion Include="WixToolset.BootstrapperApplications.wixext" Version="{packageversion}" />
36 + <PackageVersion Include="WixToolset.ComPlus.wixext" Version="{packageversion}" />
37 <PackageVersion Include="WixToolset.Dependency.wixext" Version="{packageversion}" />
38 <PackageVersion Include="WixToolset.NetFx.wixext" Version="{packageversion}" />
39 <PackageVersion Include="WixToolset.UI.wixext" Version="{packageversion}" />
src/test/burn/WixTestTools/RuntimeFactAttribute.cs
+30
@@ -5,6 +5,7 @@ namespace WixTestTools
5 using System;
6 using System.Security.Principal;
7 using WixInternal.TestSupport.XunitExtensions;
8 + using System.Runtime.InteropServices;
9
10 public class RuntimeFactAttribute : SkippableFactAttribute
11 {
@@ -12,6 +13,16 @@ namespace WixTestTools
13
14 public static bool RuntimeTestsEnabled { get; }
15 public static bool RunningAsAdministrator { get; }
16 + public static bool RunningOnWindowsServer { get; }
17 +
18 + [DllImport("shlwapi.dll", SetLastError = true, EntryPoint = "#437")]
19 + private static extern bool IsOS(int os);
20 + private static bool IsWindowsServer()
21 + {
22 + const int OS_ANYSERVER = 29;
23 + return IsOS(OS_ANYSERVER);
24 + }
25 +
26
27 static RuntimeFactAttribute()
28 {
@@ -21,6 +32,25 @@ namespace WixTestTools
32
33 var testsEnabledString = Environment.GetEnvironmentVariable(RequiredEnvironmentVariableName);
34 RuntimeTestsEnabled = Boolean.TryParse(testsEnabledString, out var testsEnabled) && testsEnabled;
35 +
36 + RunningOnWindowsServer = IsWindowsServer();
37 + }
38 +
39 + private bool _RequireWindowsServer;
40 + public bool RequireWindowsServer
41 + {
42 + get
43 + {
44 + return _RequireWindowsServer;
45 + }
46 + set
47 + {
48 + _RequireWindowsServer = value;
49 + if (_RequireWindowsServer && !RunningOnWindowsServer)
50 + {
51 + this.Skip = $"These tests are only run on Windows Server";
52 + }
53 + }
54 }
55
56 public RuntimeFactAttribute()
src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET3.dll
Binary files /dev/null and b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET3.dll differ
src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET3.tlb
Binary files /dev/null and b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET3.tlb differ
src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET4.dll
Binary files /dev/null and b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET4.dll differ
src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET4.tlb
Binary files /dev/null and b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNET4.tlb differ
src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNative.dll
Binary files /dev/null and b/src/test/msi/TestData/ComPlusExtensionTests/Components/TestComponentNative.dll differ
src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET3WithoutPartitions/InstallUninstallNET3WithoutPartitions.wixproj new
+15
@@ -0,0 +1,15 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 +<Project Sdk="WixToolset.Sdk">
4 + <PropertyGroup>
5 + <UpgradeCode>{A3E0B539-63F9-4B43-9E34-F33AE1C6E06D}</UpgradeCode>
6 + <ProductComponentsRef>true</ProductComponentsRef>
7 + </PropertyGroup>
8 + <ItemGroup>
9 + <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" />
10 + </ItemGroup>
11 + <ItemGroup>
12 + <PackageReference Include="WixToolset.Util.wixext" />
13 + <PackageReference Include="WixToolset.ComPlus.wixext" />
14 + </ItemGroup>
15 +</Project>
src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET3WithoutPartitions/product.wxs new
+24
@@ -0,0 +1,24 @@
1 +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2 +
3 +
4 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
5 + xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"
6 + xmlns:complus="http://wixtoolset.org/schemas/v4/wxs/complus">
7 + <Fragment>
8 + <ComponentGroup Id="ProductComponents">
9 + <ComponentRef Id="Component1" />
10 + </ComponentGroup>
11 + </Fragment>
12 +
13 + <Fragment>
14 + <Component Id="Component1" Guid="09624A9A-4BBC-4126-BBF9-0713C5217DB1" Directory="INSTALLFOLDER">
15 + <File Id="AssemblyFileNET" Source="../Components/TestComponentNET3.dll" KeyPath="yes" />
16 + <File Id="TlbFileNET" Source="../Components/TestComponentNET3.tlb" />
17 + <complus:ComPlusApplication Id="APPLICATION" Name="ComPlus .NET 3 Application" Description="ComPlus Application" >
18 + <complus:ComPlusAssembly Id="ASSEMBLY_NET" Type=".net" DllPath="[#AssemblyFileNET]" TlbPath="[#TlbFileNET]" >
19 + <complus:ComPlusComponent Id="MyComNET3" CLSID="17F82C39-5433-493A-A396-36072C645B80" />
20 + </complus:ComPlusAssembly>
21 + </complus:ComPlusApplication>
22 + </Component>
23 + </Fragment>
24 +</Wix>
src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET4WithoutPartitions/InstallUninstallNET4WithoutPartitions.wixproj new
+15
@@ -0,0 +1,15 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 +<Project Sdk="WixToolset.Sdk">
4 + <PropertyGroup>
5 + <UpgradeCode>{A3E0B539-63F9-4B43-9E34-F33AE1C6E06D}</UpgradeCode>
6 + <ProductComponentsRef>true</ProductComponentsRef>
7 + </PropertyGroup>
8 + <ItemGroup>
9 + <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" />
10 + </ItemGroup>
11 + <ItemGroup>
12 + <PackageReference Include="WixToolset.Util.wixext" />
13 + <PackageReference Include="WixToolset.ComPlus.wixext" />
14 + </ItemGroup>
15 +</Project>
src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNET4WithoutPartitions/product.wxs new
+24
@@ -0,0 +1,24 @@
1 +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2 +
3 +
4 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
5 + xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"
6 + xmlns:complus="http://wixtoolset.org/schemas/v4/wxs/complus">
7 + <Fragment>
8 + <ComponentGroup Id="ProductComponents">
9 + <ComponentRef Id="Component1" />
10 + </ComponentGroup>
11 + </Fragment>
12 +
13 + <Fragment>
14 + <Component Id="Component1" Guid="09624A9A-4BBC-4126-BBF9-0713C5217DB1" Directory="INSTALLFOLDER">
15 + <File Id="AssemblyFileNET" Source="../Components/TestComponentNET4.dll" KeyPath="yes" />
16 + <File Id="TlbFileNET" Source="../Components/TestComponentNET4.tlb" />
17 + <complus:ComPlusApplication Id="APPLICATION" Name="ComPlus .NET 4 Application" Description="ComPlus Application" >
18 + <complus:ComPlusAssembly Id="ASSEMBLY_NET" Type=".net" DllPath="[#AssemblyFileNET]" TlbPath="[#TlbFileNET]" >
19 + <complus:ComPlusComponent Id="MyComNET4" CLSID="146AB3A2-4472-4DB9-94D5-311536E799BD" />
20 + </complus:ComPlusAssembly>
21 + </complus:ComPlusApplication>
22 + </Component>
23 + </Fragment>
24 +</Wix>
src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNativeWithoutPartitions/InstallUninstallNativeWithoutPartitions.wixproj new
+15
@@ -0,0 +1,15 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 +<Project Sdk="WixToolset.Sdk">
4 + <PropertyGroup>
5 + <UpgradeCode>{A3E0B539-63F9-4B43-9E34-F33AE1C6E06D}</UpgradeCode>
6 + <ProductComponentsRef>true</ProductComponentsRef>
7 + </PropertyGroup>
8 + <ItemGroup>
9 + <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" />
10 + </ItemGroup>
11 + <ItemGroup>
12 + <PackageReference Include="WixToolset.Util.wixext" />
13 + <PackageReference Include="WixToolset.ComPlus.wixext" />
14 + </ItemGroup>
15 +</Project>
src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallNativeWithoutPartitions/product.wxs new
+24
@@ -0,0 +1,24 @@
1 +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2 +
3 +
4 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
5 + xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"
6 + xmlns:complus="http://wixtoolset.org/schemas/v4/wxs/complus">
7 + <Fragment>
8 + <ComponentGroup Id="ProductComponents">
9 + <ComponentRef Id="Component1" />
10 + </ComponentGroup>
11 + </Fragment>
12 +
13 + <Fragment>
14 + <Component Id="Component1" Guid="09624A9A-4BBC-4126-BBF9-0713C5217DB1" Directory="INSTALLFOLDER">
15 + <File Id="AssemblyFileNative" Source="../Components/TestComponentNative.dll" />
16 +
17 + <complus:ComPlusApplication Id="APPLICATION" Name="ComPlus Native Application" Description="ComPlus Native Application" >
18 + <complus:ComPlusAssembly Id="ASSEMBLY_Native" Type="native" DllPath="[#AssemblyFileNative]" >
19 + <complus:ComPlusComponent Id="MyComNative" CLSID="8b4c3a90-762c-465b-abc5-81cb3cc5e464" />
20 + </complus:ComPlusAssembly>
21 + </complus:ComPlusApplication>
22 + </Component>
23 + </Fragment>
24 +</Wix>
src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallWithPartitions/InstallUninstallWithPartitions.wixproj new
+15
@@ -0,0 +1,15 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 +<Project Sdk="WixToolset.Sdk">
4 + <PropertyGroup>
5 + <UpgradeCode>{A3E0B539-63F9-4B43-9E34-F33AE1C6E06D}</UpgradeCode>
6 + <ProductComponentsRef>true</ProductComponentsRef>
7 + </PropertyGroup>
8 + <ItemGroup>
9 + <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" />
10 + </ItemGroup>
11 + <ItemGroup>
12 + <PackageReference Include="WixToolset.Util.wixext" />
13 + <PackageReference Include="WixToolset.ComPlus.wixext" />
14 + </ItemGroup>
15 +</Project>
src/test/msi/TestData/ComPlusExtensionTests/InstallUninstallWithPartitions/product.wxs new
+30
@@ -0,0 +1,30 @@
1 +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2 +
3 +
4 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
5 + xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"
6 + xmlns:complus="http://wixtoolset.org/schemas/v4/wxs/complus">
7 + <Fragment>
8 + <ComponentGroup Id="ProductComponents">
9 + <ComponentRef Id="Component1" />
10 + </ComponentGroup>
11 + </Fragment>
12 +
13 + <Fragment>
14 + <util:User Id="TEST_USER" Name="[LogonUser]" />
15 +
16 + <Component Id="Component1" Guid="09624A9A-4BBC-4126-BBF9-0713C5217DB1" Directory="INSTALLFOLDER">
17 + <File Id="AssemblyFileNative" Source="../Components/TestComponentNative.dll" />
18 +
19 + <!-- Partition testing only works on Server OS -->
20 + <complus:ComPlusPartition Id="PARTITION" Name="Complus Partition1" Description="ComPlus Partition" >
21 + <complus:ComPlusPartitionUser Id="PARTITION_USER" User ="TEST_USER"/>
22 + <complus:ComPlusApplication Id="APPLICATION" Name="ComPlus Application" Description="ComPlus Application" >
23 + <complus:ComPlusAssembly Id="ASSEMBLY_Native" Type="native" DllPath="[#AssemblyFileNative]" >
24 + <complus:ComPlusComponent Id="MyComNative" CLSID="8b4c3a90-762c-465b-abc5-81cb3cc5e464" />
25 + </complus:ComPlusAssembly>
26 + </complus:ComPlusApplication>
27 + </complus:ComPlusPartition>
28 + </Component>
29 + </Fragment>
30 +</Wix>
src/test/msi/WixToolsetTest.MsiE2E/ComPlusExtensionTests.cs new
+50
@@ -0,0 +1,50 @@
1 +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 +
3 +namespace WixToolsetTest.MsiE2E
4 +{
5 + using System;
6 + using WixTestTools;
7 + using Xunit;
8 + using Xunit.Abstractions;
9 +
10 + public class ComPlusExtensionTests : MsiE2ETests
11 + {
12 + public ComPlusExtensionTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
13 +
14 + [RuntimeFact]
15 + public void CanInstallUninstallNativeWithoutPartitions()
16 + {
17 + var product = this.CreatePackageInstaller("InstallUninstallNativeWithoutPartitions");
18 + product.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
19 +
20 + product.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
21 + }
22 +
23 + [RuntimeFact]
24 + public void CanInstallUninstallNET3WithoutPartitions()
25 + {
26 + var product = this.CreatePackageInstaller("InstallUninstallNET3WithoutPartitions");
27 + product.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
28 +
29 + product.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
30 + }
31 +
32 + [RuntimeFact]
33 + public void CanInstallUninstallNET4WithoutPartitions()
34 + {
35 + var product = this.CreatePackageInstaller("InstallUninstallNET4WithoutPartitions");
36 + product.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
37 +
38 + product.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
39 + }
40 +
41 + [RuntimeFact(RequireWindowsServer = true)]
42 + public void CanInstallAndUninstallWithPartitions()
43 + {
44 + var product = this.CreatePackageInstaller("InstallUninstallWithPartitions");
45 + product.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
46 +
47 + product.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS);
48 + }
49 + }
50 +}