DynamoDS/Dynamo — pull request #2213 by pboyer (2014-08-22 22:07:49+00:00)
Title: Submit DLLs to the Package Manager (DO NOT MERGE)

### Intention

The package manager for Dynamo is a pretty general tool. Ultimately, it defines a schema for dependencies between "packages," which can be arbitrary things (in our case, zip files). There is a strong use case for being able to share binaries through the package manager. Many "power users" have C# abilities and want to be able to share their work through the package manager.

### Contents

This pull request extends the Dynamo UI to support adding DLL's to packages and publish them and to manage packages with DLL's that are part of the application. This capability actually has existed for a while in Dynamo, but was not accessible in the UI. Uninstallation wasn't really "figured out" and zero touch assemblies were not supported. This is an initial attempt at bringing this feature up to date.

### Installation of packages with binaries

This works essentially as it always did, the only difference being that when the package is loaded, the system determines if it is a "NodeModel" style binary or a "zero touch" style binary, and then loads the binary appropriately. These libraries immediately appear in the users search library.

Here's the result in the "Manage Packages..." menu:

![packagecontents](https://cloud.githubusercontent.com/assets/916345/4018019/ddcae034-2a46-11e4-8fe5-5b36cd4d4ff6.PNG)

(I realize that I cannot ship NCalc in this piece, this is only available on a non-public staging server.)

### Creation of packages with binaries

The user can use the typical package publish UI. Except now they can add DLL's to the package.

Here we can see the file open menu available by clicking the top right corner of the package contents in the package publish UI:

![fileopen](https://cloud.githubusercontent.com/assets/916345/4017940/07f85342-2a46-11e4-9fe0-4696d428768b.PNG)

Now the assembly is added to the package (the UI should visually differentiate between assemblies and custom nodes, not yet done):

![publish](https://cloud.githubusercontent.com/assets/916345/4017952/211e0506-2a46-11e4-8c13-8208f6ae1d82.PNG)

### Uninstallation of packages with binaries

It is not possible to remove an assembly from the AppDomain once loaded. Instead, I "mark" the package for uninstallation and store this in the persistent preferences. The package is removed on the next restart of Dynamo. This is the experience, in a nutshell:

When the user attempts to uninstall the package from the "Manage Packages..." menu, they get this message:

![loaded](https://cloud.githubusercontent.com/assets/916345/4018010/d0232e50-2a46-11e4-833f-379c622cea91.PNG)

If the user accepts, the package is "marked" for uninstallation - note that the user can then "unmark" the package from the same dialog:

![wallelements](https://cloud.githubusercontent.com/assets/916345/4018054/73a072e0-2a47-11e4-8d08-7c99b34dea48.PNG)

### Further work

This submission is not yet "fully polished". I'd appreciate some guidance about how far I should go here, so that we don't have to wait forever for this feature.

1. Visually differentiate between assemblies and custom nodes in Publish Package UI
2. Auto-discover all assembly dependencies (this is a bit tougher to do than I originally thought)
3. Licensing - how do publishers define their packages license. Is this relevant?
4. Sandboxing - How do we limit the capabilities of packages with binaries?
5. Discover assembly dependencies in custom nodes

### Reviewers

@Benglin, @ikeough, @lukechurch - Have at it!

FYI @tatlin