-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ComPlus CUSTOM_ACTION_DECORATION #550
base: main
Are you sure you want to change the base?
Conversation
@barnson / @robmen how fixed are you fellas on this Wix prefix? WcaTableExists(L"Wix4ComPlusApplicationRoleProperty") Any guesses what the issue might be.... if someone said "that's a silly long Windows Installer table name" you'd be spot on. So.. options are:
Full List of names (diff highlighting for good vs bad) + Wix4ComPlusPartition (20)
+ Wix4ComPlusPartitionProperty (28)
+ Wix4ComPlusPartitionRole (24)
+ Wix4ComPlusUserInPartitionRole (30)
+ Wix4ComPlusGroupInPartitionRole (31)
+ Wix4ComPlusPartitionUser (24)
+ Wix4ComPlusApplication (22)
+ Wix4ComPlusApplicationProperty (30)
+ Wix4ComPlusApplicationRole (26)
- Wix4ComPlusApplicationRoleProperty (34)
- Wix4ComPlusUserInApplicationRole (32)
- Wix4ComPlusGroupInApplicationRole (33)
+ Wix4ComPlusAssembly (19)
+ Wix4ComPlusAssemblyDependency (29)
+ Wix4ComPlusComponent (20)
+ Wix4ComPlusComponentProperty (28)
+ Wix4ComPlusRoleForComponent (27)
+ Wix4ComPlusInterface (20)
+ Wix4ComPlusInterfaceProperty (28)
+ Wix4ComPlusRoleForInterface (27)
+ Wix4ComPlusMethod (17)
+ Wix4ComPlusMethodProperty (25)
+ Wix4ComPlusRoleForMethod (24)
+ Wix4ComPlusSubscription (23)
+ Wix4ComPlusSubscriptionProperty (31)
Current thoughts are:
Application => App
Which would deal with the current problem children.
But open to other suggestions.
EDIT: Missed one (Wix4ComPlusUserInApplicationRole) in my original list.. |
Hah, hah. Bit by lack of validation of Extension provided tables because we "trust" to remember not to make them too long. :) I think 2 is the right choice. "App" for "Application" is completely reasonable. Given it's been broken since the name change, I think the prefix can stay |
Any concerns with me putting in an Exception on attempting to create a TableDefinition with a name that is 'too long'? public TableDefinition(string name, IntermediateSymbolDefinition symbolDefinition, IEnumerable<ColumnDefinition> columns, bool unreal = false, bool symbolIdIsPrimaryKey = false, Type strongRowType = null)
{
if (name.Length > MaxTableNameLength)
{
throw new ArgumentOutOfRangeException(nameof(name), $"Windows Installer table names must be <= {MaxTableNameLength} characters long, '{name}' is {name.Length} characters");
}
...
|
Yeah, that's not the correct place. The limitation only applies to MSI. Instead, open an issue, and we can think about the most accurate place. |
hmm, so I keep finding more things to trip over on this COM+ stuff https://learn.microsoft.com/en-us/windows/win32/api/comadmin/nf-comadmin-icatalogcollection-add When I just do a naïve search for the terms (ICatalogCollection, add, E_NOTIMPL), I get this Stackoverflow answer Which is essentially #import "c:\windows\system32\com\Comadmin.dll" no_namespace Which results in plenty of compile errors about redefined types, and doesn't quite feel right (I'd expect more a tlb reference or such). I'm very much open to ideas... hmmm... actually it looks like COM+ partitions may be disabled by default I might run through a full test of it under Windows server to make sure that it's working in general terms. |
I haven't yet quite gotten a full successful run through of this. I got the Partition stuff working on a Windows Server OS. But then it got stuck on registering the .NET Assembly. It appears this is caused by .NET 4.5 (the Windows installation default) not correctly registering the RegistrationHelper COM class, installing .NET v3 was required to get RegistrationHelper working.. |
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 (however issues still exist). 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 <[email protected]>
@robmen / @barnson I've still got two issues with this PR.
I suspect both of these issues were present in the pre-WiX4+ also. So I think that the current PR is worth adding as-is. Any ideas on solutions to the two issues above? |
Can't help with COM+ itself, sorry. The tests you added are just install/uninstall---how hard would it be to build them with WiX v3.14 and do a one-time test pass? The changes look fine but again, with no COM+ knowledge, I'd rather verify that the behavior in v3.14 is the same. |
Here's a bunch of install/uninstall logs for each of the invocations under this PR (Wix5) version, and the Wix3 version. Wix3_InstallUninstallNativeWithoutPartitions_Install.txt (success) Wix3_InstallUninstallNativeWithoutPartitions_Uninstall.txt (success) Wix3_InstallUninstallNET3WithoutPartitions_Install.txt (success) Wix3_InstallUninstallNET3WithoutPartitions_Uninstall.txt (success) Wix3_InstallUninstallNET4WithoutPartitions_Install.txt (fail) Wix3_InstallUninstallWithPartitions_Install.txt (fail) Install failed under Wix3, so no uninstall possible Wix3_NET4WithoutNET35_Install.txt (fail) |
I think that only works for .exes. |
Yeah, I've experimented with another way in the native code, it's just a bit more annoying because of the split between .NET FW <4 and .NET FW >= 4.
I'm hoping the solution might be as simple as just creating a .NET 4 host if available, but setting the legacy binding flags for it, so that it can support .NET <4 also (which just needs to be for RegistrationHelper) UPDATE: ok, it looks like it worked. If a .NET v4 CLR is spun up before the CoCreateInstance, then things all work to get a v4 instance of the RegistrationHelper, which is able to register both v3 AND v4 assemblies. Summary: This PR will fix the naming issues from Wix4 which prevented COM+ Extension from working at all. It also fixes up the three of the issues that the Wix3 COM+ had: (fixed) Failure to create Partitions on Windows Server, (fixed) Failure to work at all if .NET v4 ONLY CLR available, (fixed) Failure to register .NET v4 assemblies. |
It also lets the .NET FW 4+ assemblies actually register. So.. that's a win. But it's a bit ugly. Signed-off-by: Bevan Weiss <[email protected]>
Signed-off-by: Bevan Weiss <[email protected]>
Whilst looking into the MSMQ, I noticed a similar issue for the ComPlus items.
I haven't yet added a set of tests for this, I've never use the ComPlus functionality before, so unsure how it fits together.
It would be great if someone would have an example for a very basic wxs that would test basic 'install/uninstall' of the ComPlus range.
fixes wixtoolset/issues#2916
and I think it also
fixes wixtoolset/issues#3073 since this bug mentions .NET assembly registration as the problem.