[Closed] Deleting plugin DLLs
Hi
I am in need of a creative solution on how to delete (or overwrite) a 3dsmax plugin DLL via scripting. This has to be able to run on 3dsmax startup, even if doesn’t delete it there and then.
I tried using a dotnet process callback, to do this after 3dsmax has closed, but this of course did not work because 3dsmax had already closed and the callback can not run. Is there an option to send a callback to windows itself, that will be independent of the sender (3sdmax) and not rely on it being open?
Any ideas are welcomed!
Thanks
edit: just to be clear, the problem with doing this by just deleting the file from maxscript, is that plugins are loaded before startup scripts, and are already resident in memory, so there is no permission to delete them.
do you want to unload loaded max plug-ins? do you want to delete max plug-in DLL files? do you want to delete max assembles to load newly compiled?
and why do you need to do it?
What I did, is make a c#.net executable named 3dsmax.exe and renamed the original 3dsmax.exe to 3dsmax.orig.exe. Once my exe finishes it’s routines (syncing scripts/plugins) it fires the orig max exe.
No problems with dependencies. You could probably do it with batchscripts too.
-Johan
Sorry. Probably I miss the point. Why do you name the executable c# as 3dsmax.exe and rename the original one? Is it just for keeping the target of standard MAX shortcuts?
My guess is because network rendering launches the 3dsmax.exe. His method forces even rendernodes to update prior to starting the render process. I tried doing it with just a batch file, but network rendering won’t update automagically like his method does. You need to replace the .exe so that anytime the 3dsmax.exe is called it will update the needed files.
-Eric
Woah that is truly devious!
Thank you for the suggestion, I will try to draw ideas from it. Ideally I would love to get this done without having to change anything in the client machine manually (I have a whole lot of machines to do this to).
Please post back what you came up with, I was also inspired by the prime focus has it’s setup.
-Johan
Sorry, but when you say ‘you could probably do it with batch scripts too’ what exactly do you mean? could I somehow run a batch script as 3dsmax.exe?
I want to copy plugin dlls from a network location on max startup. I already have a system that does this, but it does not work if I need to update a version of a plugin (overwrite a loaded dll).
The purpose of this is to help manage plugins for a renderfarm.
Due to limited network bandwidth I’d rather copy the files when needed and not read plugins from a network location directly (via setting another plugins path in the plugins.ini file).
I understood that you need to unload already loaded plug-in to copy new version from network and load this new version.
First of all if you are the developer of this plug-in it’s up to you how to define the rule of the plug-in loading. You can say to MAX to load the plug-in just when it has to be used, and don’t load it on MAX startup. Also if you are the developer, you can easily add self-unload method to the code (it’s easy to do with max SDK).
If the plug-in is build-in or third-party it’s not safe to unload it. But you still can do it with max SDK (there is no way to do it with mxs).
But I recommend to copy all used plug-ins from network at first and then to launch MAX.
Hi Rotem,
What you’re trying to do isn’t very safe, since you’re trying to unload plugins that are already in memory, which might cause max to be unstable. If you really want to go that route, there’s an unload plugin utility ( http://scorp007.comze.com/ ). I could find a maxscript interface for it, but you could automate it by simulating button clicks.
However, if you only want to update your plugins from time to time, why not use backburner’s cmdJob? Granted, you’ll need a script that can be executed outside max, but there are plenty of options for that (and if it’s only a simple copy of a folder tree, you could use good old batch files).
Cheers,
o
I would combine the custom .exe with the BB cmdjob to distribute it to all machines. It is rather simple to handle copying files through backburner, I have it setup to handle updating plugins when I want with batch files. However, the best way to force it to happen every load is use the custom .exe to copy the files and then launch a renamed version of the original .exe (as JHN suggested).
-Eric
Hey Ofer!
that’s just sane enough to work!!
Seems I’ve been thinking way too far out of the box on this…
I’ll give it a shot and post how it goes