My general recipe for sequencing AutoCAD 2015 is found in this post from a couple of years ago: https://www.tmurgent.com/TmBlog/?p=2268
Today, Patrick Mangan reminded me that he had to modify that recipe to handle AutoCAD 2016 and 2017.
In the original recipe, we handle the problem of the runtime AutoCAD writing a dll file outside of the virtual environment to a folder in the user’s AppData\Local\Autodesk folder by making that folder as Merge With Local in our package.
Although this is still needed for the 2016/2017 version of AutoCAD, Patrick found that if the external folder didn’t already exist, the file creation fails. So we need to adjust the recipe further. My recommendation is an Add-Package script. In the sequence editor, I would first change the folder to merge with local, then add the ScriptLauncher tool into my package scripts folder, and then export the AppXManfest file to edit it with the AppxManifestEditor tool to add in the user publish script and finally import the saved file back to the package.
The problem with user publishing scripts is that the script doesn’t know the correct answer to user based environment variables you often want to use. By making the script run ScriptLauncher.exe and having it run cmd.exe with the mkdir command, we can reference the folder we need to create as “C:\Users\%EffectiveUserName%\AppData\Local\Autodesk\…” and it will resolve correctly.
Patrick also told me that he is using the current sequencer version, so apparently whatever the issue was that caused us to need to use the older sequencer version has been resolved by a later sequencer fix.
Thank you Patrick!