Hello, I am writing an installer for a program that uses an in-process COM server. When installing this to a clean machine, it puts all the files in the right place and registers the dll. However, when doing a major upgrade to a new version, the files get installed correctly, but the dll file ends up not being registered.
When looking at the log file from the installation, it first installs the new version and registers it. Then it uninstalls the old version, and unregisters it, and this seems to clobber the registry entries for the newly installed file. Changing the install sequence to uninstall before installing "fixes" the problem, but that's just treating the symptoms. I suspect the basic problem is that in the two different versions there are components with different GUIDs (containing the old and new version of the dll file) which both write registry entries using the same COM type library GUID. I'm quite clueless about both installers and COM, so I would very much appreciate some guidance on the usual way of doing this like this... To describe it in some more detail, my setup is as follows. The COM server is hosted in a dll file called NCGServer6.6.1.dll, which I want to put into the directory [Common Files]\NCG\NCGServer\6.6.1\ and register. This dll file is put in a seperate merge module. I'm using WiX 2.0, so I include it with a snippet like <Directory Id='TARGETDIR' Name='SourceDir'> <Directory Id='CommonFilesFolder' Name='CFiles'> <Directory Id='NCG' Name='NCG'> <Directory Id='NCGServer' Name='NCGSrvr' LongName='NCGServer'> <Directory Id='version6.6.1' Name='661' LongName='6.6.1'> <Component Id="NCGServer6.6.1.dll" Guid="{3A396C6B-B8A5-438e-B3D4-3FA365E27DD8}"> <File Id="NCGServer6.6.1.dll" Name="NCGS661.dll" LongName="NCGServer6.6.1.dll" KeyPath="yes" Source="D:\Dev\Installers\WiX\NCGServer MSM\NCGServer MSM\Elements\NCG\Programs\NCGServer6.6.1.dll"> <TypeLib Id="{DA574677-4154-4FDB-876A-376EF6DCB3D2}" Description="NCGServer 6.6 Type Library" Language="0" MajorVersion="6" MinorVersion="6"> <Class Id="{2BCE5F13-4055-4001-9DD0-FB7D19815B6B}" Context="InprocServer32" Description="NCGServer Class" ThreadingModel="both"> <ProgId Id="NCGServer.NCGServer.606.1" Description="NCGServer Class"> <ProgId Id="NCGServer.NCGServer" Description="NCGServer Class" /> </ProgId> </Class> <Interface Id="{B11969D1-0983-4D72-AA55-3E07D83A0CAE}" Name="INCGServer" ProxyStubClassId="{00020424-0000-0000-C000-000000000046}" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" /> </TypeLib> </File> </Component> The Component element is just derived from the output of heat.exe. I then include the merge module in an MSI and install it and everything works fine. The problem comes when upgrading. I want to replace the dll file with a new version and put the file in a new directory ([Common Files]\NCG\NCGServer\6.6.2, say). I'm doing a major upgrade, so I'm changing Module GUID, Package ID GUID, and the GUID of the MSI I include it in. I change the directory name, replace the file name with the new one, and change the Component GUID for the file. I update the GUIDs in the typelib element for the new dll file by changing the ClassId GUID but leaving the InterfaceID and TypeLibID the same (since they are not affected by the upgrade). When running this new MSI, this is what I see. First the registry gets written with COM information: MSI (s) (70:D4) [09:23:34:130]: Executing op: ActionStart(Name=WriteRegistryValues,Description=Writing system registry values,Template=Key: [1], Name: [2], Value: [3]) MSI (s) (70:D4) [09:23:34:130]: Executing op: ProgressTotal(Total=16,Type=1,ByteEquivalent=13200) MSI (s) (70:D4) [09:23:34:130]: Executing op: RegOpenKey(,Key=NCGServer.NCGServer,,BinaryType=0) MSI (s) (70:D4) [09:23:34:130]: Executing op: RegAddValue(,Value=NCGServer Class,) MSI (s) (70:D4) [09:23:34:130]: Executing op: RegOpenKey(,Key=NCGServer.NCGServer\CLSID,,BinaryType=0) MSI (s) (70:D4) [09:23:34:130]: Executing op: RegAddValue(,Value={2BCE5F13-4055-4001-9DD0-FB7D19815B6B},) MSI (s) (70:D4) [09:23:34:130]: Executing op: RegOpenKey(,Key=CLSID\{2BCE5F13-4055-4001-9DD0-FB7D19815B6B}\VersionIndependentProgID,,BinaryType=0) MSI (s) (70:D4) [09:23:34:130]: Executing op: RegAddValue(,Value=NCGServer.NCGServer,) MSI (s) (70:D4) [09:23:34:130]: Executing op: RegOpenKey(,Key=NCGServer.NCGServer.606.1,,BinaryType=0) MSI (s) (70:D4) [09:23:34:130]: Executing op: RegAddValue(,Value=NCGServer Class,) MSI (s) (70:D4) [09:23:34:130]: Executing op: RegOpenKey(,Key=NCGServer.NCGServer\CurVer,,BinaryType=0) MSI (s) (70:D4) [09:23:34:130]: Executing op: RegAddValue(,Value=NCGServer.NCGServer.606.1,) MSI (s) (70:D4) [09:23:34:130]: Executing op: RegOpenKey(,Key=NCGServer.NCGServer.606.1\CLSID,,BinaryType=0) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegAddValue(,Value={2BCE5F13-4055-4001-9DD0-FB7D19815B6B},) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegOpenKey(,Key=CLSID\{2BCE5F13-4055-4001-9DD0-FB7D19815B6B}\ProgID,,BinaryType=0) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegAddValue(,Value=NCGServer.NCGServer.606.1,) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegOpenKey(,Key=CLSID\{2BCE5F13-4055-4001-9DD0-FB7D19815B6B}\InprocServer32,,BinaryType=0) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegAddValue(,Value=C:\Program Files\Common Files\NCG\NCGServer\6.6.1\NCGServer6.6.1.dll,) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegAddValue(Name=ThreadingModel,Value=Both,) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegOpenKey(,Key=CLSID\{2BCE5F13-4055-4001-9DD0-FB7D19815B6B},,BinaryType=0) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegAddValue(,Value=NCGServer Class,) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegOpenKey(,Key=CLSID\{2BCE5F13-4055-4001-9DD0-FB7D19815B6B}\TypeLib,,BinaryType=0) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegAddValue(,Value={DA574677-4154-4FDB-876A-376EF6DCB3D2},) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegOpenKey(,Key=Interface\{B11969D1-0983-4D72-AA55-3E07D83A0CAE},,BinaryType=0) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegAddValue(,Value=INCGServer,) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegOpenKey(,Key=Interface\{B11969D1-0983-4D72-AA55-3E07D83A0CAE}\TypeLib,,BinaryType=0) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegAddValue(,Value={DA574677-4154-4FDB-876A-376EF6DCB3D2},) MSI (s) (70:D4) [09:23:34:146]: Executing op: RegAddValue(Name=Version,Value=6.6,) MSI (s) (70:D4) [09:23:34:161]: Executing op: RegOpenKey(,Key=Interface\{B11969D1-0983-4D72-AA55-3E07D83A0CAE}\ProxyStubClsid,,BinaryType=0) MSI (s) (70:D4) [09:23:34:161]: Executing op: RegAddValue(,Value={00020424-0000-0000-C000-000000000046},) MSI (s) (70:D4) [09:23:34:161]: Executing op: RegOpenKey(,Key=Interface\{B11969D1-0983-4D72-AA55-3E07D83A0CAE}\ProxyStubClsid32,,BinaryType=0) MSI (s) (70:D4) [09:23:34:161]: Executing op: RegAddValue(,Value={00020424-0000-0000-C000-000000000046},) But then, during the uninstall phase, those registry keys get overwritten again: MSI (s) (70:10) [09:23:44:519]: Executing op: ActionStart(Name=RemoveRegistryValues,Description=Removing system registry values,Template=Key: [1], Name: [2]) MSI (s) (70:10) [09:23:44:519]: Executing op: ProgressTotal(Total=16,Type=1,ByteEquivalent=13200) MSI (s) (70:10) [09:23:44:519]: Executing op: RegOpenKey(,Key=NCGServer.NCGServer,,BinaryType=0) MSI (s) (70:10) [09:23:44:519]: Executing op: RegRemoveValue(,Value=NCGServer Class,) MSI (s) (70:10) [09:23:44:519]: Executing op: RegOpenKey(,Key=NCGServer.NCGServer\CLSID,,BinaryType=0) MSI (s) (70:10) [09:23:44:519]: Executing op: RegRemoveValue(,Value={FDAE7B36-9339-4A3E-A964-EEE7B4F40844},) MSI (s) (70:10) [09:23:44:519]: Executing op: RegOpenKey(,Key=CLSID\{FDAE7B36-9339-4A3E-A964-EEE7B4F40844}\VersionIndependentProgID,,BinaryType=0) MSI (s) (70:10) [09:23:44:519]: Executing op: RegRemoveValue(,Value=NCGServer.NCGServer,) MSI (s) (70:10) [09:23:44:519]: Executing op: RegOpenKey(,Key=NCGServer.NCGServer.606.0,,BinaryType=0) MSI (s) (70:10) [09:23:44:519]: Executing op: RegRemoveValue(,Value=NCGServer Class,) MSI (s) (70:10) [09:23:44:535]: Executing op: RegOpenKey(,Key=NCGServer.NCGServer\CurVer,,BinaryType=0) MSI (s) (70:10) [09:23:44:535]: Executing op: RegRemoveValue(,Value=NCGServer.NCGServer.606.0,) MSI (s) (70:10) [09:23:44:535]: Executing op: RegOpenKey(,Key=NCGServer.NCGServer.606.0\CLSID,,BinaryType=0) MSI (s) (70:10) [09:23:44:535]: Executing op: RegRemoveValue(,Value={FDAE7B36-9339-4A3E-A964-EEE7B4F40844},) MSI (s) (70:10) [09:23:44:535]: Executing op: RegOpenKey(,Key=CLSID\{FDAE7B36-9339-4A3E-A964-EEE7B4F40844}\ProgID,,BinaryType=0) MSI (s) (70:10) [09:23:44:535]: Executing op: RegRemoveValue(,Value=NCGServer.NCGServer.606.0,) MSI (s) (70:10) [09:23:44:535]: Executing op: RegOpenKey(,Key=CLSID\{FDAE7B36-9339-4A3E-A964-EEE7B4F40844}\InprocServer32,,BinaryType=0) MSI (s) (70:10) [09:23:44:535]: Executing op: RegRemoveValue(,Value=[!NCGServer6.6.dll.C24C02DF_A679_4C59_A4DA_3D7022E084F7],) MSI (s) (70:10) [09:23:44:535]: Executing op: RegRemoveValue(Name=ThreadingModel,Value=Both,) MSI (s) (70:10) [09:23:44:535]: Executing op: RegOpenKey(,Key=CLSID\{FDAE7B36-9339-4A3E-A964-EEE7B4F40844},,BinaryType=0) MSI (s) (70:10) [09:23:44:535]: Executing op: RegRemoveValue(,Value=NCGServer Class,) MSI (s) (70:10) [09:23:44:535]: Executing op: RegOpenKey(,Key=CLSID\{FDAE7B36-9339-4A3E-A964-EEE7B4F40844}\TypeLib,,BinaryType=0) MSI (s) (70:10) [09:23:44:535]: Executing op: RegRemoveValue(,Value={DA574677-4154-4FDB-876A-376EF6DCB3D2},) MSI (s) (70:10) [09:23:44:551]: Executing op: RegOpenKey(,Key=Interface\{B11969D1-0983-4D72-AA55-3E07D83A0CAE},,BinaryType=0) MSI (s) (70:10) [09:23:44:551]: Executing op: RegRemoveValue(,Value=INCGServer,) MSI (s) (70:10) [09:23:44:551]: Executing op: RegOpenKey(,Key=Interface\{B11969D1-0983-4D72-AA55-3E07D83A0CAE}\TypeLib,,BinaryType=0) MSI (s) (70:10) [09:23:44:551]: Executing op: RegRemoveValue(,Value={DA574677-4154-4FDB-876A-376EF6DCB3D2},) MSI (s) (70:10) [09:23:44:551]: Executing op: RegRemoveValue(Name=Version,Value=6.6,) MSI (s) (70:10) [09:23:44:551]: Executing op: RegOpenKey(,Key=Interface\{B11969D1-0983-4D72-AA55-3E07D83A0CAE}\ProxyStubClsid,,BinaryType=0) MSI (s) (70:10) [09:23:44:551]: Executing op: RegRemoveValue(,Value={00020424-0000-0000-C000-000000000046},) MSI (s) (70:10) [09:23:44:551]: Executing op: RegOpenKey(,Key=Interface\{B11969D1-0983-4D72-AA55-3E07D83A0CAE}\ProxyStubClsid32,,BinaryType=0) MSI (s) (70:10) [09:23:44:551]: Executing op: RegRemoveValue(,Value={00020424-0000-0000-C000-000000000046},) Note how the key containing the type library ID is first written during the install, then later removed during the uninstall phase. -- View this message in context: http://www.nabble.com/Problem-with-COM-registration-and-upgrades-tf4570440.html#a13045509 Sent from the wix-users mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users