Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDeleting assemblies when updating an existing module.Deleting assemblies when updating an existing module.
Previous
 
Next
New Post
11/27/2012 6:52 AM
 
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).
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDeleting assemblies when updating an existing module.Deleting assemblies when updating an existing module.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out