Packaging a .NET Application So It Will Run On A Computer Without .NET

后端 未结 3 765
一生所求
一生所求 2020-12-17 00:19

I have been recently trying to deploy a C# application on a computer that does not have .NET installed.

I know that there have been many questions around th

相关标签:
3条回答
  • 2020-12-17 00:27

    For .NET, you really must just install the appropriate .NET framework. The .NET framework installation does include command line options to allow for silent installs, such as:

    dotnetfx35.exe /q /norestart
    

    For details on the command line options, see the options for 3.5 and for .NET 4.0.

    That being said, most installation packages will handle these details for you as part of the installation. Using a decent installer will take care of this dependency automatically.

    0 讨论(0)
  • 2020-12-17 00:34

    Depending on the pieces of the .NET Framework you need, you can use Mono. It supports shipping the runtime without installing just like you would a JVM, or you can statically link against the binaries to create a native executable .

    0 讨论(0)
  • 2020-12-17 00:46

    If you are planning to deploy your application (and presuming the setup process doesn't need to be too complex), you can simply create a Setup project in Visual Studio and then bootstrap the prerequisites (.NET framework, and other stuff you think you might need).

    You can follow the steps described in these MSDN articles:

    • How to create a Setup project in Visual Studio
    • How to add prerequisites to a Setup project

    A walkthrough is given in this CodeProject article.

    For more complex deployment scenarios (such as installing device drivers along your app, or better localization support), I would recommend looking into WiX (Windows Installer XML) toolset. It's a toolset that builds Windows installation packages, which you configure using XML files inside Visual Studio. WiX also supports various bootstrapping scenarios.

    This page covers the differences between VS Setup projects, WiX, and InstallShield.

    0 讨论(0)
提交回复
热议问题