Frage

I've set up a repository to distribute plug-ins using Npackd. I am aware, that I can use a batch script to move all files from a package wherever I want, but I'm afraid I might accidentally overwrite files. Currently, my setup works like this (which is npackd common practice, I believe):

  1. a package myFile.zip gets downloaded
  2. the contents gets extracted to %PROGRAMFILES%\myPackage\myFile
  3. a batch script optionally moves the files elsewhere

Unfortunately, the Npackd documentation doesn't explain the internal process of how this is handled. My first concern is that a folder myPackage already exists and might get overwritten, consequently its files being moved by my Install.bat. Is there a way to define the destination path before the files get extracted? Since I'm installing plug-ins for an existing software, this would avoid my script moving all the files.

One way to achieve could be "abusing" the 7z examples, but if possible I'd like to a avoid the dependency since my plug-ins stored inside a standard zip archive, and Npackd can handle these without dependencies.

War es hilfreich?

Lösung

Npackd always creates a new directory during the installation of a package version. Normally the name of this directory is the package title (e.g. "Firefox"). If this directory already exists the version number is used as a suffix (e.g. "Firefox-27.0.1"). If this directory is also already there an underscore and a number is used additionally (e.g. "Firefox-27.0.1_2", "Firefox-27.0.1_3", etc.)

There is no way to define where a package should be installed exactly. As you would probably define a dependency on the main software package in each plugin anyway, I'd recommend something like this:

<dependency package="com.mycompany.WordProcessor" versions="[5.00.2195, 6.1)">
    <variable>WP</variable>
</dependency>
<file path=".Npackd\Install.bat">copy spellcheck.dll "%WP%\plugins"</file>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top