Thread Subject: Deploying Matlab exe file for shared access

Subject: Deploying Matlab exe file for shared access

From: Phil Newman

Date: 27 Aug, 2008 08:41:52

Message: 1 of 9

Hello,

this isn't a new topic, but it's one I am struggling to understand. I
have built a script file which calls a few functions, reads in data,
displays some text and produces figures.

I want to share this with a few other people.

The m-file is stored on a shared drive where everyone can access it.
The function files are in the same folder.

I have built the compiler using this command:

Mbuild -setup

And chose the compiler (not borland, LCC?)

I then compiled the m file using this command

mcc -m script.m -o script

This comiles fine, and I can run the exe file on my machine, no
problem.

I've tried doing it on a colleagues PC who doesn't have matlab
installed, and it asked for mclmcrrt77.dll file.

I then tried installing the MCR installer, see if this helps, but it
won't let me install. I've put the installer file in the same folder
as the script, and tried installing it to the shared path, and also to
the C:matlab path it suggests. The error is this:

"Could not update environment variable PATH. Verify that you have
sufficient priveleges to modify environment variables"

I guess that means I need administrator rights for the PC?

Do I need the MCR installer to allow shared use of the exe file.?
How do I get the MCR installed>?
What do I do once the MCR is installed? Do I need to recompile etc?

Many thanks,

Phil

Subject: Deploying Matlab exe file for shared access

From: Rodney Thomson

Date: 27 Aug, 2008 08:57:02

Message: 2 of 9

Phil Newman <phillenium2002@hotmail.com> wrote in message
<f60a77e8-a452-4d35-b7a8-9739ec8550aa@2g2000hsn.googlegroups.com>...
> Hello,
>
> this isn't a new topic, but it's one I am struggling to
understand. I
> have built a script file which calls a few functions,
reads in data,
> displays some text and produces figures.
>
> I want to share this with a few other people.
>
> The m-file is stored on a shared drive where everyone can
access it.
> The function files are in the same folder.
>
> I have built the compiler using this command:
>
> Mbuild -setup
>
> And chose the compiler (not borland, LCC?)
>
> I then compiled the m file using this command
>
> mcc -m script.m -o script
>
> This comiles fine, and I can run the exe file on my
machine, no
> problem.
>
> I've tried doing it on a colleagues PC who doesn't have matlab
> installed, and it asked for mclmcrrt77.dll file.
>
> I then tried installing the MCR installer, see if this
helps, but it
> won't let me install. I've put the installer file in the
same folder
> as the script, and tried installing it to the shared path,
and also to
> the C:matlab path it suggests. The error is this:
>
> "Could not update environment variable PATH. Verify that
you have
> sufficient priveleges to modify environment variables"
>
> I guess that means I need administrator rights for the PC?
>
> Do I need the MCR installer to allow shared use of the exe
file.?
> How do I get the MCR installed>?
> What do I do once the MCR is installed? Do I need to
recompile etc?
>
> Many thanks,
>
> Phil

You need MATLAB or the MCR installed on the machine.

Yes you need administrator right to install the Matlab
Component Runtime on a computer.

To run the MCR Installer as administrator, you might be able
right click it and select 'Run as...'. Choose "The following
user" and select <COMPUTER-NAME>\Administrator, You'll need
to supply the admin password at this stage.

It should then install fine.

One thing i've noticed is dont run the installer from a
network file share, copy it to a local directory first (it
extracts temporary files and sometimes failes on network dirs).

Once it is installed you will be able to run your compiled
Matlab script. No recompilation is required.

Rod

http://iheartmatlab.blogspot.com

Subject: Deploying Matlab exe file for shared access

From: Phil Newman

Date: 27 Aug, 2008 09:02:36

Message: 3 of 9

