简体   繁体   中英

How can I package the .NET framework with an executable without using an installer?

I have an executable that displays a simple windows form. Unfortunately this application will not run if the user does not have the .NET framework installed.

I would like to be able to detect if the user's machine has the .NET Framework installed, and if not, give them the option to download and install it.

I know that this is possible through the use of an installer project; however, I am not actually installing anything, therefore an installer is not a viable option.

Is there any way to do this?

I would greatly appreciate any ideas or suggestions.

Thank you,

Mattimus

您可以使用Xenocode之类的工具将.net的剥离版本嵌入可执行文件中: http ://www.xenocode.com

The simplist way to detect if a computer has the .NET framework installed is to create an unmanaged C++ application in Visual Studio. All the application will need to do is check the %SystemRoot%\\Microsoft.Net\\Framework directory. There should be subdirectories in here such as "v2.0.50727" (for the .NET 2.0 framework) and "v3.0" (for the .NET 3.0 framework). Check that these directories exist. If they do, then the framework is installed.

You need to create a 'bootstrapper' application in something other than .net. It checks for .net, and if found starts your app, otherwise offers to do the install. Make your 'desktop shortcut' or whatever point to that app instead.

For the install I will suggest SmallestDotNet though I have never used it myself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM