[wix-users] Updating Assemblies in the Global Assembly Cache (GAC)
Rick Papo
rpapo at comcast.net
Wed Apr 29 06:29:48 PDT 2020
I am attempting to update a set of assemblies stored in the GAC through a
previous InstallShield installation. Since GACUtil.exe cannot be shipped, I
figured I could install updated assemblies with WiX.
There are examples out there on StackOverflow, backed up by some slightly
contradictory documentation on the WiX Toolset website. From these, I
cobbled together the following script:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
Name="$(var.ProductDesc)"
Language="1033"
Version="$(var.ProductVersion)"
Manufacturer="$(var.ProductManufacturer)"
UpgradeCode="$(var.UpgradeCode)"
>
<Package Id="*"
Keywords="Installer"
InstallerVersion="301"
Compressed="yes"
InstallScope="perMachine"
Manufacturer="$(var.ProductManufacturer)"
Description="$(var.ProductDesc)"
Comments="$(var.ProductCopyright)"
/>
<MediaTemplate EmbedCab="yes" />
<MajorUpgrade DowngradeErrorMessage="A newer version of
[ProductName] is already installed." />
<Feature Id="ProductFeature" Title="Register Assemblies"
Level="1">
<ComponentGroupRef Id="CG_GAC" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="COMPANYFOLDER"
Name="$(var.ProductManufacturer)">
<Directory Id="PRODUCTFOLDER" Name="$(var.ProductName)">
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="CG_GAC" Directory="PRODUCTFOLDER">
<Component Id="CMP_ ASSEMBLY "
Guid="1FE74B2E-F05F-4D67-8FC0-EB2418FD8452">
<File Id="FIL_ASSEMBLY" Name="Assembly.dll" KeyPath="yes"
Assembly=".net"
Source="Assembly.dll" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
This built and ran without any visible errors, but the file in the GAC was
not updated. I turned on installer logging and tried again. It reported
that the new assembly was the same as the old, and so was not copied. I
rebuilt the assembly incrementing the build number, and now it doesn't give
the error anymore, but neither does it update the assembly in the GAC.
There are no visible error messages in the installer log file, though the
component ID given on line 675 below is rather odd, to my point of view.
MSI (s) (34:84) [09:20:30:671]: Executing op:
ActionStart(Name=MsiPublishAssemblies,Description=Publishing assembly
information,Template=Application Context:[1], Assembly Name:[2])
MSI (s) (34:84) [09:20:30:672]: Executing op:
AssemblyPublish(Feature=ProductFeature,Component={1FE74B2E-F05F-4D67-8FC0-EB
2418FD8452}[~]3,AssemblyType=1,,AssemblyName=Assembly,version="11.4.0.0",cul
ture="neutral",publicKeyToken="20FF18B5FC0556F7",processorArchitecture="x86"
,)
MSI (s) (34:84) [09:20:30:674]: Executing op:
ActionStart(Name=PublishFeatures,Description=Publishing Product
Features,Template=Feature: [1])
MSI (s) (34:84) [09:20:30:675]: Executing op:
FeaturePublish(Feature=ProductFeature,,Absent=2,Component=S at X9-({_s at .=_r.k~D
TB)
MSI (s) (34:84) [09:20:30:679]: Executing op:
ActionStart(Name=PublishProduct,Description=Publishing product information,)
MSI (s) (34:84) [09:20:30:680]: Executing op: CleanupConfigData()
Any ideas?
--Rick Papo
More information about the wix-users
mailing list