On 27 Aug, 09:57, "Rodney Thomson"
<readm...@iheartmatlab.blogspot.com> wrote:
> Phil Newman <phillenium2...@hotmail.com> wrote in message
>
> <f60a77e8-a452-4d35-b7a8-9739ec855...@2g2000hsn.googlegroups.com>...
>
>
>
>
>
> > Hello,
>
> > this isn't a new topic, but it's one I am struggling to
> understand. =A0I
> > have built a script file which calls a few functions,
> reads in data,
> > displays some text and produces figures.
>
> > I want to share this with a few other people.
>
> > The m-file is stored on a shared drive where everyone can
> access it.
> > The function files are in the same folder.
>
> > I have built the compiler using this command:
>
> > Mbuild -setup
>
> > And chose the compiler (not borland, LCC?)
>
> > I then compiled the m file using this command
>
> > mcc -m script.m -o script
>
> > This comiles fine, and I can run the exe file on my
> machine, no
> > problem.
>
> > I've tried doing it on a colleagues PC who doesn't have matlab
> > installed, and it asked for mclmcrrt77.dll file.
>
> > I then tried installing the MCR installer, see if this
> helps, but it
> > won't let me install. =A0I've put the installer file in the
> same folder
> > as the script, and tried installing it to the shared path,
> and also to
> > the C:matlab path it suggests. =A0The error is this:
>
> > "Could not update environment variable PATH. =A0Verify that
> you have
> > sufficient priveleges to modify environment variables"
>
> > I guess that means I need administrator rights for the PC?
>
> > Do I need the MCR installer to allow shared use of the exe
> file.?
> > How do I get the MCR installed>?
> > What do I do once the MCR is installed? =A0Do I need to
> recompile etc?
>
> > Many thanks,
>
> > Phil
>
> You need MATLAB or the MCR installed on the machine.
>
> Yes you need administrator right to install the Matlab
> Component Runtime on a computer.
>
> To run the MCR Installer as administrator, you might be able
> right click it and select 'Run as...'. Choose "The following
> user" and select <COMPUTER-NAME>\Administrator, You'll need
> to supply the admin password at this stage.
>
> It should then install fine.
>
> One thing i've noticed is dont run the installer from a
> network file share, copy it to a local directory first (it
> extracts temporary files and sometimes failes on network dirs).
>
> Once it is installed you will be able to run your compiled
> Matlab script. No recompilation is required.
>
> Rod
>
> http://iheartmatlab.blogspot.com- Hide quoted text -
>
> - Show quoted text -

Thanks, I'll contact my IT department and ask them to install it.

So on installation I don't need to change the path name to the network
directory? I dont' understand then how installing this suddenly makes
matlab exe applications work on a shared drive?

Regards

Phil

Subject: Deploying Matlab exe file for shared access

From: Phil Newman

Date: 27 Aug, 2008 09:08:02

Message: 4 of 9

Oh hang on, I've perhaps misunderstood.

The MCRinstaller needs to be installed on my collegues PC, and not
mine? Or can it be installed to the shared drive which everyone can
access?

Phil

Subject: Deploying Matlab exe file for shared access

From: Rodney Thomson

Date: 27 Aug, 2008 09:12:02

Message: 5 of 9

>
> Thanks, I'll contact my IT department and ask them to
install it.
>
> So on installation I don't need to change the path name to
the network
> directory? I dont' understand then how installing this
suddenly makes
> matlab exe applications work on a shared drive?
>
> Regards
>
> Phil

Ahhh ok.. some extra info there...

For a computer to execute a MATLAB compiled executable, it
needs to have the runtime environment installed on it.
Regardless.

However, you say that your executable (.exe and .ctf files)
are on a shared drive.

In which case they may fail to run because the runtime
environment needs to extract the .ctf out to the encrypted
.m files that form your application. Thus every user needs
to have write access to the share directory.

However, The MCR does not seem to support execution on UNC
(network) paths.

The easy way is to get the user to copy the .exe and .ctf to
their local machine and run it from there (provided the MCR
is installed)

Rod

--
http://iheartmatlab.blogspot.com

Subject: Deploying Matlab exe file for shared access

From: Phil Newman

Date: 27 Aug, 2008 09:21:08

Message: 6 of 9

Thanks,

there's only a few of us, so that might not be a problem.

Is that the exe and the ctf file ONLY - nothing else, save the
MCRinstaller? No copying of c files, or _mcr folder, or function m
files?

And each user just installs the MCR file locally, to any particular
folder?

Many thanks,

Phil

Subject: Deploying Matlab exe file for shared access

From: Rodney Thomson

Date: 27 Aug, 2008 09:43:02

Message: 7 of 9

