windows app

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Objective: create a simple windows application .exe file that I can load up
on our secure web site, direct a user to the url, and have them download the
..exe and it runs beautifully on their desktop without an install program.
It would be distributed to only a handful of users that have access to our
secure site. The application does some simple data reads and writes. The
program complies to a single .EXE and does not create any additional .dll
files.

What I tried: Created a simple windows application. Compiled and tested
it. It works. Threw the .EXE on our web server, and then directed my
browser to the .exe at http://mysite.com/myapp.exe.

The program appears to download and display. I press the button on the form
that loads the data ... it bombs. The error message is at the bottom of this
email. What is the "better" way to do what I'm trying to do assuming it
just needs to work and won't be a polished application???

Thanks in advance!

Mark

ERROR MESSAGE:
Request for the permission of type
System.Data.SqlClient.SqlClientPermission, System.Data,
Version=1.0.5000.0,Culture=neutral, PublicKeyToken=blahblahblah failed.
 
Executables run from IE will run within IE's security "sandbox" by default.
This precludes file I/O and database access.

As far as I know, you either have to create a web service to provide data
access, or you will have to create an install that will adjust permissions
on the client to allow DB connections. Obviously the latter would only make
sense within an intranet anyway, and it defeats your goal of very simple
deployment.

I haven't personally tried this type of deployment and so am not familiar
with the specific steps involved, although they probably wouldn't be hard to
track down in help or via Google.

--Bob
 
Thanks Bob,

Would it work if I zipped it first so that they have to download the single
file ... and then they would unzip and double click on the .exe? Aside from
the framework, they could put the .EXE anywhere on their computer then.
Right? Or am I missing some important piece?

The web service actually sounds like an interesting alternative ...

Finally - are the days of ActiveX controls or similar, long gone? Or can I
design something similar in .NET? Again, I'm shooting for the functionality
of a windows gui attached to a SQL Server database, but I wouldn't need it
to be installed on the client pc.

Thanks again.

Mark
 
<inline>
Mark said:
Thanks Bob,

Would it work if I zipped it first so that they have to download the single
file ... and then they would unzip and double click on the .exe? Aside from
the framework, they could put the .EXE anywhere on their computer then.
Right? Or am I missing some important piece?

Yes, this would eliminate your security issue and yes, they could place the
exe anywhere they wanted on their system.
The web service actually sounds like an interesting alternative ...

It's definitely an alternative to explore. Without such a "middle-man" as a
web-service, you would be required to expose your SQL Server to connections
from the public Internet (unless your users are connecting over a VPN of
some kind). Exposing SQL Server in this way is a very bad idea.
Finally - are the days of ActiveX controls or similar, long gone? Or can I
design something similar in .NET? Again, I'm shooting for the functionality
of a windows gui attached to a SQL Server database, but I wouldn't need it
to be installed on the client pc.

Not exactly. It's still possible to write a control which runs within IE.
However, you'll still have security issues similar to your original problem
(I believe - double check on that) and it's not the most straight-forward
approach available.

Good luck,
Ryan LaNeve
MCSD.NET
 
Mark said:
Objective: create a simple windows application .exe file that I can load up
on our secure web site, direct a user to the url, and have them download the
.exe and it runs beautifully on their desktop without an install program.
It would be distributed to only a handful of users that have access to our
secure site. The application does some simple data reads and writes. The
program complies to a single .EXE and does not create any additional .dll
files.

Is it possible to avoid file IO operations on client's box? What do you
read/write? Client data? Or do you need a temporary storage?
If so, your users/admin will have to change their security settings so
that they allow software signed with your key to make read/write operations.
You need read something about .net security model. It is like to Java
applet that is guaranied to execute only "safe" functions. And this a
step in right direction considering how many naive people run viruses
from Inet on their computers :)

Vadim Chekan.

P.S.
Woops! I noted right now, that your app requests access to SQL server!
Is this your sql server?
And... how are you going to make authorization? Clear password in
connect string? :))))
It sems you have architectural problem. Give more details.
 
Back
Top