Creating a silent installer for a MSI - wix

What is the best way to make a silent installer (or unattended) for a program that was already created and has a msi installer?
At work I'm told to create an installer that is automated and does all the interaction with the user automatically so that the user essentially just hits one button and it runs through the msi installer of the program that was already developed. Also I have to make it replace a couple files in the directory.
Is it possible to make a installer automate another installer?
Can it be done using WIX in visual studios or NSIS?
Do I need to be able to pull the already developed installer into Visual Studios? If so how?
Bonus- I would like to be able to design the UI so I can place the company logo on it.
I'm a beginner in this field and learn best from walkthrough's or tutorials.

1) Yes - a bootstrapper is what you are looking for. Burn.exe comes with WiX, more information here
2) Yes to using WiX I know nothing about NSIS.
3) If you have nothing you need to change in the MSI then you could just use WiX to create the bootstrapper that would install your existing MSI.
Bonus) WiX lets you fully edit the install dialogs including logos, licenses, etc. More information here.
Extra thoughts: silent installation is part of MSI; your current installer can be installed silently by executing
msiexec /i <your msi> /quiet
in a command prompt, the command prompt may need admin privileges.
If you need to make changes to the existing msi look at using Dark.exe again a component of WiX that will decompose your existing MSI file into .wxs files. This post may also prove informative on moving to WiX.

Related

Only repair and uninstall can be seen while relaunching bootstrapper application

I have an msi bundled with prerequisites using Wix bootstrapper. After installing the wix bootstrapper application, if i relaunch it again i could do only repair and uninstall. But i need to have modify option also.
In MSI i tried setting the property REINSTALLMODE as "vamus". after doing so, i was able to change / repair/ uninstall w.r.t. msi.
But bootstrapper application doesn't show modify option.
On relaunching the installed wix bootstrapper application, i am expecting to have below options.
change, repair & uninstall.
A modify option makes only sense if you want to remove or add features included in an msi. May be a solution would be to set up your own bookkeeping on installed features and showing this list to the user in a custom bootstrapper application.
Another way to handle this situation may be to show the msi installation dialog which should show a "modify" dialog option.

Confused about the roll of burn (bootstrapper) vs the main msi installer

