Extension Installer V2 (4 Viewers)

Disore

Portal Pro
February 27, 2009
72
16
Home Country
Sweden Sweden
I have a problem where uninstalling my plugin doesn't remove all installed files. It leaves a file called AxisCameras.dll, which contains the implementation of ISetupForm which makes MP believe the plugin still is installed. When investigating the following folder:

%allusersprofile%\Application Data\Team MediaPortal\MediaPortal\Installer\V2\7295daa1-612d-4896-8672-443bd5ce5ba0\1.1.0.0\BackUp\%Base%\Plugins\Windows

I see AxisCameras.dll. Can you please describe in what situation a file is backed up, and also how this is affecting the uninstallation?

I would like to bump my question. I've done some more investigation, and it seems that when I uninstall Axis Cameras 1.0.0.0, the extension installer doesn't remove AxisCameras.dll. Is this a bug or a weird feature I don't understand?
 

vuego

Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,643
    764
    Göteborg
    Home Country
    Sweden Sweden
    I believe this is yet another bug in MPEI. I have the same problem that uninstall ignores the first file in a group. Is your dll file first in a group? Try moving it further down or add a dummy file if needed.
     

    Disore

    Portal Pro
    February 27, 2009
    72
    16
    Home Country
    Sweden Sweden
    I've tracked down my problem, and it is a bug.

    In class PackageClass we have the following code:

    Code:
    /// <summary>
    /// Do the unistall procces. The unistall file info should be alredy loaded.
    /// </summary>
    public void UnInstall()
    {
      for (int i = UnInstallInfo.Items.Count - 1; i > 0; i--)
      {
        UnInstallItem item = UnInstallInfo.Items[i];
        if (string.IsNullOrEmpty(item.ActionType))
        {
          MpeInstaller.InstallerTypeProviders[item.InstallType].Uninstall(this, item);
          if (FileUnInstalled != null)
            FileUnInstalled(this, new UnInstallEventArgs("Removing file " + Path.GetFileName(item.OriginalFile), item));
        }
        else
        {
          MpeInstaller.ActionProviders[item.ActionType].UnInstall(this, item);
          if (FileUnInstalled != null)
            FileUnInstalled(this, new UnInstallEventArgs("Removing action " + item.ActionType, item));
        }
      }
      UnInstallInfo.Items.Clear();
      DoAdditionalUnInstallTasks();
    }

    The problem is that the first file with index == 0 won't be uninstalled since 'i > 0' is stated in the for-loop. Dukus, can you fix this? Or else I volunteer to fix it if given the correct permissions. :)

    It won't help me since I've already released a second version of my plugin, and the leftover file from uninstalling the first version will be cached by MPE when installing the second version, but it may help new plugin developers.
     

    Seidelin

    Retired Team Member
  • Premium Supporter
  • August 14, 2006
    1,755
    652
    Kgs. Lyngby
    Home Country
    Denmark Denmark
    Fix is in svn 27925. Thanks for isolating the issue and providing the fix. It would be nice if you can verify the fix is working (binary attached), so we can close the mantis issue.
     

    Attachments

    • MpeCore.zip
      69.8 KB

    Users who are viewing this thread

    Top Bottom