MATLAB: Is it possible to add file/product version information to an executable compiled with MCC

executableMATLAB Compilermccversionwindows

I’ve been trying to add file/product version information to an EXE file compiled with MCC. Specifically, I'm trying to set the version numbers you see when you right click and get properties on the EXE within Windows Explorer or in the columns in the Details view within an Explorer window. This information is embedded in the EXE in a specific way and I have managed to make it work if I compile as a DLL but I can’t get it to work when compiling as an EXE, which is what I need it to be.
I created a *.res file in Visual Studio 2008 with the necessary information. When I use the following command line to MCC (R2011a) the version information is successfully included, but (obviously?) I get a DLL not an EXE.
-mv myCode.m -l matlabResFile.res
So, I have proven that the res file is correct and it can be done in at least one way. However, I’m can't find the right MCC options to produce the an EXE file with version information.
I’ve done a lot of online searching and the closest I’ve come is this post about changing the icon of an EXE using resource files: http://www.mathworks.co.uk/support/solutions/en/data/1-324E1D/index.html?solution=1-324E1D. It seems to use the –M option but this just does nothing for me.
Is it actually possible to add the Windows explorer compatible version information at compile time and if so how can it be done? (I know I could use a 3rd party tool after compilation but I’m trying to avoid this)
Thanks, Matt

Best Answer

I ended up having to contact mathworks support as we needed an answer quickly. They said...
"The "compilation" in MATLAB Compiler is quite a bit different for DLLs and standalones. When creating a DLL you are indeed actually compiling C/C++ code and then you can indeed add a resource script/file to include version information. When compiling a standalone however, MATLAB Compiler works with a precompiled launcher so it is not possible to compile a resource script into it. You can add resources afterwards though using tools like "ResHacker"."
Related Question