32 or 64 bit?

32 or 64 bit?

Anonymous
Not applicable
637 Views
15 Replies
Message 1 of 16

32 or 64 bit?

Anonymous
Not applicable
Is there a way through maxScript to determine if a user is running the 32 or 64 bit version of Max? I need to use this information to point the user to the correct plugin folder when we install our custom tools.
0 Likes
638 Views
15 Replies
Replies (15)
Message 2 of 16

DarrenP
Consultant
Consultant
does he have a 64 bit os?

DarrenP
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

0 Likes
Message 3 of 16

Anonymous
Not applicable
Yeah.
0 Likes
Message 4 of 16

Steve_Curley
Mentor
Mentor
getMAXIniFile()
Returns the full path to the .ini - which includes either "9 - 32bit" or "9 - 64bit" (in the case of Max9), "2008 - 32bit" and "2008 - 64bit" for Max2008. A quick string search should find that for you.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 5 of 16

Anonymous
Not applicable
Sounds like that'll work. Thanks.
0 Likes
Message 6 of 16

Anonymous
Not applicable
Or just use is64bitApplication() (see "64 Bit Values - Double, Integer64, IntegerPtr").
0 Likes
Message 7 of 16

Anonymous
Not applicable
That's exactly what I was looking for, thanks.
0 Likes
Message 8 of 16

Anonymous
Not applicable
That's exactly what I was looking for, thanks.


Since the method was introduced in Max 9, to ensure the script works in Max 8 and earlier, you should either call it inside a try()catch() or check the Max version first and if it is less than 9000, assume 32 bit version without calling the method.
0 Likes
Message 9 of 16

Anonymous
Not applicable

...or check the Max version first...


Hi Bobo!

What is the code for this?

Thanks.

Sascha
0 Likes
Message 10 of 16

Steve_Curley
Mentor
Mentor
maxVersion()

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 11 of 16

Anonymous
Not applicable
Geeesh...

...lucky one able to read...

..got tomato on my eyes...

Thanks man!

Sascha
0 Likes
Message 12 of 16

Anonymous
Not applicable
Works fine, thanks.

Now I try to delete a folder with white space name, e.g. "C:\a test\".

This code works fine:

doscommand "rmdir \"C:\a test\""
0 is returned, the folder is gone.

...but I have to build the commandstring via script, so this doesn´t work:

myPath = "C:\\a test\\"
myString = "rmdir" + " \\" + "\"" + myPath + "\""
doscommand myString
161 is returned and the folder is still there...

Any ideas?

Thanks and best regards.

Sascha
0 Likes
Message 13 of 16

Steve_Curley
Mentor
Mentor
You need to look more closely at what you're producing there. Look at it section by section.

The MyPath does not need the trailing \\

MyPath = "c:\\a test"

The MyString does not need the first " \\"

MyString = "rmdir" + " \"" + MyPath + "\""

Which results in

rmdir "c:\a test"

But your code was producing

rmdir \c:\a test\

which was trying to find a directory called "c:" in the root of the current drive (containing a directory called "a test"), which obviously doesn't exist, hence the error.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 14 of 16

Anonymous
Not applicable
Thanks Steve, that works!

But what I don´t understand is:

myPath = "C:\\a test\\"
myString = "rmdir" + " \\" + "\"" + myPath + "\""
doscommand myString


When I print myString it returns

"rmdir \"C:\a test\""


not

rmdir \c:\a test\ 


as you mentioned...

So where are the colons gone?

Nevertheless - thank you very much!

Sascha
0 Likes
Message 15 of 16

Steve_Curley
Mentor
Mentor
There's only 1 colon - immediately following the C as in "C:"

If you open a command prompt and type
<code>
rmdir "c:\a test"
</code>
it works. Consequently you must recreate exactly that sequence of characters - no leading or trailing backslashes, which you keep putting in there. They are not only not required but they are causing a different (and incorrect) path to be passed to rmdir.
Your code will put the backslash before the C - because you're putting it there. It puts a trainling backslash in as well - which is not required.

Also, whenever Maxscript prints a string - it puts quotes around it for display only - they are not part of the string being displayed. I left them off above to try and simplify things for you.
Look at the attached image - every string displayed (in the bottom section) has quotes around it, but they are clearly not part of the string itself.


Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 16 of 16

Anonymous
Not applicable

Also, whenever Maxscript prints a string - it puts quotes around it for display only


Yeah, thought this might be the case. Now I know!

Steve, again thank you very much. Works very well!

Now I could finish to script a *.mzp installer package for my scripts AND a script to uninstall the whole thing again. Very comfortable.

Best regards.

Sascha
0 Likes