Uninstalling My Package Also Deletes the Only Copy of My Custom Node File (.dyf)

I try to create a Dynamo script to be used by multiple users (draftsmen) in the company. I need to find a mechanism to distribute the script. I am under the impression that I should publish the script in a package and distribute the package to the users. But when I am testing the publishing and uninstalling process, I encounter a problem: The uninstall process also deletes the only master copy of the script file. I am wondering if I have been organizing the package incorrectly. Please let me know the right way to publish the package to avoid this problem.

The following is what I did that leads to this problem:

  1. I create a custom node “OUR-Test” and save it as a .dyf file in the local drive like this:

    C:\TestLib\OUR-Test.dyf

  2. I publish (locally) the custom node in a package (let say “OUR-TestLib”) and save it in a shared network S: drive like this:

    S:\IT\Source\OUR-TestLib

    I find that the custom node file is moved from C:\TestLib\ folder to S:\IT\Source\OUR-TestLib\dyf folder. I “guess” this is normal and is meant to prevent having multiple copies of the custom node file floating around.

  3. The problem happens when I try to test the uninstalling process. As soon as I finish uninstalling the package, I find that the only master copy of the custom node file is deleted along with the entire folder (OUR-TestLib).

Is that how this is supposed to work? Or if I am missing a step somewhere?

Please let me know how I should do this correctly. Thanks.

I have never messed with publishing a package, so can’t provide input on that. However, I have to share my content with a few dozen co-workers. Each user has a specific folder on their C drive that houses all custom nodes. Then had each user add that folder path under the manage node and package paths within Dynamo.

Thanks for replying. This means I can do the following to distribute my Dynamo scripts:

  1. Do all the development work in a separated folder – such as a folder in the local drive or a folder in a shared network folder, like this:
    S:\IT\Source_Master\OUR-TestLib\OUR-Test.dyf

  2. After I have fully tested the script, I DON"T publish it. Instead, I can copy it to another network folder where the users have permission to get access to it, such as:
    S:\IT\Source_Shared\OUR-TestLib\OUR-Test.dyf

  3. Use a login script to copy the latest Dynamo script from that “S:\IT\Source_Shared\OUR-TestLib” folder to a local drive in the user’s PC (such as C:\OUR-TestLib). I have used the login script as a way to distribute program updates to many users. This is a tried-and-true method.

  4. Ask the users to add the local folder (like C:\OUR-TestLib) into Dynamo “Manage Node and Package Paths”. This is a one-time setup.

What do you think about this approach? I am asking this because seem like the “recommended” method is to publish the Dynamo script in a package. I am wondering what will be missing if I don’t publish the Dynamo script in a package.

Thanks. And I am glad that you point out an alternative way of distributing Dynamo scripts. I will try this alternative method.

1 Like

No problem.

I use batch files in lieu of a login script, but other than that, the rest is exactly the same as I do. #4 is a one time thing, but if you are running multiple versions of Revit, it has to be done in each version. One neat trick that I got from a webinar. Create a text file where you input comments about updates and new stuff and have that copy over to each persons local drive and overwrite if existing. That way if they have any issues, check the text file is up to date and if not, then you know the login script hasn’t executed properly.

Just so there is no misunderstanding, a dyf file is called a definition and a dyn file is called a script or graph.

Yes, I also use a text file (I call it a “log” file) to indicate if the user computer has been patched, such as:
PatchLog_2023-07-05_01.txt

The log file has a short description of what was fixed – that is for user to check what have been patched recently. This is like what you have suggested.

And thanks for letting me know the correct terminology for calling .dyn and .dyf. I didn’t know this. If I understand this correctly, they are called in various ways:
.dyn ← Dynamo Script or Dynamo Workspace or Home Workspace
.dyf ← Dynamo Definition or Custom Node

1 Like

That is the correct terminology!

Btw, since I really didn’t resolve your initial issue, go ahead and unmark my comment as the solution. This will avoid confusion for anyone else that may have the same issue with uninstalling a package and expecting to find a solution in this thread.

I will leave yours marked as “solution”. I have a feeling that there is no direct solution to my original question. The behavior (deleting the only copy of the script/definition after an uninstall) seems to be “By Design” and is not a bug. That behavior makes sense when it is installed/uninstall in a user PC – that seems to be the primary reason of publishing a package. The problem that I have seems to be related to the fact that I am the one who creates the script/definition. In other words, I probably use the wrong tool for my purpose. In this sense, using your solution makes sense for me.

1 Like