Hi
I'm looking to deploy my first .Net 4.0 app.
I know VS comes with an installer project and a free version of InstallShield, however the free version of install shield doesn't do what I need, or so I think, and the MS installer is end of life so don't want to learn it!
What is everyone using? I have in the past used NSIS but it doesn't build MSI's and it was a problem to some people who wanted it as an MSI.
Here is what I need to do during installation, in addition to the normal stuff:
manipulate an XML file on the target machine.
Call a COM object
Any recommendations (i don't have 150+ to spend on an installer)?
WiX is free (as in speech and as in beer), but you're going to hate the learning curve.
You can definitely modify XML files, though.
I have had great success with this tool. It has a free version that has many capabilities out of the box. I think it will do the job for you.
http://www.advancedinstaller.com/
Here is the feature matrix, to tell you what you don't get with the free version:
Feature Matrix
You may or may not have found this already, but it is possible to execute Custom Actions in the InstallShield Limited Edition version bundled with VS2010, using a deployed EXE, VBScript or JavaScript.
The number of points at which you can execute the custom action are greatly reduced in the free version, but should enable you to write the appropriate code to modify the XML file and call the COM object as you require.
Custom actions item can be found in Solution Explorer tree for the InstallShield project, under (5) Define Setup Requirements and Actions.
InstallShield 2010LE can consume merge modules which means you can combine it with WiX to inject things into it that it wasn't intended to do. Also it compliments WiX nicely in that it has the bootstrapper that WiX does not.
If your installer is really simple I'd be willing to set it up for you intially for the cost of a nice lunch.
Related
I want to build a setup file that contain windows form application that is connected to sql server how can I do that? I want to put the .net framework and sql server in the setup package how can I do that? do I need sql server or sql express in this case? I want to create the database in the installation process how can I do this? I want to check If the requirements are already installed how can I do this? hw can I improve the security of the program from stealing?? please help thanks
note my English language not good enough Smile | :)
That is a lot more than one question, and not easy to answer all at once. Anyway, assuming you're using Visual Studio 2012, you can try creating a new Install Shield project (below).
(It might be easier to help you once you've tried something, and have got a more specific question/problem)
For my projects I use Inno Setup. It lets you customize all aspects of the installer - add/remove different screens, set conditions for installing different files, for example you can check out whether SQL server is installed and install it only if it is not through scripting. Take a look at the FAQ page for more information about the features this tool offers.
There's also a sample Inno Setup file at CodePlex, that should get the job done. I haven't tried it though, so I cannot guarantee whether it works fine or not.
If you want to have installer for tomorrow, than good choice will be WIX (http://wix.sourceforge.net/). It is easy to understand and have a possibility of checking installed frameworks and OS version.
If you wish to have Framework msi installer inside yours, than you can check Wix Bootsrapper. But as far as I know it has poor flexibility to setup install steps. For this propose you can combine Wix with other for example NSIS. You can create application installer by using Wix and Bootsrapper application, which will contains your application MSI and Framework MSI, by using NSIS.
To create database during installation you also can use WIX. You need to create database generation plan, which will contain queries for creating database. This generation plan can be executed as part of the installation process (http://wix.tramontana.co.hu/tutorial/sql/creating-a-database). It is good choice wile you don't need additional information from user. In other case you will need to create custom UI.
From my experience with built in Visual Studio install tools, they're all horrible.
I highly recommend Advanced Installer. It's a very powerful tool to create installers and patches for your software. It should have all the features you need in the free version, including checking for prerequisites such as .NET Framework on the user's machine, and installing things when needed.
In my team we create assemblies to attach to extensible released software created and published elsewhere in my company. These assemblies are often specific for an individual client, though some are reused. I want to introduce a couple of standards into this environment - version numbers and installers.
Currently, many assemblies go to clients without adequate versioning. I want to institute automated version number updates so when a client has a problem we can be sure which source code was used in their software.
Currently, assemblies are installed by the individual copying them manually to the correct path and performing any necessary registration. I want to force people to use an installer package so the path and registration is handled automatically.
I could implement the first step by getting people to use:
[assembly: AssemblyVersion("1.0.*")]
But I'd prefer to update the AssemblyFileVersion rather than the AssemblyVersion. This is because I understand that advancing AssemblyVersion combined with our manual installation can lead to multiple versions of an assembly being registered. AssemblyFileVersion doesn't update automatically, and I'm wary of a solution that requires developers install 3rd party tools. If we had a proper installation process, the problem would multiple versions would go away.
For the second step, if I use a Visual Studio setup project then adding the assembly causes it to try to add other assemblies from the original published software, which I don't want. I assume I can create this as a patch somehow, but I've not worked that out yet. Of course, an installer will require reliable version numbers or things will go badly.
It seems clear having written this that I need to advance both issues simultaneously, but I'd really rather approach one at a time.
Any thoughts for the best way to get over these two issues?
I don't have nearly enough information to point you to a solution. What are you using to build your application and installers? Desktop F5 build? Team Foundation Server? Cruise Control?
Things to realize:
1) Visual Studio Deployment Projects suck. Yes, I'll stick by that comment. In your case, the dependency scanning problem you have is unfixable. Even if you right click | exclude the dependency it could scan a new dependency at build time. We even wrote visual studio automation to open the project, right click | exclude everything and then save it on the build machine to avoid this problem. Trust me, it's a horrible road to go down. Even Microsoft knows it sucks and that's why it won't be in the next release of Visual Studio anyways. Use other tools such as Windows Installer XML or InstallShield Limited Edition or Professional.
2) You must update AssemblyFileVersion. This is such a core/foundational tenant of Change Management and it's critical in getting Windows Installer upgrades and patches to work. AssemblyVersion can be changed at your discretion and is only applicable to Strong Naming and IoC scenarios such as Prism where you write rules on what constitutes a valid class for injection.
3) 1.0.* isn't what you want. You want a system that increments your version and passes it into your build automation. What you use will depend on what you are using for build automation. I use Team Foundation Server and a project in CodePlex to do my versioining.
4) You should never be building on a developers machine. You should always be using a clean build machine with automated scripts and not F5.
If these are released applications, then the installer method is fine. If you are adding libraries through this method, and not necessarily the actual application, then something like NuGet (package manager) is an option. NuGet itself is a bit infant and needs to grow up a bit, but I think it should fit your basic scenario.
If you have published software, a bootstrap on the client that calls for updates and then runs the update installer is a good pattern.
The basic answer is you have options, depending what bits you are employing and should take advantage of the one(s) that fit your needs.
I've already looked at C#: Making an Installer that installs both a WPF application (ClickOnce) and a Windows Service but that never answered my question. I have a similar set up: a WPF application and a Windows Service. I'd like one installer that installs the Windows Service first, then installs the WPF application. Also, it has to be able to open firewall exceptions as well.
Anybody have any experience with any products that can do this? I've got the feeling that InstallShield Premier can do this but I'd prefer not having to spend $500 or so for a license.
Thanks!
Have you looked at WIX? It's an open source tool for building MSI setups. It's pretty well supported. I haven't used it to do what you are asking, but a quick search did reveal a firewall settings extension for WIX: http://www.joyofsetup.com/2008/05/17/new-wix-feature-firewall-extension/
Have you looked at Nullsoft Scriptable Install System(NSIS)?
A little while ago, I decided to take a little utility I wrote and make redistributable1. I looked at a whole bunch of standard installer options (i.e. VS IDE vs. different flavors of InstallShield) and one thing I didn't like is that they could all do trivial things, but if you needed something just a tad more complicated, the best option was non-free InstallShield or you are out of luck.
Then I came across NSIS. From my initial impression, it looks to be a full blown installer builder. It supports most features, even complicated ones and it is open source. Even for things that the product itself doesn't support, there's a strong community of other developers that post their own scripts and add-ons.
It is probably not as easy to use as InstallShield (I remember IS had visual and very friendly IDE). This one is more scripted, so you need to understand their language. But it's not difficult, I was able to ramp up and create and install package within one day.
1-If you wish to see what NSIS script looks like, you can follow GitHub link in my profile. The project is called "Droppy"
I am wondering how can I make a setup project for each of these projects
Asp.net mvc 2.0
C# cmd line
Application C# web-service
I am using VS 2010 ultimate and I know that I can use the the free edition of install shield for at least the cmd line application. I am not sure about the other 2. I also know about the setup project that you can use. I just need a lot more than the basics so I am not sure how to make either one do these things.
So here is some criteria that each of my setups should be able to do.
Asp.net mvc 2.0 criteria
free (I really don't want to pay for an installer - you can list them just so I am aware of them).
Terms of service
Ability to force a user to setup certain settings. Like connection string, smtp settings. So they should be able to type it in through the setup wizard and the web.config should be updated based on this.
When it installs the stuff it should all be .dlls for all the C# code.
C# cmd line criteria
All criteria as above
I am not sure if this has to be done in the code but I have a html file that contains a template for a message. The path to this file is in the web.config so I a person needs to set this path each time they install it. I tried to do this in code but I could not figure out how to make it find the right path in development and the right path in production. It seems like If you run in VS the path is different.
Web-service
Pretty much everything I covered in the first 2 ones.
Thanks
If I were you, I would choose WiX as a platform for your installers for all these applications. Some reasoning behind this:
it is XML-based, that is, friendly to source control, diffing and merging
it has rich set of tools for most of scenarios you might need (harvesting lots of files, creating upgrades and patches, creating multi-lingual installs, etc.)
it is free and open source
it is production-ready (at least, version 3.0 - later versions are still in beta)
it is used by Microsoft to create installations for such products like MS Office
it has rich community at wix-users#lists.sourceforge.net and StackOverflow
it integrates into the VS like a charm
it is friendly to build engines like NAnt and MSBuild
VS setup project is not my choice because:
it is very limited in set of features-
it encourages bad practices like Installer classes
finally, it was retired by Microsoft
I'm not familiar with InstallShield Limited edition, though.
Hope this overview will help you finding the best option for your case.
We are working on deploying a very custom application.
The application is the main program (and only program) that will run on the PC, but it depends on multiple 3rd party installers that must be installed via separate setup programs. Some of these are standard MSI, install shield, other outdated setups, etc.
On top of that we must deploy SQL Server Express 2005, install IIS if it is not found and setup a website.
Our final end user deploying this will be a person with technical experience on a new "out of the box" PC with XP SP3.
What is a good option for developing this? WiX? Visual Studio setup projects may not cut it. There is also the issue of somehow running other MSI's while an MSI is already running.
Would it function better as a standard C# application that requires .Net to be preinstalled? Then it would merely prompt for a few options then run several installers I suppose.
Any thoughts? We'd prefer to stick to C# .Net.
Doesn't XP SP3 already have a .NET runtime installed?
If your end user is someone with technical experience then it seems reasonable to sacrifice some of the "wizardness" of an MSI package for the flexibility of something a little more raw, such as a Ruby script, Powershell script, or .NET console or Winforms app.
This comes down to the benefit vs. cost.
If this is only to be run on a single or small number of target PCs and you have the ability to support the install (even remotely), I would recommend going to a manual install for any 3rd party dependencies.
It will be much easier to provide each package's installer with written instructions and provide than to write/test/debug (and probably still support) a complex, fully automated installer that will only be used once or thrice.
If there will be many installations, the automation will give more benefit.
There is an installer product called Inno Setup that might suit your needs. It allows for custom scripting so you can detect whether all of the dependencies are installed.
If some of them are not installed then with some scripting the installer can download and install the 3rd party dependencies before installing your app. Some help with that can be found at the Code Project article. (http://www.codeproject.com/KB/install/dotnetfx_innosetup_instal.aspx)
The only problem with this route is the scripting language is in pascal.
Just a question, is the company you work for supplying the boxes because if you are then couldn't you pre-install the software? At least that way there is one less thing that can go wrong.
WIX is a fairly flexible way to create the installer (although the learning curve can be quite a bit as the documentation still is lacking). That would probably be your best bet for installing the components that are actually your product's artifacts. Have it check that the required components are installed, but I wouldn't try to launch installers off of it. Instead, like Seth mentioned, write a Powershell script/VBScript (or Console application) that will do the component checking and launch the old installers for user in the order necessary. Of course you would need a way to capture when the installer finishes before continuing on (don't know if VBScript really has that capability, so Powershell/Console app may be a wise choice). And the final installer called would be your product. This way if there's reboots required the installer can be ran the exact same way and would just keep checking for required components and firing off installers as needed.