Notifications
Clear all

[Closed] mzp.run: fileIn, run,drop folder/file.ms not working

Sorry, that’s not what I’m after. What I want is to execute a script in these three cases:
-The mzp is dropped into max (i.e. the drop command)
-The mzp is run through fileIn/run script (i.e. the run command)
-The mzp is unpacked using msZip.unloadPackage.

The last one is what I need a solution for. The maxscript documentation lists fileIn under the mzp documentation, but I found that this does not work at all in mzp.run.
The reason I want to do this is because I want to split the code for installing the tool and the installer dialog. The installer struct should always be loaded, the dialog only in the first two cases.

I can do this, but I don’t really like it so much:

if msZip.unloadPackage mzp &extractDir &dropFile then
(
	fileIn (extractDir + "/installer/installer.ms")
)

Surely you want to use msZip.fileInPackage rather than msZip.unloadPackage.

In the documentation, it states that:

msZip.unloadPackage:
This method will unload the package while ignoring any drop or run commands and return the extract_dir and any primary drop file.

msZip.fileInPackage:
This method will unload and run a zip package

Maybe my previous ‘requirement’ was not entirely complete. When I drop or manually run the mzp, in addition to the “install struct”, I also want to run the “install UI” code. That’s something I do not want when using msZip.unloadPackage.

Page 2 / 2