简体   繁体   中英

Creating a “sure to run” app / installer in VS2010

I need to create a simple installer of sorts for a different application. That other application already has it's own simplistic installer, and I don't want to meddle with it.

The reason for my own installer is to allow the user to install SQL Express if (s)he so chooses, and also to pre-install any other basic requirements for such a procedure.

At the moment, here's where I'm at:
I've created a single Windows form application, with big buttons (this is for a user which likely won't be very good with computers) to install SQL Server Express (using silent install with a predefined set of arguments) or the actual application, along with some helpful text to let the user know what's going on. Something along the lines of Visual Studio autorun window.
I've also added the standard set of pre-requirements to the application (.NET, Windows Installer).

Everything works OK if I run the app by using the executable. HOWEVER, if I publish it to create a ClickOnce application (so the pre-requisites are installed when needed) and run it, it stops running other installers.

EDIT: Apparently the problem with not being able to run other application from a ClickOnce application is only on my end, and probably deserves a new question, not necessarily here on StackOverflow (perhaps on MSDN forums?).

In your program before launching the installer you can check if .NET is installed. Its pretty easy to check if a particular s/w or a version of s/w is installed. Write a program that will check HKEY/LocalMachine/Microsoft/Windows/CurrentVersion/Uninstall and in that there will be list of programs that have been installed on that machine. If you find then go ahead with your install else suggest user that he needs to install pre req.

When you create a setup project you can right click on the setup project, go to properties, and click on pre requisites. In that you can mention which version of .NET framework is needed and then give the location of the framework. In this link look for Huggy Bears response eggheadcafe.com/community/aspnet/2/10131905/setup-project.aspx

I've settled for a "Click Once" application. It can install all required .NET components needed for it to run, thus becoming an "sure-to-run-non-native-C++-code-splash-screen".

Granted, there ARE issues with Click Once, but this is far better than nothing. It's also better than running C++ or unmanaged code applications. ;)

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