Is it possible or am I dreaming ?

J

JAM

I was wondering if it is possible to run C# program from memory stick
even if .NET library is not installed on the particular machine. In
other words is it possible to copy whatever DLL is needed onto the
memory stick into the particular program directory and run it that way
from the stick ? I strongly suspect that it is impossible but I
thought I will ask more knowledgeable people here just to be sure.

Before you start laughing, let me explain why I'm asking the question.

I'm a mechanical engineer working for one of the big corporations,
where my workstation has software build by IT department to a
standard, IT designed, build and there is no way that they will
support unique build for anybody period. Unfortunately CAD workstation
does not have .NET installed. Any 'advice' to convince these guys to
install something 'extra' is out of the question. I'm not complaining.
This really makes sense. Why would they risk untested software
combinations on a workstation that costs with all the software
licenses thousands of dollars per year. They have to deal with
hundreds workstations and there is no way for them to easily resolve
issues if each person would demand unique combination of software.

I'm a amateur programmer and I was using my skills to simplify my work
by writing simple programs to do some specialized engineering
calculations that were not build into the CAD or CAE software. One way
of doing so was to use extensively Excel with it's VB programming
language. But Excel is not always the best or easiest tool to use for
particular problem. So other way of doing so was to in the past to
use Delphi and C++Builder to write some small programs that help me
with my work. You can set up compiler in Delphi and in C++ Builder to
build standalone "exe" that does not need any library to run on any
Windows machine. The program compiled this way is usually enormous in
size, but I could care less with today memory stick sizes and hard
drive space. It for sure is not storage efficient but works great. But
over time I switched to C#. For amateur such as me C# with it's
automated memory control it is much easier and simpler to write
software I was talking about. But lack of .NET on workstation forces
me to run it off the laptop. I hate that. I need my programs as a side
calculator to CAD and CAE. Using laptop forces me to keep exchanging
data over the network drive instead of using clipboard.

JAM
 
C

Cor Ligthert[MVP]

JAM,

Are you sure they use a kind of NT version from Microsoft and not by
instance an Apple or Linux OS.

In the way you tells this is sound very much like that.

Cor
 
J

ja_1410

Not just a DLL, but I seem to recall there is a commercial utility that
will link the .exe file with the Framework producing a rather big DLL.

Machines lacking .NET 2.0 are rather uncommon nowadays, though.  You can
target .NET 2.0 from later versions of Visual Studio.

I think, Mark listed two, but their price is very prohibitive for
amateur like me.

JAM
 
J

ja_1410

That's a pity, because .NET is part of Windows Update and is now used by
some Windows-bundled applications (Media Player?).  If you don't have
.NET 2.0 at least, you don't have a complete installation of Windows.

I've checked the directory C:\WINDOWS\Microsoft.NET\Framework and
there was only 1.1 version of the framework. As far as I know, C# 2008
cannot target this old version of the framework. Regarding the
installation of Windows, they've never had latest and greatest. I
guess they follow the policy "if it ain't broke, don't fix it".

JAM
 
J

ja_1410

It's interesting (to me, anyway) that you recognize the motivation behind 
your IT department's hesitance in having .NET as part of the installation 
on their computers, and yet see no problem with effectively running an  
instance of .NET on those exact same computers, that you've brought with  
you on your USB thumb drive (or whatever).

Unfortunately because of the policy I can't run it at all because .NET
happen to be missing from the workstation. But in more general sense
why it should be some moral problem ? The policy is to not allow users
to install software. I' m not attempting to install any software here
onto particular workstation. In fact I can't do that with my
privileges. I'm running an application that I wrote myself from the
memory stick (which by the way on this workstation is read only). How
it is different from running Excel VB program or Windows batch
program ? Policy does not prohibit any of those activities. I would
rather see more of an issue the risk that some workers would be
running commercial software without owning the license. That is
probably much bigger problem for big company because of the potential
liability.
Is it just an issue of "don't ask, don't tell"?  If not, why is the  
untested combination of the software on their computers along with the  
.NET and your custom utility you're running from a thumb drive any less  
problematic than any other untested combination of software they may worry  
about?

It is not the issue of "don't ask, don't tell". They have tested
number of expensive large CAD and CAE software within given Windows
environment and they simply do not change that environment for anybody
without heavily testing for compatibility. Those workstation main
reason of existence is to run big industrial CAD or CAE. The software
packages are married to particular set of hardware and OS environment.
Any changes to hardware or software (including Windows security
updates) are tested for compatibility before being pushed onto the
community. Windows are stripped from most of the components such as
games etc. User has extremely limited access to anything outside his
own Documents folder and network home drive. The only way to run
programs is to either use Office VB (which is installed), write some
Windows script (which runs OK as long as it doesn't try to access
prohibited areas) or use standalone application that does not requires
installation such as GIMP for example.

