[Closed] max version detection ?
Hi,
we make installer for some 3dsmax plugins
and we were wondering is there a way to
guess which version of 3dsMax (32bit-64bit)
is installed on this machine and where is its
install dir, by just reading the windows registry.
Hi,
The registry key for the installation dir is:
HKLM\SOFTWARE\Autodesk\3dsmax\8.0\Installdir
The 8.0 represents the max version. You have a different key for each installed version.
hOpe this helps,
o
Yes and 9.0 for r9 and 2008 is 10.0 But the 32/64 is more of a hardware thing so I wouldnt look up the install of max for it but just the system value somewhere…
is64bitApplication()
NEW in 3ds Max 9: Returns true if running in a 64 bit build of 3ds Max, false otherwise.
well I need to recognize 32 from 64 bit max installation, before installing the plugin
I think this is more of an SDK related thing than Maxscript. I am guessing the installer is a standard Windows installer/executable. So all the maxscript help is probably rather useless.
-Eric
I know it’s probably not what you really want, but I’d suggest having seperate x32 and x64 installers.
As I recall, the “program files” environment variable will return a value based on the OS type AND the executable type.
That is, OS = 32, executable = 32, program files = “C:\Program Files”
OS = 64, executable = 32, program files = “C:\Program Files (x86)”
OS = 64, executable = 64, program files = “C:\Program Files”
So all you need to do after that is check which version of max is installed…
Shane
What if max isn’t installed in program files?
I’d suggest querying the registry keys, starting from the latest version you support going down, until you either find a match, or none exist, in which case provide a default path.
Look up RegQueryValueEx or perhaps RegEnumValue.
Your installer itself is likely to run in either 32bit or 64bit mode. Most installers also allow you to switch the registry to read from, however. E.g. NSIS via setRegView.
After that, as mentioned earlier, you’ll need to read the installation location from the registry. Unfortunately, Kinetix/Discreet/ADSK haven’t always been consistent. Here’s the registry locations we use:
HKLM\SOFTWARE\Autodesk\3DSMAX\4.0\MAX-1:409\uninstallpath
HKLM\SOFTWARE\Autodesk\3DSMAX\5.0\MAX-1:409\uninstallpath
HKLM\SOFTWARE\Autodesk\3DSMAX\6.0\Installdir
HKLM\SOFTWARE\Autodesk\3DSMAX\7.0\Installdir
HKLM\SOFTWARE\Autodesk\3DSMAX\8.0\Installdir
HKLM\SOFTWARE\Autodesk\3DSMAX\9.0\MAX-1:409\Installdir
HKLM\SOFTWARE\Autodesk\3DSMAX\10.0\MAX-1:409\Installdir
That will only give you the main application installation folder, however. Ever since 3ds Max 9, there is also a user dir in e.g.
“c:\Documents and Settings\Username\Local Settings\Application Data\Autodesk\3dsmax\9 – 32bit\enu”
However, I don’t think there’s any way to reliably get this folder location outside of max itself (within max, the paths API/maxscript should reveal it). You could try and make an assumption, but that ‘enu’ (english language) gets in the way and you’d have to detect for the other languages as well; I don’t even know what strings they use
So installing for e.g. “current user” only is a bit problematic.
Depending on what you want to do, you may wish to write something that will install for all users a small plugin/script that, upon max startup, finishes completion to the correct user folders – if needed. If not needed, then the registry strings should be all you need.