Notifications
Clear all

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

I have 2 mzp related problems:

  1. I’m trying to make an mzp file which will always execute a maxscript file when it is unpacked. This should be regardless of whether it is through a drag&drop action, the main menu, or through maxscript. So I thought the fileIn function should do the trick. However, this does not seem to work.

  2. If I try to use the run or drop command on a file that is not in the root folder, 3dsmax crashes upon dropping the mzp file into 3dsmax.

Any ideas?

12 Replies

Ok I found the solution to the second issue. It’s a matter of supplying exactly the right format it seems:

run directory/file.ms --does not do anything
run "directory/file.ms" --crashes
run directory\file.ms --works

I haven’t yet found a solution to the first issue though!

Have you tried using execute instead of fileIn?


execute (openFile (getDir #scripts + "test.ms"))

I’m not entirely sure I understand point 1. Are you trying to run a script that you have just copied into a max directory from a mzp?

For example:
–Drag mzp into viewport
–Files are copied to 3ds max dir, (eg scripts)
–Files copied into 3ds max dir are then evaluated

Is that right?

PJansen I also fought alot to find out how to do a correct MZP install… and I’m still missing somethings but here’s what I’m using for iDevCam:

mzp.run:

name "iDevCam"
version 1

treeCopy "iDevCam" to "$scripts"
copy "Icons\\*.*" to "$ui\\Icons"

drop "iDevCam-Installer.ms"

clear temp on MAX exit
clear temp on reset

iDevCam-Installer.ms

(
	filein "$scripts\\iDevCam\\iDevCam.mcr"
	messageBox "Thank you for buying iDevCam 1" title:"iDevCam"
)

I hope this helps! Cheers.

What I want to in the mzp.run is always execute a ms file which contains an installer struct. I will then have a run and drop command that will start a UI if the mzp was dropped into max or run directly. This should start the installer UI.
However, I also want the installer struct to be loaded when using the msZip.unloadPackage command. This will ignore the run and drop commands in the mzp. I want to use that to be able to call the installer without creating the UI.

@TimHawker: using execute in the mzp.run does not work. It’s not in the documentation either actually.
@Kameleon: I need to execute the file from the mzp.run, not from another maxscript file for the reason mentioned above.

Thank you very much Kameleon!

I’ve been searching the whole night on a posting explaining how I might get that freaking mzp to work. The posting was super helpful.

-k.

No problem, I’ve also spent hours trying to figure this out and could only gather bits of info from different places till I got it right… kind of, now I want to avoid having to copy it to a system folder because of permissions… will try that later on

I was just messing with this stuff yesterday. They explain it somewhat well in the MXS Help. Just took a little fiddling to get it right. Glad u got it sorted.

Actually the first issue is not sorted out yet.

In that case, this worked for me. It executed the .ms file on running the mzp.run


treeCopy turboTools to $scripts
drop $scripts	urboTools\install.ms

Page 1 / 2