Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Conflict between MCR and MATLAB?
Date: Thu, 30 Apr 2009 19:04:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 41
Message-ID: <gtcsn1$117$1@fred.mathworks.com>
References: <gtcf25$9sm$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1241118241 1063 172.30.248.37 (30 Apr 2009 19:04:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 30 Apr 2009 19:04:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869596
Xref: news.mathworks.com comp.soft-sys.matlab:536531


"Martyn " <martynjjones@gmail.com> wrote in message <gtcf25$9sm$1@fred.mathworks.com>...
> Apologies if this problem has been answered else where, but despite multiple searches, I haven't been able to solve my problem.
> 
> I'm developing software in .NET C# that incorporates a module that uses compiled matlab which was developed by another organisation within our consortium.
> 
> For most users who don't have Matlab installed the MCR does fine, although annoyingly we have to update the environment path variable with '...\v76\bin\win32'. Once thats done everything works ok. However...
> 
> If someone has MATLAB installed (R2007a) then without the MCR it doesnt work. The software throws an error but otherwise continues. The bits that use matlab dont work.
> 
> With MATLAB and the MCR installed but not the environment fix the same happens, errors are thrown but the software continues to work.
> 
> With MATLAB and the MCR installed and the environment path variable fixed the software hangs and eventually quits. 
> 
> Given that last scenario, and how it differs from the others, i'm guessing some kind of conflict is occuring between the MCR and full MATLAB install. I could probably handle the exception in the last scenario, but thats not really the issue.
> 
> If anyone has had similar experiences of using the MCR and MATLAB, or may know why MATLAB without the MCR isn't working (a different version to the compiler maybe?) I would be very grateful. Unfortunately I don't have MATLAB which makes this even more confusing!
> 
> Many thanks.
> 
> Martyn


Martyn,

I ran into this. I ended up having the user link to my Matlab application hit a batch file that checks for the MCR and sets the path accordingly. It looked something like this (as an example, your paths will be different of course):

if not exist "C"\Program Files\MathWorks\MCR\7.0.1" goto NTWK
set PATH = C"\Program Files\MathWorks\MCR\7.0.1\runtime/win32;%PATH%
goto RUN

:NTWK
set PATH = Y:\MATLAB\Rel14-SP1-7.01\bin/w32;%PATH%
goto RUN

:RUN
path
start /MIN Myapplication.exe

The basic idea being that you check for the MCR and set the path for the application.

hth