0Day Forums
Auto Run CD With Application written using .net platform - Printable Version

+- 0Day Forums (https://0day.red)
+-- Forum: Coding (https://0day.red/Forum-Coding)
+--- Forum: FrameWork (https://0day.red/Forum-FrameWork)
+--- Thread: Auto Run CD With Application written using .net platform (/Thread-Auto-Run-CD-With-Application-written-using-net-platform)



Auto Run CD With Application written using .net platform - tammapjq - 07-20-2023

We are building an application on .net, And it is an Image Viewer application uses .net 3.5.
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.


RE: Auto Run CD With Application written using .net platform - therinevfogdhrbj - 07-20-2023

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.


RE: Auto Run CD With Application written using .net platform - lutenist788 - 07-20-2023

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:

[To see links please register here]


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.


RE: Auto Run CD With Application written using .net platform - crackpot964187 - 07-20-2023

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.


RE: Auto Run CD With Application written using .net platform - monteenezykvify - 07-20-2023

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


RE: Auto Run CD With Application written using .net platform - purulence470 - 07-20-2023

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 <pathtoexe.exe>