Jayme McColgan Posted November 17, 2021 Share Posted November 17, 2021 hey everyone, so I'm writing a plugin that will allow people in my company to update all our custom plugins and such from inside VW and part of the process is deleting some files in the userfolder and the application folder, then replacing them with new ones. it runs great on mac but on windows i get a permission error with deleting files from the application folder. everything online says i need to run the script as administrator but thats not really a thing when running VW plugins? also is there a way to close VW and restart it at the end of a python script? right now i have to tell the user to manually restart but id be nice if i could do it automatically. Quote Link to comment
JBenghiat Posted November 17, 2021 Share Posted November 17, 2021 What sort of files are you trying to remove? The first thing would be to check permissions in the user folder in explorer. If you’re removing compiled plug-ins or vwr files, Windows keeps those loaded while Vectorworks is open, so you can’t delete them. You can move them to a trash folder outside of plug-ins. That way they won’t load, and you can cleanup on the next script run. One option would be to build a partner products installer and distribute it using the developer testing procedure. You would need to copy your installer into the user plug-in data folder. The partner installer moves files as Vectorworks is quitting to get around these issues. Quote Link to comment
Jayme McColgan Posted November 29, 2021 Author Share Posted November 29, 2021 On 11/17/2021 at 1:39 PM, JBenghiat said: What sort of files are you trying to remove? The first thing would be to check permissions in the user folder in explorer. If you’re removing compiled plug-ins or vwr files, Windows keeps those loaded while Vectorworks is open, so you can’t delete them. You can move them to a trash folder outside of plug-ins. That way they won’t load, and you can cleanup on the next script run. One option would be to build a partner products installer and distribute it using the developer testing procedure. You would need to copy your installer into the user plug-in data folder. The partner installer moves files as Vectorworks is quitting to get around these issues. hmm that might not be an option sadly. ill report back if i come up with a solution. thanks Quote Link to comment
Jayme McColgan Posted January 20, 2022 Author Share Posted January 20, 2022 my current workaround is building an external script that opens a powershell as administrator and then runs all the nessacry deleting/creating of files. not a perfect answer but it works. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.