I'm a bit confused about how wix burn and the main installer are expected to interact with each other. I'm new to wix and windows installer technology in general.
Based on the examples I've seen I was under the impression the burn application would install prereqs then switch to the main installer. However I've seen comments from searches that when using the burn application the main installer becomes secondary and the burn UI should be used instead. This is reinforced by the behavior of the burn application. What I mean is the burn application has it's own license agreement, ARP entry, hides the main installer by default, and has it's own change/repair entry.
This has me confused because the burn application is lacking a lot of functionality the main installer has through MSI. Some functionality I would consider essential such as feature selection, directory selection, and changing features. But this is absent from the burn application.
I feel if I used the burn application as the primary I'd have to recreate the UI, while if I used the main installer for prereqs (if possible) I'd have to recreate the functionality burn provides. Neither approach is desired, so I am wondering how other users of wix handle large projects. Is it standard to write your own custom burn UI? Any help that might clear up this confusion would be greatly appreciated.
Common practice would be to use the Wix bootstrapper (burn) specifically for installing software that is necessary to run your main application, first and automatically.
You would indeed use the main MSI produced by Wix to install your main application. You would use one of the UI (dialog set) sequences already available in Wix. The dialog set will be applicable only for the main MSI, because again, the bootstrapper's main responsibility is to install pre-requisite software for your application to be able to run.
The whole installation process involving your application MSI in conjunction with the bootstrapper executable would be as follows:
Pre-installation
You would build your application MSI.
You would make sure your MSI is specified in your bootstrapper .wxs file.
You would build a Wix bootstrapper executable file which, if correctly set, would
include your appplication MSI.
Installation
You simply run the bootstrapper executable file.
All pre-requisite software will be installed first.
Your main application MSI will now be executed. The user will now be able to set e.q. the installation directory of your application through the dialog sequence of your main MSI (including the other points you've mentioned, if the correct dialog sequence set has been selected before building).
Hope this helps to clear out things a little bit!

Running a Windows Installer inside another Windows Installer

I'm looking to create a Windows Installer package that will run an exe that runs another Windows Installer.
I'm putting a package together that has to install three files, an EXE, a CONFIG and an empty TXT. In addition, we also need to run the Access Database Engine 2007 as part of this process. However, when setting custom actions to just run it (with the flag /quiet) it fails because it's attempting to run an MSI inside of an MSI.
Is there any way I could somehow have it launch right after/right before or something? I've looked into WIX but honestly I'm clueless on how it would solve the problem.
Thanks.
You should look at the WiX Burn functionality and prerequisites. Some examples are:
WiX - Install Prerequisites and 3rd party applications
http://www.c-sharpcorner.com/UploadFile/cb88b2/installing-prerequisites-using-wix-bootstrapper-project-and/
You could probably just run the setup from the Burn bootstrapper - it will do its own detection if it's already installed.

How to modify the installed features of msi with wix bootstrapper?

I am trying to call a msi inside wix bootstrapper program.It is working properly at the time of installation.And selected features are installed properly.But after installation i am trying to modify the installed features.In the control panel there is change button.But when i click it then it is showing a dialog with Repair, uninstall, cancel buttons.There is no modify button for modifying the features of installer.
Please specify the solution if any.
code inside Bootstrappertheme.wxl is
<!-- Modify dialog -->
<String Id="ModifyHeader">Modify Setup</String>
<String Id="ModifyNotice">[WixBundleName] is already installed on this machine. If it's not working correctly, you may repair it. You may also uninstall it.</String>
<String Id="ModifyRepairButton">&Repair</String>
<String Id="ModifyUninstallButton">&Uninstall</String>
<String Id="ModifyCloseButton">&Cancel</String>
The wix standard bootsrapper application does not currently support msi feature selection. Currently, the only way to get it is to create a custom bootstrapper application. People have asked about this on the WiX mailing list multiple times. Rob Mensching is the project leader, and Bob Arnson currently manages the 3.x branch.
This guide: Writing Your Own .Net-based Installer with WiX is the best resource I know about for building one in WPF. The actual WiX source code is very helpful as well. It's a very big task though.
I don't have a sample project to share with you, but the blog post I mentioned above does have a section "HANDLING CURRENT & FUTURE STATE" which describes how to do this. I think it really is a terrific resource.
Also, see this question: Custom WiX Burn bootstrapper user interface?
Burn GUI
Burn GUI is very different from MSI-GUI. Here is an older, similar answer
Please also see comments in these answers:
On customized GUI
Changing text color to Wix dialogs
Custom WiX Managed Bootstrapper Application
MSI File
What dialog set are you using for the MSI files? Have you tried enabling the advanced dialog set? I haven't tried it yet: http://wixtoolset.org/documentation/manual/v3/wixui/dialog_reference/wixui_advanced.html
WixUI Dialogs:
http://wixtoolset.org/documentation/manual/v3/wixui/dialog_reference/wixui_dialogs.html
Tutorial:
http://wix.tramontana.co.hu/tutorial/user-interface/ui-wizardry
It might be possible to use Orca (http://support.microsoft.com/kb/255905) to edit the MSI and resave it so that it, without special configuration in wix, automatically has the Modify option in Programs and Features. When creating an MSI from scratch (using InstallShield for example), the user can specify which options are available. There should be a way to edit the file to accomplish the same thing.
When you open up the "Change" feature from the Programs and Features menu, it reruns a cached version of the MSI installer in maintenance mode. Regardless of what program is bootstrapping the MSI (wix vs InstallShield), the MSI is the only thing that Windows knows about. If it is not configured to have a Modify option, it won't have it.

Why won't Windows Installer use the UI in the .msi file during removal?

Has anyone been able to get Windows Installer to use the InstallUISequence table during removal?
I started with an MSI file produced by the Visual Studio msi builder, decompiled it into WiX source code and handcrafted it, but I cannot get the installer to use my UI during removal. It insists on using a default UI provided by Windows Installer.
I have also analyzed several MSI files, and I have been unable to find one where Windows Installer will use the provided UI during removal.
I captured the msiexec logs during removal, and sure enough, Windows Installer appears to be ignoring the InstallUISequence table.
It seems that msiexec runs with minimal UI during removal. If I specify the /qf switch (use full UI) during removal, then Windows Installer does take the UI from the .msi file. However, this doesn't help the regular user, because she won't do the removal from msiexec.
Does anyone know of a way to convince Windows Installer to use the UI in the MSI file by default?
When removing an application from Add/Remove Programs, this will always run with "basic" UI.
You can't make uninstall run with full UI, the best you can do is prevent removal and force people to 'modify' (which does run with UI) and remove from there.
Whatever you do, there's still no way to prevent someone right clicking on the original MSI and selecting 'Remove', this will always run with basic UI.
The "Why" is basically because Microsoft says so. :-) Can't say I disagree as I get annoyed when ISV's get all cute when I'm just trying to remove a program.