Deploying a default folder location, doesn't work

We’re rolling out a new script library and we’re trying to automatically point people’s Players to the correct spot on the server. Our batch script is wiping all “dynamoplayerinstance #” folders from "C:\Users%USERNAME%\AppData\Local\dynamoplayer-4\2022\User data" and creating a fresh dynamoplayerinstance 1 folder with the correct files.

Problem is that to create that correct folder, when I manually point to the folder in my player and then close it, my own Preferences file here doesn’t even show the full path. It adds an extra “\” character to each existing one and it cuts off the last folder path. So for example, “R:\AS 2022\Dynamo\AS 2022 Dynamo Scripts” will update the preferences file with “R:\\AS 2022\\” It also doesn’t matter if I change that path, my Player will always default to the last folder opened.

When we do a test deployment, the test user’s default folder also doesn’t update even though their preferences file specifies the correct folder.

Is there another preference file location that could be overwriting or controlling the actual folder that Player defaults to? Or could it be something with how our server location is named? Is there another setting in the preference file that needs to be adjusted?

It would help to see what your files look like and what your script is doing. This is definitely possible by updating the “last folder path”, but that’s all it is. You can set that once, but Player will always open to the previous location. It doesn’t reset to a “default” path.

Wait, so there’s no way to set the preferences file to force it to point to a specific folder the first time it’s opened and it will always default to the Samples folder?

Is there no file that tells it to look at the Samples folder that I can modify?

The only setting for a location is “last_directory” which by default is the samples folder. You can change this to something else so that users open to a predetermined location the first time they run Player. I’m just saying that once you set that the user is free to browse to a different location and overwrite that setting. So your script would have to run every night if you wanted to ensure that the “default path” is set every single day.

As for the issue you’re having, if you manually browse to a location in Player (then close out) and that location is not updating in your Preferences file then there’s a problem. The path will have double slashes in the file since it’s just a string, but it should show the full path.

Ah I understand, that’s what I thought but was getting frustrated & hopeless haha. I’ve attached the Preferences file, I had to add .txt to get it to upload. If that doesn’t work I can paste the entire thing into a reply.

Preferences.txt (7.5 KB)

It updates when I point to a new folder in Player, but Player doesn’t point to a new folder when I update the preference file in Notepad (always waiting for Player to fully close and the lock file to disappear before opening or editing the file)

Correct. The setting is only used for the folder location on open. So in order for it to update in Player you have to close and reopen Player.

Your path looks good, assuming that’s the location.
R:\\EC 2022\\Dynamo\\EC 2022 Dynamo Scripts

The setting is only used for the folder location on open . So in order for it to update in Player you have to close and reopen Player.

That’s the part that’s not working. Here’s what I’m doing:

  1. Player is pointing to whatever location
  2. Close Player
  3. Edit Preference file in notepad to replace last folder location with R:\EC 2022\Dynamo\EC 2022 Dynamo Scripts
  4. Save & close pref file
  5. Reopen Player, still pointing to whatever location, not R:\EC 2022\Dynamo\EC 2022 Dynamo Scripts

Are you sure you’re modifying the correct dynamoplayer-n folder? Different versions of Revit use different versions of Player. You have to update the correct folder for the version of Revit you’re using.

I only have dynamoplayer-4 /Revit 2022 installed. All the updates applied, and I’m using the correct folder of dynamoplayerinstance # as well.

Edit: the weird thing is, if I delete the dynamoplayerinstance folders to start fresh, when I open/close Player, the preference file that’s created doesn’t even have a “specified file / last directory” in it

You’re right, I was missing something. I thought this was no longer required, but it seems like you do still need to include these encrypted files for the path to actually update.

You can manually set Player to the correct location, close, then copy those files from your local player settings to a shared location. Your script would then have to copy those files to each user’s settings as well.

1 Like

That did it! Thank you so much for your patience!

1 Like