I need to create an installer for my application that install my application and if the user's computer doesn't have the pre requisite programs that needs to run my application, it will automatically launch the setup for that. Like, if the user doesn't have the required version of .Net Framework, it will automatically runs the setup for the required version. If the user doesn't have SQL Server Compact, it will run the setup for it. If the user do have the pre requisite setup, it won't execute the setup for the pre requisite programs. I'm trying to use the Microsoft Visual Studio 2015 Installer Project and browsing the Launch Conditions
because I have a intuition this will make it works but I can't find a good tutorial how to make this possible. Thank you in advance!
问题:
回答1:
Like PhilDW says there are many tools with the features you request. Here is a short summary of the pros and cons of a few of them: What installation product to use? InstallShield, WiX, Wise, Advanced Installer, etc. If you want to deal well with pre-requisites you would save a lot of time if you use one of the tools described in the link above. Using the "Microsoft Visual Studio 2015 Installer Project" type will likely fail. It has a very limited feature set.
WiX is free and open source, and contains a bootstrapper feature called "Burn". I have not used it recently, and I am not sure how "involved" it is to use, but here is the documentation for: How To: Install the .NET Framework Using Burn (first read the "Building Installation Package Bundles" instructions in "Step 1").
I have not used it, but several developers recommend the dotnetinstaller bootstrapper. Without knowing much about it, this is probably the easier option. Maybe give it a test spin.
You should be aware that a lot of Microsoft pre-requisites should come down via Windows Update these days, rather than be re-distributed by each setup - particularly the .NET runtime. This runtime adds a lot to the size of your installer (especially if it is small). You could offer it as a separate download on your download page (if you have one), or just tell the user to install it via Windows Update after exiting your setup with a launch condition.
Perhaps also check these answers:
- WiX - Install Prerequisites and 3rd party applications
- How to include prerequisites with msi/Setup.exe in WIX
UPDATE: Here is an answer with links to more samples on how to use Burn: Wix - How to run/install application without UI (towards the bottom - the github link to Fredriksen's project).
回答2:
There are many tools that will do what you want, so you just need to choose one based on all the requirements of your installation and application.
In VS setup projects launch conditions are not what you need - look instead at project properties, choose a build such as Active (Release) then click the Prerequisites button and see if yours are in the list. Different versions of Visual Studio and their installer projects will have different levels of prerequisites.