开发者

Auto Run CD With Application written using .net platform

开发者 https://www.devze.com 2023-02-15 00:24 出处:网络
We are building an application on .net, And it is an Image Viewer application uses .net 3.5开发者_StackOverflow社区.

We are building an application on .net, And it is an Image Viewer application uses .net 3.5开发者_StackOverflow社区. And this application will be on a CD along with other images.

My Question is, is it possible to Auto Run this application when you insert a CD on a machine which DOESN'T Contain .NET Frame Work.

Or any other ways of building the application which runs from the CD.


Autorun is a feature of Windows. It does not have anything to do with .NET really. You can use it by placing apropriate files in the root of your CD.

See: http://en.wikipedia.org/wiki/AutoRun

In order to execute a .NET app WITHOUT .NET framework installed, point the Autorun.inf to an installer of you application, which would be deployed on the CD as well.


The application will fail to run directly when it cannot find the libraries it need.

What you can do is to create a non-.NET dependent bootstrapper, include the framework installer.

So when the CD auto run, run the bootstrapper, the bootstrapper will run the installer. Once installed, run the application.


No, you can't run .NET applications on a computer without the .NET Framework installed. That's a hard rule, and a pretty intuitive one, it seems to me. Somehow, this question still gets asked a lot.

But Auto Run has nothing to do with the .NET Framework. It's a feature provided by the Windows operating system designed to run your setup/installation program directly from the inserted installation medium without requiring any kind of user interaction.

So what you should be doing is creating a setup program for your .NET application. You can do this from within Visual Studio: just create a Setup Project instead of a Windows Forms Application. The setup program will take care of detecting whether or not the computer has the appropriate version of the .NET Framework installed, and installing it if necessary along with the application. The setup bootstrapper will be able to run without the .NET Framework installed, so you can create an autorun.inf file that simply specifies setup.exe as the application to be launched automatically.


I've used mono to do this a few times, not with the static linking as mentioned in the other answer, but by including the mono distribution on the cd (or a subset of it). Mono doesn't seem to do much in the way of modifying registry, system32, etc. So you can do an xcopy deployment of if, or CD deployment in this case. You'll end up running mono.exe


I think Mono supports some form of static linking that doesn't require installation. But I never tried it myself.

0

精彩评论

暂无评论...
验证码 换一张
取 消