Jump to content

Windows deleting files.


Recommended Posts

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. 

Link to comment

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. 

Link to comment
  • 2 weeks later...
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

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...