开发者

.NET - Verify and Install .NET Framework 3.5 before running application

PLEASE READ THE FULL QUESTION BEFORE POST YOUR ANSWER

Hello guys! I'm currently developing a "Extremelly customized Installer Application" in C# for installing a old classic ASP application开发者_C百科. It'll be used during the 2.0 version is developed (ASP.NET MVC with C#).

As its so different from the efault install packages, I've made it as normal windows application, not as setup application (a setup application don't let us customize so much as I need).

And here is the problem: As its a windows application, I must "Release" it and send the compiled .EXE with the .DLLs, I must not "Publish" because if i do so, the published .EXE will "install the installer" and not my application. I need a way to verify and install the .NET Framework 3.5 like a bootstrap package prerequisite used in publishing option, but remember that I'm not publishing, I'm doing a "Release" build.

Thanks for any help!


Maybe it will help if you stop thinking about it being an installer but consider it a configuration utility. That needs an installer before it can run. Just create a regular Setup project for it, one that automatically launches the utility after it is installed. Check this thread for an example on how to do that.


I know this is probably not what you are asking for, however, have you considered using the WiX toolkit.

The Windows Installer XML (WiX) is a toolset that builds Windows installation packages from XML source code. The toolset supports a command line environment that developers may integrate into their build processes to build MSI and MSM setup packages.

The WiX toolkit builds Windows Installer (MSIs) which are geared for installing software, there is very little you can not do with custom actions and there are simple ways of doing custom tasks such as installing prerequisites. By the sounds of it the one you are looking for is "How To: Install the .NET Framework Using a Bootstrapper".

I would highly advise using Windows Installer over a custom setup application (EXE), as there are environments that you will not be able to test for, and may not have even considered.

Windows Installer has been extensively tested over the years it has been used, for me personally as a Systems Administrator seeing a MSI download boosts my confidence in the application; in my experience Windows Installer packages are less troublesome than custom install solutions.


Nullsoft Scriptable Install System is a very popular alternative

sample code to get .Net framework version

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