The logic here is (I guess) that running something from the stick is
completely temporary and does not install anything (in fact I can't
even write to Windows directory anyway) into the operating system
folders. By locking that capability they prevent users from installing
applications that might create compatibility problems for company
major applications. If something goes wrong, the theory is, all you
have to do is to reboot in the worst case. Second reason is of course
support. When the system develops problems then it is easy to rebuild
it to standard image.
I tend to agree with Michael's point that a Windows computer these days  
without .NET installed is really behind the times.  But then, many  
corporate installations are really behind the times.  I suppose that's a  
fact of life.

As I said. I understand why they are reluctant to install every update
at once. Any untested incompatibility would mean several thousands of
engineers to stop working that day till their machines are restored to
the previous, working state. Also they have no incentive to install
anything that is not required by the software package that is run on
this computer. Why would you risk incompatibility ? It is similar to
BIOS upgrade. If your motherboard has no issues whatsoever, the advice
is often to avoid BIOS upgrades. Something might go wrong and one
risks damaging the hardware.
I don't know the specifics, but it's possible you could run a VM from a  
USB thumb drive.  If so, then you could carry a whole second copy of  
Windows, along with the VM software and your own utility, and run your  
utility in a virtualized instance of Windows.  The VM software I've used  
supports copy/paste between host and guest OS.  :)

Hmm. This is interesting idea. Can you run VM if the stick is "read
only" ?
All that said, if you've got tools other than .NET that do work as you'd  
like, I'd say use those.  I always think it's a shame when .NET doesn't 
work for someone, but the fact is...sometimes it doesn't.  Practicalityis  
usually a high priority, and in that case it seems that your  
Delphi/C++Builder approach would be best (I haven't used it myself, but  
I've heard very good things about Delphi).  I'd mention Java, in case your  
IT department allows Java on the computers, but if you're already familiar  
with Delphi or C++Builder, you might as well go with those.

In the meantime, see if you can in fact convince your IT department to at 
least upgrade to .NET 2.0 (which probably has enough features for your  
purposes).  That way, they'll only be five years behind the times instead  
of a decade.  :)

Company I work for employs thousands of engineers. Chances to convince
anybody are slim :). In fact if I mention that I run something all by
myself they might get the idea, that it is risky and prohibit that :)
In this case it is somewhat "don't ask, don;t tell". Corporations are
sometimes conservative and overly cautious.

JAM
 
P

Peter Morris

I don't know the specifics, but it's possible you could run a VM from a
USB thumb drive. If so, then you could carry a whole second copy of
Windows, along with the VM software and your own utility, and run your
utility in a virtualized instance of Windows. The VM software I've used
supports copy/paste between host and guest OS. :)

Hmm. This is interesting idea. Can you run VM if the stick is "read
only" ?
<<

More importantly, can you run a VM without first installing some software to
run it? I don't know, I only use VMWare which does require installation.
 
P

Peter Morris

I think, Mark listed two, but their price is very prohibitive for
amateur like me.
<<

Earlier you said

"I'm a mechanical engineer working for one of the big corporations,"

This sounds like a professional requirement, not a hobby one. If buying one
of these tools isn't worth the money then the need can't be that great. You
could of course ask your company to pay for it.
 
C

Cor Ligthert[MVP]

Jam,

As I see what you wrote, then the first thing those system engenieers should
do in that organisation is to remove all USB ports, Floppy disk stations and
CD/DVD readers and all what looks like this from their workstations.

Now they just swab with an open tap (Dutch proverb)

And as it is like that, you cannot use your USB stick.

Cor

It's interesting (to me, anyway) that you recognize the motivation behind
your IT department's hesitance in having .NET as part of the installation
on their computers, and yet see no problem with effectively running an
instance of .NET on those exact same computers, that you've brought with
you on your USB thumb drive (or whatever).

Unfortunately because of the policy I can't run it at all because .NET
happen to be missing from the workstation. But in more general sense
why it should be some moral problem ? The policy is to not allow users
to install software. I' m not attempting to install any software here
onto particular workstation. In fact I can't do that with my
privileges. I'm running an application that I wrote myself from the
memory stick (which by the way on this workstation is read only). How
it is different from running Excel VB program or Windows batch
program ? Policy does not prohibit any of those activities. I would
rather see more of an issue the risk that some workers would be
running commercial software without owning the license. That is
probably much bigger problem for big company because of the potential
liability.
Is it just an issue of "don't ask, don't tell"? If not, why is the
untested combination of the software on their computers along with the
.NET and your custom utility you're running from a thumb drive any less
problematic than any other untested combination of software they may worry
about?