Phil Newman <phillenium2002@hotmail.com> wrote in message
<4c8c78ea-14e1-4369-af39-dd72d638a7bb@v57g2000hse.googlegroups.com>...
> Thanks,
>
> there's only a few of us, so that might not be a problem.
>
> Is that the exe and the ctf file ONLY - nothing else, save the
> MCRinstaller? No copying of c files, or _mcr folder, or
function m
> files?
>
> And each user just installs the MCR file locally, to any
particular
> folder?
>
> Many thanks,
>
> Phil

I'm not too sure what you mean by 'MCR file'.

The MCR Installer is exactly that, an installer executable
which will install and register DLLs etc. Its normally
located in the "matlabroot\toolbox\compiler\deploy\"
directory under your platform (ie win32).

So yes, they all RUN the MCRInstaller.exe file.. let is
install. Then they can place the .exe and .ctf files
wherever they want (so long as they have write permission there)

Subject: Deploying Matlab exe file for shared access

From: Philip

Date: 27 Aug, 2008 09:54:01

Message: 8 of 9

"Rodney Thomson" <readmore@iheartmatlab.blogspot.com> wrote
in message <g937j6$b4n$1@fred.mathworks.com>...
> Phil Newman <phillenium2002@hotmail.com> wrote in message
> <4c8c78ea-14e1-4369-af39-
dd72d638a7bb@v57g2000hse.googlegroups.com>...
> > Thanks,
> >
> > there's only a few of us, so that might not be a
problem.
> >
> > Is that the exe and the ctf file ONLY - nothing else,
save the
> > MCRinstaller? No copying of c files, or _mcr folder, or
> function m
> > files?
> >
> > And each user just installs the MCR file locally, to any
> particular
> > folder?
> >
> > Many thanks,
> >
> > Phil
>
> I'm not too sure what you mean by 'MCR file'.
>
> The MCR Installer is exactly that, an installer executable
> which will install and register DLLs etc. Its normally
> located in the "matlabroot\toolbox\compiler\deploy\"
> directory under your platform (ie win32).
>
> So yes, they all RUN the MCRInstaller.exe file.. let is
> install. Then they can place the .exe and .ctf files
> wherever they want (so long as they have write permission
there)

Yes, sorry by MCR file I meant the Installer.

OK, great - thanks very much!

Phil

Subject: Deploying Matlab exe file for shared access

From: Scott

Date: 27 Aug, 2008 15:21:01

Message: 9 of 9

Phil Newman <phillenium2002@hotmail.com> wrote in message
<f60a77e8-a452-4d35-b7a8-
9739ec8550aa@2g2000hsn.googlegroups.com>...
> Hello,
>
> this isn't a new topic, but it's one I am struggling to
understand. I
> have built a script file which calls a few functions,
reads in data,
> displays some text and produces figures.
>
> I want to share this with a few other people.
>
> The m-file is stored on a shared drive where everyone can
access it.
> The function files are in the same folder.
>
> I have built the compiler using this command:
>
> Mbuild -setup
>
> And chose the compiler (not borland, LCC?)
>
> I then compiled the m file using this command
>
> mcc -m script.m -o script
>
> This comiles fine, and I can run the exe file on my
machine, no
> problem.
>
> I've tried doing it on a colleagues PC who doesn't have
matlab
> installed, and it asked for mclmcrrt77.dll file.
>
> I then tried installing the MCR installer, see if this
helps, but it
> won't let me install. I've put the installer file in the
same folder
> as the script, and tried installing it to the shared
path, and also to
> the C:matlab path it suggests. The error is this:
>
> "Could not update environment variable PATH. Verify that
you have
> sufficient priveleges to modify environment variables"
>
> I guess that means I need administrator rights for the PC?
>
> Do I need the MCR installer to allow shared use of the
exe file.?
> How do I get the MCR installed>?
> What do I do once the MCR is installed? Do I need to
recompile etc?
>
> Many thanks,
>
> Phil

Upon compilation you end up with a .exe, a .ctf. When you
run the executable on the dev machine it creates an _mcr
file. If you move the .exe, .ctf and _mcr created on your
dev box to your client machines it should work. Sometimes
you have to move the .exe first, then the .ctf and finally
the _mcr so that the timestamps are in correct order.

Scott

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
mcrinstaller Phil Newman 27 Aug, 2008 05:55:07
mbuild Phil Newman 27 Aug, 2008 05:55:07
mcc Phil Newman 27 Aug, 2008 05:55:07
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com