Run an exe in client machine from a website - c#

We have developed an exe and we have created a website to download that exe.
Now is there any possibility to run that exe on a single button click in the client machine. ie if user clicks on a button in the website it has to download and run that exe.
So while clicking the link button, it have to show a "Run" dialogue box instead of the "save" dialogue box.
And upon clicking the "Run" it have to save and run the exe in the client machine.
Can anyone give suggestions for this.

It is not possible to automate that process due to security concerns. The only thing that comes to mind is to write something like:
Download
But that will only prompt the user to either run it or save it. To be honest, you are better off just documenting the procedure for your users/visitors to follow.
Hope it helps!

This is not possible to the best of my knowledge.
However, you can get close with a trusted Silverlight 5 app. If all your users are on the intranet and within a domain, you can push your certificate and register it through group policy.

Sounds like ClickOnce is what you're after?

What you are describing is a function of your browser. The downloading and running of the exe is dependent upon the users browser. More importantly there is a major security problem where the OS may throw prompts about trusting and running an unknown executable.

Related

How Google Chrome Installer works from Internet Explorer without being downloaded first?

If you click on the Download Chrome button in (ONLY seems to work in Internet Explorer) a browser, the installation starts right away and download files itself. I would like to know what technology is behind this? Is it the Omaha installer thing?
In this case, instead of popping the bar (Do you want to Run or Save...) at the bottom, IE displays a rather customized EULA pop up with the "Accept" button. I would love to know how that is achieved.
What I want to do is just to place my own Windows App installer/*.EXE in an intranet site so that any users can just click and have the program started without needing to know how to download first and look for the file to install. As far as security is concern, it's Intranet, so I'm not worried about security.
Thanks

WPF Window is not Opening from IIS [duplicate]

I want to run an exe on client system from my c# asp.net website. When I use Process.Start()
it throws an error:
The requested operation requires elevation.
How do I set permissions to run that exe?
You can't spawn processes on the client machine from server-side code.
When you use Process.Start in server-side code, it is attempting to execute the process there, on the server where the website is hosted. If you wanted to create processes on the clients computer then you would need to expose a download for them (and not in employing subterfuge, like malign sites might do to install software - supply it gracefully, and normally (and with permission)), or a Silverlight application or something along those lines.
The bottom line is that the code you want to execute (even if that is just to spawn a process) must reside on the client, and be executed there.
You can't run an application from a web server like that. You will have to have the user download the application by supplying the EXE, a setup file or using ClickOnce.
Or you can develop an ActiveX control that you can have the browser automatically download from a Trusted Internet Zone.
Once downloaded, proper signing with a certificate (signed from the trusted (corporate) root certificate) will avoid the user getting a prompt to ask whether he wishes to allow the ActiveX control to install/be activated -
The ActiveX control can subsequently do anything the interactively logged on user could. This means that to actually install a program you'd need to elevate (UAC on Vista+); But if the goal was just to run a standalone executable, you should be good to go.
This all assumes white-hat purposes in a (larger) corporate setting, because it relies on PKI infrastructure and central browser policies, to name just two.**
This would, really, lead to some excellent questions on serverfault or superuser
I noticed you said you wanted to run an exe file on the client, but you didn't say explicitly that the exe is on the server and you want to push it to the client. Everyone seems to be assuming that is the case.
You CAN accomplish this fairly easily with a small JavaScript if you have a few prerequisites:
The executable is already present on the client machine.
All of your clients are running IE
You can enforce a policy to put your site in the Intranet or Trusted
Sites zone.
So basically this means it's a corporate intranet application. I am assuming this is probably the case since, well, if you were expecting to do this with a public app, I would be surprised.
For the script to accomplish this, please see my answer to this question:
How can I get a program on a client machine to run from an ASP.NET page?

Code to open my application Login form when I try to open any Web Browser installed on my system

I am trying to open my app's Login Form whenever I try to double click and open any web browsers installed on my system. I have spent around a week without any success. Any help, articles, code or links would be of great help.
Thanks.
I am using Visual Studio 2010
Programming Language : C#
Trying to intercept every browser launch probably requires monitoring the system processes. I.e., your app will constantly be running and whenever a recognized browser process starts, you spawn your login form. There may be system events to hook into (I am not sure), but How can I list all processes running in Windows? might be a good starting point to get an idea what's possible.
A somewhat different approach would be to register your app as the system's default browser. That way, you will be notified, can spawn your LogIn form and can than delegate to an actual browser.
I am not sure what ultimate goal you pursue, and whether either is a good solution depends heavily on whether there are more constraints to it than you mention explicitly.
In order to open a link with your default browser, use the following code.
System.Diagnostics.Process.Start("http://google.com");
You could compile your own Firefox-Version which contains a login form, but you would need a few more steps to prevent a user from launching a start-only browser like the TOR-Browser-Bundle.

Execute Program Without Clicking

Is there a way for a program to be executed without clicking on it? Is it possible for it to be executed the minute you receive the file?
I want to build a c# application that executes any file sent to the machine from another machine connected to it. I want to do this without remote desktop, so I would check a checkbox that says "execute when finished sending" and when it is received, it would execute the program. So I would essentially be able to remote desktop, without actually remote desktoping.
Thanks in advance
Do you realize what you are proposing? If this was possible, every machine out there would be infested with the nastiest viruses.
Why don't you build a server part that you leave running on your remote machine and then have it execute whatever your heart pleases.
There is a program out there (currently in Beta) called SkyNet that does this. You can drag and drop a URL or file onto one of your "Contacts" and (for a URL) it will open an new tab and navigate to that site on your friend's computer. For files, it automatically drops them on that person's desktop.
So it is definitely possible.
Perhaps you want to use secure shell. There are clients and servers for various platforms (you didn't specify) and you can run programs remotely. This is useful for e.g. automated testing.

Use windows and asp concurrently

Can we add a windows form in an asp web page.
Like if someone click on a button on web page(.aspx) user receive a windows form (.cs)
and then again switch to each other.
It cannot be done.
The closest thing to do this would be to use Silverlight embedded in the browser.
No there is not any way to do this. Your only option would be for the user to click a link, download an .exe and then have the user launch the application.
The reason for this is that Windows Forms are designed to run on Windows, and run with a different permission set. As such, a web application first of all could be running on a non-windows platform, and secondly, does not have the ability to actually launch an application on the users machine.
In short, no this cannot be done.
You can't embed a windows form application in a webpage.
RIA (Rich Internet Applications) are what HTML 5 is about, and currently flash and silverlight are the closes things to what you are looking for.
As #Mitchel Sellers mentions, you can always link to an exe, save it and execute the downloaded file, but this is far from seamless.
Even if you did add some windows form UI (for eg a message box) to your asp.net application it will only be fired on your web server.. no client will ever get it on their side
I'm not exactly sure why would you need this? But the closest you can get to this is like "Mikael Svenson" said, Silverlight..

Categories

Resources