It is not the issue of "don't ask, don't tell". They have tested
number of expensive large CAD and CAE software within given Windows
environment and they simply do not change that environment for anybody
without heavily testing for compatibility. Those workstation main
reason of existence is to run big industrial CAD or CAE. The software
packages are married to particular set of hardware and OS environment.
Any changes to hardware or software (including Windows security
updates) are tested for compatibility before being pushed onto the
community. Windows are stripped from most of the components such as
games etc. User has extremely limited access to anything outside his
own Documents folder and network home drive. The only way to run
programs is to either use Office VB (which is installed), write some
Windows script (which runs OK as long as it doesn't try to access
prohibited areas) or use standalone application that does not requires
installation such as GIMP for example.

The logic here is (I guess) that running something from the stick is
completely temporary and does not install anything (in fact I can't
even write to Windows directory anyway) into the operating system
folders. By locking that capability they prevent users from installing
applications that might create compatibility problems for company
major applications. If something goes wrong, the theory is, all you
have to do is to reboot in the worst case. Second reason is of course
support. When the system develops problems then it is easy to rebuild
it to standard image.
I tend to agree with Michael's point that a Windows computer these days
without .NET installed is really behind the times. But then, many
corporate installations are really behind the times. I suppose that's a
fact of life.

As I said. I understand why they are reluctant to install every update
at once. Any untested incompatibility would mean several thousands of
engineers to stop working that day till their machines are restored to
the previous, working state. Also they have no incentive to install
anything that is not required by the software package that is run on
this computer. Why would you risk incompatibility ? It is similar to
BIOS upgrade. If your motherboard has no issues whatsoever, the advice
is often to avoid BIOS upgrades. Something might go wrong and one
risks damaging the hardware.
I don't know the specifics, but it's possible you could run a VM from a
USB thumb drive. If so, then you could carry a whole second copy of
Windows, along with the VM software and your own utility, and run your
utility in a virtualized instance of Windows. The VM software I've used
supports copy/paste between host and guest OS. :)

Hmm. This is interesting idea. Can you run VM if the stick is "read
only" ?
All that said, if you've got tools other than .NET that do work as you'd
like, I'd say use those. I always think it's a shame when .NET doesn't
work for someone, but the fact is...sometimes it doesn't. Practicality is
usually a high priority, and in that case it seems that your
Delphi/C++Builder approach would be best (I haven't used it myself, but
I've heard very good things about Delphi). I'd mention Java, in case your
IT department allows Java on the computers, but if you're already familiar
with Delphi or C++Builder, you might as well go with those.

In the meantime, see if you can in fact convince your IT department to at
least upgrade to .NET 2.0 (which probably has enough features for your
purposes). That way, they'll only be five years behind the times instead
of a decade. :)

Company I work for employs thousands of engineers. Chances to convince
anybody are slim :). In fact if I mention that I run something all by
myself they might get the idea, that it is risky and prohibit that :)
In this case it is somewhat "don't ask, don;t tell". Corporations are
sometimes conservative and overly cautious.

JAM
 
J

ja_1410

I think, Mark listed two, but their price is very prohibitive for
amateur like me.
This sounds like a professional requirement, not a hobby one.  If buying one
of these tools isn't worth the money then the need can't be that great.  You
could of course ask your company to pay for it.

Not in current economy climate :) But probably it would be easier to
convince them to install .NET for everybody instead of buying this
tool for a single person. I do my programms purely as a hobby in my
free time. During the work day I'm not expected to program.
 
J

ja_1410


Well, thank God we do have USB ports although locked for writing.
There is also a CD drive belive it or not. So I can bring a software
and run it as long as it doesn't require installation. In theory I
could probably get into BIOS and boot from CD but that would be
pushing the leaglity of using companys hardware too far. They have
this general legal statement about abuse of trust :) I'm not going to
install software against clearly stated company policy that prohibits
installtion of software. Strangely the statement does not prohibits
running unapproved software. It just prohibits installation. If I
would try to second guess the corporate intentions they probably did
not wanted people to even run unaproved applications but the lawyers
probably did not thought that it is possible to run some applications
without actually installing them. So in a letter of the law I'm OK.
As I see what you wrote, then the first thing those system engenieers should
do in that organisation is to remove all USB ports, Floppy disk stations and
CD/DVD readers and all what looks like this from their workstations.

Now they just swab with an open tap (Dutch proverb)

And as it is like that, you cannot use your USB stick.

Cor

JAM
 
A

Arne Vajhøj

JAM said:
I was wondering if it is possible to run C# program from memory stick
even if .NET library is not installed on the particular machine. In
other words is it possible to copy whatever DLL is needed onto the
memory stick into the particular program directory and run it that way
from the stick ? I strongly suspect that it is impossible but I
thought I will ask more knowledgeable people here just to be sure.

You could try installing the Windows version of Mono and
copy the directory to the mem stick.

If your .NET app runs with Mono, then you may be able to
run it that way. I have not tried it, but it seems as
if Mono is not digged deep into the OS.

There are a couple of if's, but it could be worth
spending a couple of hours investigating.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top