I am trying to silently install the .NET 4 Framework with my app through NSIS.
I cant for the life of me work out how to make the .NET installer report where its up to back to my installer and update the progress bar on NSIS to reflect this.
Is there an easy way to do this?
Edit: Just to clarify I want to do this as when the .NET installer runs silently it looks like my installer has frozen as the progress bar does not move until .NET is installed.
This is not supported by any setup tool. Third-party installer progress cannot be captured and integrated into a main installer.
Instead, the third-party installation (.NET Framework) can run with basic progress. This way it shows it's own progress bar which is more accurate than what you could capture in a main installer.
Related
I have created a msi which allows user to view license, select installation folder, and features to install. That all works well.
Now I need to create a bootstrapper that will check if framework 4.5 is installed, install it if not, and then install msi.
I can do this using WixStandardBootstrapperApplication.RtfLargeLicense, where I would install framework, and then execute msi with its own UI.
But what if I do not want to show two apps (msi over exe), but only one window?
Since my msi contains feature, standard bootstrapper does not provide interface where I can set features from msi, so I need to create a custom UI.
The problem is I do not quite understand how WixManagedBootstrapperApplicationHost works? I created a dll with new UI, and place it in Payload. When running the setup, when framework needs to be installed, WixManagedBootstrapperApplicationHost always invokes its own window which says:
Microsoft .NET Framework required for MyApp Setup. Click the "Accept and Install" button to accept the Microsoft .NET Framework license terms.
And after it completes installation of .NET Framework, then it invokes the UI that I Created in dll. Why would anyone want this kind of functionality, where my bootstrapper app contains totally different UI than the framework installation UI? Isn't the idea of bootstrapper with custom UI is to provide completely custom UI?
So, how can I provide my custom UI for that framework installation part?
I assume your own UI is C# and WPF? If your installing it on a machine without .Net then it's going to need to install .Net before it can show the WPF UI. I could be wrong but I'm sure that's unavoidable.
If you want to replace / modify the .Net install screen then this thread looks like it has the answer:
Wix Burn: Basic UI handling if No Net Framework is there
However if your saying the .Net install dialog is showing up over your UI at some point in installation then you need to set the Install command to "/q" which means quiet (no UI).
I'm developing a Windows service in VS2012 and the setup/deployment part has been removed. So I'm not able to create a setup project. I would like to hear what you guys could recommend for a good easy to use the installer. I need to take some inputs, only strings, under the installation of the service. I've been looking at WiX but that seems a bit complex, and I only got 1 or 2 days to make this installer.
So what installer should I use other than Wix?
I've had really bad experiences with InstallShield LE (the one that comes with Visual Studio 2012), especially for Windows Services. The features that you need to install a service (custom actions, etc), don't come with the light version.
What I'm planning to do for the current Windows service I'm working on is to build it with Topshelf, which (amongst other things) means installing your service is as simple as running MyServiceApp.exe install. I'm sure even InstallShield will let you run your app once it's installed, and then your app/Topshelf can install the service component.
If InstallShield doesn't work for you, I've had good results before with NSIS. Simple, powerful, free, decent documentation. It looks a bit clunky.
Here is a list of setup tools which can get you started:
http://en.wikipedia.org/wiki/List_of_installation_software
If you don't have a lot of time for creating the installer, I recommend using a commercial tool like Advanced Installer or InstallShield. You need a license, but they are focused on usability (do more in less time).
You can do it with InstallShield LE... You can add custom actions "After Register Product" for install and for "After System Changes". These custom actions can run an EXE on the machine.
Make sure you run the command line tools "in system context"
After Register Product run the version of InstallUtil to your version of .NET
eg.
path=C:\Windows\Microsoft.NET\Framework\v4.0.30319
command=InstallUtil.exe "C:\Program Files (x86)\XXX\YYY\ZZZ.exe"
replacing XXX YYY and ZZZ to match your install
After System Changes to delete your service name run
e.g.
sc delete "servicename"
Note you need support for the custom actions within your own service executable (you needed this in earlier VS too).
You can find more information about SC here:
http://support.microsoft.com/kb/251192
To add an installer for a service, you just need to right-click on the designer for the service and click "Add Installer".
Here's the walkthrough:
http://msdn.microsoft.com/en-us/library/zt39148a.aspx
I have already made a MSI installer with WiX using a custom WPF UI with the EmbeddedUI element. It is similar to the sample found in src/DTF/Samples/EmbeddedUI.
I would now like to have a bootstrapper that checks if .NET 4 is installed and install it if it's not, and then launch my MSI.
It looks like Burn would override my WPF EmbeddedUI in order to chain the .NET 4 and MSI installations into a single installation with a single progress bar. I know that I could have a managed application to change the UI of Burn then pass parameters to my MSI but the problem is that I would like my UI to be in WPF which relies on .NET, and if the whole bootstrapper relies on .NET then the user couldn't even open the bootstrapper if he doesn't have it installed in the first place.
What I would like is the bootstrapper to install .NET if needed with a simple UI like Wixstdba, and then launch my MSI as it is, with its own WPF EmbeddedUI, without chaining it with the .NET installation. I don't mind that both installations would have their own progress bar, I would just like to be able to use my WPF EmbeddedUI for the installation of the main application.
Would that be possible. How? Thanks!
If you want your WiX bootstrapper to display the UI of your installer, set the DisplayInternalUI attrible of the MsiPackage to true. That solution does have the downside of displaying two UIs during install though.
You can also create a managed bootstrapper application using WPF and .NET. Burn provides a way to basically bootstrap itself and install .NET before displaying your custom UI.
I have been using InstallShield LE in Visual Studio 2010, but it is heavily limited and sometimes buggy. I looked at paid InstallShield versions, but these also have too many limitations for that price tag.
So I decided to switch to WiX. I have had some experience with it some years ago. It was pretty easy to build a simple installer using SharpDevelop with WiX tools.
Now I am trying to collect solutions and tools for WiX. Basically, I need to get the following functionality (requested by my client):
when I launch the installer, it should check a text file on the server and see if a newer version is available. If it's the case, then the installer should be able to download the updated installer package and launch it (are there any downloader utilities in WiX?)
solving dependencies. Major dependency of my app is .NET 4 (which itself depends on Windows Installer 3). The installer should offer the user to download and install them automatically
logging the installation process, also collecting the log file of the dependencies' installation process. I don't want the user to hunt various .log files in case .NET4 or WindowsInstaller3 installation fails. All the information should be collected in one place and if something fails, I should show the user a custom popup dialog with an option to save the complete install log file and send it to me
installer should be able to detect if there is a newer version of my app already installed, and show a meaningful customized error message before it exits
installer should be able to detect if there is an older version of my app already installed. and offer the user to exit installation or uninstall the previous version and install the new version. BTW, there are no minor component upgrades planned, I prefer to reinstall everything fresh (I guess, this is a major upgrade in the terms of WindowsInstaller). Installshield LE failed on me for this, it just showed an error box with the message about another product, but did not offer to uninstall it
in case of an upgrade, installer should be able to detect if some of application components are in use (running application processes) and show a custom error message and not just some cryptic "Installation failed"
I have read that it may be a bit painful to manage upgrades even if I keep my UpgradeCode intact, because this code is stored in the Windows Registry in a compressed way and also if the user renames the downloaded file, it might get detected as a completely new product by WindowsInstaller ... or maybe this is only the case with WindowsInstaller .msi files and WiX has some trick to avoid this issue?
About update downloading - I need this functionality also in my application itself. I am not sure how to implement it efficiently, so I can reuse the same update downloader code/utility in both WiX installer and in my app.
Is it possible to satisfy all these requirements using currently existing WiX tools, or maybe I'll need to code some components from scratch?
WiX is definitely the way to go in my opinion.
when I launch the installer, it should check a text file on the server and see if a newer version is available. If it's the case,
then the installer should be able to download the updated installer
package and launch it (are there any downloader utilities in WiX?)
In my opinion, this type of functionality is best handled by the application. However you can implement such functionality in a custom bootstrapper. The latest development of WiX includes a bootstrapper engine Burn that allows you to write your own custom bootstrapper on top of it.
solving dependencies. Major dependency of my app is .NET 4 (which itself depends on Windows Installer 3). The installer should offer
the user to download and install them automatically
You can use the standard WiX bootstrapper to install .NET as a prereq. Or if you create your own custom managed bootstrapper application, you can install .NET a prereq to your bootstrapper as in this example
logging the installation process, also collecting the log file of the dependencies' installation process. I don't want the user to
hunt various .log files in case .NET4 or WindowsInstaller3
installation fails. All the information should be collected in one
place and if something fails, I should show the user a custom popup
dialog with an option to save the complete install log file and send
it to me
Using the two bootstrapping methods above, when you launch your msi you can specify parameters for logging. In my own custom managed bootstrapper I created a button to open the log files created during installation.
installer should be able to detect if there is a newer version of my app already installed, and show a meaningful customized error
message before it exits
You can do this using launch conditions
installer should be able to detect if there is an older version of my app already installed. and offer the user to exit installation or
uninstall the previous version and install the new version. BTW,
there are no minor component upgrades planned, I prefer to reinstall
everything fresh (I guess, this is a major upgrade in the terms of
WindowsInstaller). Installshield LE failed on me for this, it just
showed an error box with the message about another product, but did
not offer to uninstall it
In my experience this major upgrades are the least complicated
approach.
in case of an upgrade, installer should be able to detect if some of
application components are in use (running application processes) and
show a custom error message and not just some cryptic "Installation
failed"
I think WiX/Windows Installer are generally good at handling these
scenarios and automatically notifying the user that
files/applications need shutdown without you having to author
anything extra in your installer.
All that said, you may want to look into creating your own custom managed bootstrapper using WiX and Burn. That is not trivial however. The best place to go is to download the source code to the WiX Weekly Releases and checkout the project src\Setup\WixBA. It is the custom BA that they wrote to install WiX. There isn't much documentation out there yet because WiX 3.6 is not released (although it is pretty stable). However you don't have to create your own BA to make a solid WiX installer that can handle upgrades and logging.
I built an application in c#. I published it using the publish option in the visual studio 2010 IDE. I have not used anything fancy in it, its a simple app with a couple of table layout panels. But each time i install it somewhere the app is trying to download the full framework 4.0 in which ever machine i install it.This is very irritating especially since i have not done anything very fancy here. Kindly help me on this problem.
Also i am open to anyother build tools to package my application and install it easily anywhere.
You can edit which prerequisites are set to install when your application is installed by going to the projects properties, going to the publish tab and selecting "Prerequisites".