Menu

NEW plugin: PluginUpdate 0v10

Franco
2008-07-18
2012-11-14
  • Franco

    Franco - 2008-07-18

    I have developed a new plugin that allows to check and, in the future, download updates of plugins:

    PluginUpdate v0.10 that you can find here: http://fstellari.googlepages.com/npp_plugins

    I think you should like this but don't get too excited, note that only v0.10!!!
    It's not very fancy yet and only a manual check is available in this version... and no download... and no install!!!
    No options

    By default this will take care of my other plugins... but you can make your own plug in update:
    (for an example you can download my update package http://fstellari.googlepages.com/npp_plugins.ini\)

    1) the installed plugin "myplugin.dll" (either in the AppData or Program directory) shoudl have a corresponding "myplugin.ini" in the Plugins/Config directory with an entry like (note: it's a good idea that you plug in writes that data the first time is run bu Notepad++):

    [Update]
    URL=http://<mywebpath>/mypluginupdate.ini

    2) you should make available the "mypluginupdate.ini" file online at the location specified by the previous URL. "mypluginupdate.ini" should contain entry in the form:

    [myplugin.dll]
    CurrentVersion=<new version string>
    DownloadURL=<internet path where to find the new plugin>

    3) it's a good idea to have the file to download at the specified DownloadURL

    Since all the plugin out there do not have the [Update] URL=... entry, I can ONETIME add you plugin update info in my online npp_plugins.ini file so you can push a new version of your plugin that starts handling the update by itself. For that purpose just post you entry and when I have time I will cut and paste it in the npp_plugins.ini file.

    Best regards,

    Franco

     
    • Franco

      Franco - 2008-07-18

      I just wanted to add that it would make sens for me to continue this work only if otehr plugin developer would be interested in using this facility.
      My pluins are probably very little used so I'm not sure this would be work the effort.
      So I encourage posting from other developers to understand if and how it's working for them.
      Regards,

       
    • Franco

      Franco - 2008-07-21

      I have uploaded a new version v0.11 at the usual location: http://fstellari.googlepages.com/npp_plugins
      If you have v0.10 installed please use the "Check update" menu to verify that you can see the update...
      although it will not let you do much with it at least I know it works.

      Again this version is pretty much for developers that want to play with the way the update will work and implement the necessary changes in their files.

      Some bug fixes.

      This version fixes some issues in searching the config file when plugin do not place it in the right directory. The following search pattern is implemented (note that in non local apps the INI file should always be in %appdata%\Notepad++\Plugins\Config, while for local applas it should always be in %programfiles%\Notepad++\Plugins\Config, this indipendently from where your DLL is):

      if not exist doLocalConf.xlm then
         %appdata%\Notepad++\Plugins\Config
         %appdata%\Notepad++\Plugins
         %appdata%\Notepad++
      end
      %programfiles%\Notepad++\Plugins\Config
      %programfiles%\Notepad++\Plugins
      %programfiles%\Notepad++

      Also this version runs the check on a separate thread so that Notepad++ is free to used while checking.

       
    • Jens Lorenz

      Jens Lorenz - 2008-07-18

      This plugin is needed IMO. I will try it as far as I can.

      Anyway, Thanks and Best Regards
      Jens

       
    • Franco

      Franco - 2008-07-18

      BTW, I think I forgot to mention how the version checking is done.

      In summary, very poorly.

      The plugin "_stricmp" the content of the CurrentVersion= field to the ProductVersion embedded in the plug in.
      Note that "1, 0, 0, 0" is therefore different from "1.00" or "1,0,0,0".

      If a match is not found then the plugin assumes that there is a new version!

      Unfortunately everybody uses a different way of versioning files so I though this was the most general approach.

      I can change it to something else that we agree on.

      Bottom line the final user will always have some way to see the version and decide if it is worth updating.

      The major limitation that I see long term is the impossibility of installing the plugin since there is no way to dynamically unload a plugin and then request a reload.

      Regards,

      Franco

       
      • Martijn Coppoolse

        > The major limitation that I see long term is the impossibility of installing
        > the plugin since there is no way to dynamically unload a plugin and then request a reload.

        That's true. Perhaps you could rename the current plug-in DLL, then install the new plugin and tell the user that they need to restart Np++ for the update to take effect. On next startup, you could delete the old plug-in DLL (or move it to a backup dir).

        There is no plug-in message to restart Notepad++, is there? (NPPM_RESTART or something) Though I guess it might be possible to send a WM_CLOSE to the main Notepad++ handle, and let the user handle "Save file (yes/no/cancel)" dialogs -- and launch a new instance of Np++ just before quitting  :-P.