I have a custom module which I am trying to update. Previously I had two assemblies - lets call them 'Core.dll' and 'Services.dll'. In the most recent version of my module, I have merged these into a single assembly - 'Main.dll'. Now, when I'm updating the module, it is important that Core.dll and Services.dll are removed at the same time that I add Main.dll, otherwise lots of 'type x exists in both Core.dll and Main.dll' errors get thrown.
Now, as far as i can tell, this should be possible to do using the installer manifest file. As per documentation (http://www.dotnetnuke.com/Resources/Wiki/Page/AssemblyComponent.aspx), I should be able to do the following:
<component type="Assembly">
<assemblies>
<basePath>bin</basePath>
<assembly action="UnRegister">
<name>Core.dll</name>
</assembly>
<assembly action="UnRegister">
<name>Services.dll</name>
</assembly>
<assembly>
<name>Main.dll</name>
</assembly>
</assemblies>
</component>
However, this doesn't work. Even though success messages are displayed indicating the assemblies have been deleted, they remain in the bin directory.
Delving into the source. Trunk/Community/Library/Services/Installer/Installers/AssemblyInstaller.cs
The functionality appears to be there. In the 'InstallFile' method, there is the following statement at the start:
if (file.Action == "UnRegister")
{
DeleteFile(file);
}
Where the DeleteFile call (which logs success before attempting to delete the file - which is the source of the phantom success messages) is:
protected override void DeleteFile(InstallFile file)
{
if (DataProvider.Instance().UnRegisterAssembly(Package.PackageID, file.Name))
{
Log.AddInfo(Util.ASSEMBLY_UnRegistered + " - " + file.FullName);
base.DeleteFile(file);
}
}
Which becomes:
protected virtual void DeleteFile(InstallFile insFile)
{
if (DeleteFiles)
{
Util.DeleteFile(insFile, PhysicalBasePath, Log);
}
}
Where the 'DeleteFiles' flag is a property which is always false.
What looks to be happening, is that the 'DeleteFiles' flag is false by default, but can be set to be true when uninstalling through the front end, by ticking the checkbox which states 'Delete Files?'
Is there a way to set this flag directly using a manifest file, or am I going to have to modify the source directly? (I'm stuck on v5.6.1 - internal site, although I have replicated this on the latest build).