[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Shell a windows app from web app (using latest versions of .NET?)

Posted on 2007-08-04
10
Medium Priority
?
208 Views
Last Modified: 2013-12-17
Is it possible (or even advisable) to shell a windows app, from a web app page?   Can I do this without using ActiveX controls (that is, is it something as simple as a code permissions issue)?  

I need something that could be deployed in a production environment; a well-thought-out method.

- Using .net framework 2.0 - 3.5 (all are installed in my target environment)
0
Comment
Question by:nespa
  • 5
  • 4
10 Comments
 
LVL 18

Expert Comment

by:Gary Davis
ID: 19631655
If you mean can you click a link on a web page to run a windows app on the client's PC the answer is no. This is a security issue and if it were possible, it would be a nightmare (virus/trojan infections, data theft, etc). ActiveX you mentioned would be one way but user would have to agree to let it be installed and then run it.

If you mean to run an app on the server, it is possible using System.Diagnostics namespace, but I think you are asking about the 1st case.

Gary Davis
0
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 19631895
If you need a web application to trigger execution of operating system executables the safe way is to flag requests in a data source then have a windows service that is polling the data to initiate controlled application processes.  I've written applications exactly like that but it was tightly controlled so that the servers were not at risk.

IIS is specifically designed to protect the hosting operating system and your question is asking how to circumnavigate that protection.
0
 
LVL 1

Author Comment

by:nespa
ID: 19633242
Let me also add -- I have full control of the desktops that are accessing this control (essentially, a link on a webpage), and it's on intranet (yes, very important & should have mentioned this).

So I have "explicit permission" on desktop (that it allows an exe to be run by webapp) and also webapp itself; can install anything I need in the webserver (including any IIS security... for example, if need write access to a dir. on webserver, can do that).

My initial thought was right along the lines of what you both mentioned - circumvents necessary security restrictions & not a good idea.  

However with intranet & ability to install anything I like on webserver/desktops, can this be done in a "safe" manner (at the high level, I let the .net/iis process trust the desktop app)?

Thanks for considering this request & helping me with ideas.
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 1

Author Comment

by:nespa
ID: 19633244
rather... implicit permission.
0
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 19633335
So you want an intranet user to trigger an application on the server?  Well why don't you setup a file share that the intranet users have access to and then expose the file share with a UNC link on the web page.  The file share could be a batch file that triggers the executable to run on the server.
0
 
LVL 1

Author Comment

by:nespa
ID: 19634679
tedbilly - we're close -- is it possible to get the executable to run in the client's process?   so technically we have:

1) User on local PC, connected to intranet
2) Opens intranet page in browser
3) Clicks link on page
4) Link causes (local process) to shell (local executable)

...that's exactly what I'm looking for; to open in client's process/space.  

Maybe I should have asked "can IE open a local app?", with the understanding that we have FULL access to what's installed on each desktop so we can make assumptions such as app location will not change:

C:\Program Files\MyCompany\App1\start.exe

SOLUTION IDEA 1:
And, I may be answering my own question (as to the best way) but possibly install a plug-in in IE (much like other apps which are implicitly trusted like Flash plug-in).   That plug-in could start the app in the above folder, I'm assuming switching the context to the client's process.

Anybody -- am I on the right track with this?  Has anyone gone to great lengths in the past to construct something like that?  

SOLUTION IDEA 2:
maybe there's the possibility of setting code permissions on the EXE on the client, giving the IIS process access to it.

I'm still searching for the best way to do this - I appreciate any help if the ideas above are making sense.   Thanks.
0
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 19634713
Wait a minute, you mean you want the binaries to execute on the users local system?  If yes then all you need is what Microsoft calls a 'Smart Client' http://msdn.microsoft.com/smartclient/community/scfaq/default.aspx

Basically it runs a windows application locally and updates the binaries automatically as you upgrade the application.  The basic idea is that the user clicks a link that downloads a stub EXE that then interacts with the remote server to execute the application including automatic upgrades.

It's not a good choice for the internet but in an intranet it should work fine.
0
 
LVL 1

Author Comment

by:nespa
ID: 19634829
tedbilly - thanks for the help on this:  I know this question is asked OFTEN, and varies by context/ solution.

I did consider smartClient... however it's tricky:  SMS is already used to update apps at this location...so they already have structure in place to support versioning of app, downloading, etc.   they'd like to stick to that structure, and we as a devTeam would like to respect it:  build windows client as per bus. reqs., then allow them to keep updating via SMS as necessary.  

In my experience building a smartClient requires that extra structure you mentioned (stub EXE, keep binaries on server which is actual "meat of the app", etc.) so...i didn't want to build that structure simply because the client /bus. reqs. NOW dictate "hey, we'd like to be able to start the app from within the browser on intranet".

so i was hoping to find something much simpler than creating smartClient structure to support the ONE FUNCTION that they now would like to see:  shelling local app from browser.   :\

final thoughts?   your smartClient is probably the best way to do this (or maybe browser plugin which has permission to shell app)...so i'll award the points after hearing back; just want to make sure i've exhausted the options / tried to figure best solution out.

again, thanks for back & forth on this: it's been driving me crazy that such a simple little request can be so tricky...but it was the decision to go with windows client and i'm trying not to change to web app, just to fulfill this one request.
0
 
LVL 51

Accepted Solution

by:
Ted Bouskill earned 2000 total points
ID: 19635031
Well to be honest this is an intrinsically difficult task to solve and I have first hand experience trying to solve it.

My last employer had the exact same requirements.  However, before I was hired they actually implemented a custom application that was deployed on all clients to do this without a browser.  They used a LanDesk type application to push binaries out to clients as well as a Group Policy in the domain to maintain other settings.

A browser plug-in is another valid choice (that's how Macromedia, Adobe and Microsoft trigger remote installs)

I've prototyped the smart client and it actually works quite well.

Cheers
0
 
LVL 1

Author Comment

by:nespa
ID: 19636235
Good - this resonates w/ what I figured was true; it's not an easy thing to do just yet.

Last, I'm going to look into OneClick deploy as I figure that's the latest SmartClient-based solution in the Microsoft world.

Thanks much for your help!
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question