Deploy a desktop application from a web site - asp.net

I have a requirement to install a desktop application written in visual c++ when our customers log in our asp.net web site. The desktop app will be installed once, but will be updated as a newer version is available. What is the best way to do this?
My second question is that is there a way for my asp.net web app to interact with a window service installed on customer computer and direct the window service to control USB devices.

My work uses software by a company called Citrix. There is some client side software that goes on the client's PC. When setup correctly, we can click a link on our sharepoint site that will trigger the citrix client software to launch a WPF desktop application from a network drive that will run locally on the clients computer (might be in a virtualized space that Citrix creates). This seems to work well, it runs our WPF applications that use windows authentication. This is all I know about it. You can research more if you're interested.
To answer that second question... Your window service would need to expose some kind of service for the client (asp.net web app) to communicate to it with. So ideally I think setting up the windows service to host a WCF service inside it and use something like named pipes or HTTP protocol to communicate with your application. I don't know what kind of USB devices you are trying to control though, that will take research on your part. But if you can control them with a local console application, you should be able to do the same with a windows service.
Good luck. Hope this was helpful.

You can't install an app from a web site, best you can do is prompt the user to download the installer. And asp.net (or any website in general) can't interact with the window service on the client. Imagine going to a website which changes your service settings, installs viruses, etc. A website is pretty much limited to changing cookies and local storage on the client, anything else on the client is inaccessable.

Related

IIS open file on Active User's Desktop

Here is situation:
I have a large collection of videos on a computer, and it will be hooked up to my TV. I would like to make an app to open my videos on my computer from my mobile device (Yes, I know it exists, I am just working on it for fun)
So I have setup a web service, and an app to consume said webservice. The webservice gathers a list of folders/files, and sends them to my device as well as can take in a file path and open it with the default program using System.Diagnostics.Process.Start(path)
When I am using IISExpress, it works fine, but I would like to use IIS. When I use IIS, I open the video file and hear it playing in the background, but it doesn't show up on the monitor. VLC appears in the task manager, and when I kill it, the sound stops.
I'm assuming the issue is the identity under which the app pool is being run, but when I tried to change the identity, it didn't make any difference. If it helps, I am running Windows 8. Does anybody have any thoughts on how I can make the app pool run under my identity, or open the process on the desktop of the active user, rather than open it under the app pool's name?
This is something rather difficult to implement due to Windows session isolation. IIS as well as its worker processes are in session 0, while your logon session is usually > 0. Via native Win32 API it is possible for something in session 0 to launch executable in other sessions, but I don't think it is worth the while.
Please use IIS Express, as it runs in your logon session directly, and don't need to cross the session boundary at all.
With regards to the Process.Start() problem I think in addition to changing the identity of the application pool you also need to go to Services under Administrative Tools and check the box "Allow the service to interact with desktop" under the Log On tab for the World Wide Web Publishing service. I think this has already been addressed in the following question: System.Diagnostics.Process.Start not work from an IIS
Now, if I had to put an app like this together I would try I slightly different approach: in addition to what you have already, I would build a small desktop app that autostarts and sits in the system tray when you log onto your desktop. It will listen for messages from the asp.net application on named pipes or tcp or something similar and start the processes from within the correct user context. That seems a more stable approach, which will also allow you to separate the web server from the desktop where the videos will be played.

Want to run my own server instance with special port for an ASP.Net 4 based solution

I have made an application in asp.net which sends and receive sms, it works very similar to desktop application and it will be installed on servers to send sms alerts, but the problem is if server does not have iis, it will not work. I have seen many apps which when installed, have their own server and port, you do not need to install any IIS, when you just double click it starts running on a special port and works well, similarly visual studio also runs its own port in development mod, so what is the best way to make such solution for an asp.net product.
If you're talking about how to host a service in an application outside IIS, Windows Communication Foundation (WCF), which allows you to host a service in a Windows Forms executable, Console Application, Windows service, or IIS.
It's too big a subject to explain fully here, but there's a nice starting point here.
This will allow you to create the host, and allow you to hose services similar to web services, but with more options for how to connect. (http, tcp, etc.)
But it's not an ASP.NET host. For that, you will need a web server that can execute ASP.NET, such as IIS. There's no way to get around the need to have a web server, whether it's one of the many already established, or if you write your own. I believe there are extensions for Apache that allow you to do so via Mono, but I've never used them. Writing your own would be, in my opinion, a waste of time and a bad idea.
The simplest solution by far is to specify that IIS instaled with the appropriate framework is a requirement for using your website.
Edit
However, if you REALY want to write a WinForms app and have it host ASP.NET, it looks like this previous question has an answer that would help. You can use the Cassini web server, the same one that Visual Studio uses.

ASP.NET app running from CD

I've developed a very simple ASP.NET (jQuery) application.
The RDBMS is MS Sql Server but I could easily convert it in MS Access.
My client would like to have it available on a CD, ready to run.
I was thinking to convert it in a WinForm app but, still, I have to install the framework on the client.
Is there any other "possible" solution?
You're going to have more trouble trying to run a web app on a client machine than you will a desktop application.
A web app requires some sort of web server running, but a desktop app just needs the framework.
You're going to be better off converting it to a desktop app.
If your users are running versions of XP, Vista, or Windows 7 that include IIS, you could conceivably install the application into a virtual directory. That's a lot to ask from end-users, though. Most users won't have IIS installed even if they are running a version of Windows that offers it.
I haven't tried this, but I just found it by searching for "portable asp.net web server"
http://www.codeproject.com/KB/aspnet/TinyWebServer.aspx
Introduction
Have you ever wanted to show up an
ASP.NET project where IIS was not
accessible? Have you ever thought of
if there can be a way to carry your
web server wherever you go, i.e., on a
USB flash stick or even a CD?
If so, then this cool TinyWebServer is
for you! This tiny portable web server
can be used for testing and developing
ASP.NET projects, wherever IIS is not
available.
Should be simple if you convert it to HTML & jquery script. As HTML doesn't require any seperate runtime & also worth considering asp.net runtime also does the same thing when the response is sent to the client.
You maybe able to do this by using something like cassini http://www.asp.net/downloads/archived/cassini/. This is a simplified version of the visual studio web server that you see when you run from visual studio.
In my team we have used this and wrapped it in a exe that allows us to start the cassini server and start a browser to the cassini server address.
This still relies on the right version of .NET Framework being installed.
EDIT: Some more recent links http://ultidev.com/Products/Cassini/ and
http://blogs.msdn.com/dmitryr/archive/2008/10/03/cassini-for-framework-3-5.aspx

how to connect to a web service from windows mobile(when running emulator)

I have as asp.net webserver that I hosted and I went to my mobile application I am building and made a web reference to it.
So it finds it and stuff and now I can access the web methods because of the wsdl generated. However when it tries to connect I get this:
Could not establish connection to network.
So do I have to enable something to make this work?
Take a look at this article. It explains how to setup your mobile device for internet connectivity.
Windows Mobile Emulator and Internet Connectivity
It's been awhile since i have had to do this. Perhaps it is as easy as Matt has suggested, I can remember having a hard time making this work with Windows Vista, Visual Studio 2005 and the Windows Mobile 5.0 Pocket PC Emulator. I've found a couple more articles, hope this helps.
HOWTO: Configure Network in Windows Mobile / PocketPC Device Emulator
Making Emulator to connect to the Network
I have used web services and rest based services via webrequests on the emulator without needing to configure the NE2000 adapters.
Change activesync or WMDC to connect using DMA (in wmdc: mobile device settings | connection settings, then set 'allow connections to one of the following' to DMA)
Then in VS2008, under tools select device emulator manager, and pick the emulator that is running, right click on it and select cradle, this should connect activesync/wmdc to the emulator and provide a network connection that is sufficient to communicate over http with web services.

Running asp.net app on localhost

This might be a 'duh' question after all.
Are there any caveats running an asp.net (3.5) application on a local host? Assuming I have all the required services installed, I am looking for pitfalls/ troubles in terms of
database access
reporting/ charting and other such features
performance
The main reason for this is that the app I am developing will be eventually hosted on a proper web server but till then I want to be able to use my app from a browser (for test, demos...).
[Note: till the time the app is hosted on a web server, only I will be using the app]
As long as you install all the same components (and the same versions of them to be 100% sure) on your computer as you have available on the server, there shouldn't be any difference at all in functionality. One thing to watch out for is that the app will certainly be less responsive when someone accesses it over the internet, compared to the client and server being the same machine.
You won't have any problems at all, this is how many people indeed test. When you are ready to move it online, just make sure the host supports everything you need.

Resources