Uninstalling a particular feature using msiexec - wix

I installed an test application which has two features (FirstFeature & SecondFeature). I want to remove only one feature (SecondFeature) from the application. I tried using REMOVE property in command line. Here is the command used to remove SecondFeature.
msiexec /x RemoveFeatures.msi REMOVE="SecondFeature" /L*V log.LOG
But it is uninstalling the complete application. Log file shows that REMOVE=ALL is added by default. Here is the log file details.
MSI (s) (24:B4) [17:39:05:231]: Command Line: REMOVE=SecondFeature REMOVE=ALL
MSI (s) (24:B4) [17:39:05:231]: PROPERTY CHANGE: Adding REMOVE property. Its value is 'SecondFeature'.
MSI (s) (24:B4) [17:39:05:231]: PROPERTY CHANGE: Modifying REMOVE property. Its current value is 'SecondFeature'. Its new value: 'ALL'.
It indicates REMOVE property value is overridden during uninstall process. Do I need to set any other property to remove a specific feature ?
Any help is appreciated. Thanks in advance !!!

As you noted, /x is for uninstall. A complete (ALL) uninstall.
Although it may be counter intuitive you want to do an install that removes a feature.
msiexec /i RemoveFeatures.msi REMOVE="SecondFeature" /L*V log.LOG
You may also wish to add /qb or /qn to make it non-interactive / silent.

Related

How to pass msiexec command line options to Wix

I have a Wix Installer, Product.msi, which launches a setup.exe via Custom Action. When I execute my Installer through Command Prompt, for example:
msiexec /i Product.msi /q
or
msiexec /r Product.msi /q
or
msiexec /x Product.msi
I would like to pass /i /r /q /x options to setup.exe
Is it possible to achieve this through Wix Toolset?
The flags you mention all set properties for the MSI, which you can then reference in your custom action, converting to whatever format you need for your setup.exe.
For instance:
/i corresponds to the value of Installed being false (if the product isn't already installed).
/r corresponds to a value of "Repair" on the WixUIInstallMode property.
/x corresponds to a value of "Remove" on the WixUIInstallMode property.
/q (and its modifiers like /qn and /qb) correspond to the UILEVEL property, which has the following values found from this link.
UILevel:
INSTALLUILEVEL_NONE 2 Completely silent installation.
INSTALLUILEVEL_BASIC 3 Simple progress and error handling.
INSTALLUILEVEL_REDUCED 4 Authored UI, wizard dialogs suppressed.
INSTALLUILEVEL_FULL 5 Authored UI with wizards, progress, errors.
You can see this answer if you're unfamiliar with passing values and referencing them in a custom action.

how to create installation log file in Target folder in wix

i am using the following command to see the logs in wix installer.
msiexec /i "D:\WixProjects\DFServicesWixSetup\DFServices\bin\Debug\DFServices.msi" /L*V "D:\DFServices.log"
but this command is trying to install the msi again.
I want to execute this command from wix after finishing the installation and log file need to save in installed folder.
can any one help me on this.
You need to decide in advance if you want Windows Installer to make a log file. You also need to decide in advance where it should go. If you want it to end up in the install folder then you either need to copy it there after installation or specify the install folder in advance, too.
In Windows Installer folders are controlled by properties. You can specify such properties in the command that starts installation. The name of the property for the "install folder" depends on how the installer authoring; INSTALLFOLDER is one typical name.
So, you could do this with a command like this:
msiexec /i "D:\WixProjects\DFServicesWixSetup\DFServices\bin\Debug\DFServices.msi" /L*V "D:\path\DFServices.log" /qb INSTALLFOLDER="D:\path"
The /qb switch is reduce the UI such that the user is offered the chance to change the installer folder. It may more may not be need for your installer, depending on what dialogs its UI normally shows.
So, the first step is to figure out which property sets the install folder in your installer.

msiexec: Default to "do not close application" in silent mode

I want to install my program with a quiet msiexec command such as:
msiexec /i file.msi /qn
However, if the application happen to be running, it will default to closing the application. I want msiexec to default to never close the application, but instead install on next reboot.
Is this possible as a command line option or through how the msi is built in wix?
Edit: I am installing a service btw
Take a look at the REBOOT property.
You probably want to add REBOOT=R.

wix pass option to msi for repair

When I repair using the msi, a registry entry is properly re-created. When using the exe generated by Burn, the entry is not-recreated, unless the exe associated with the reg entry also requires compare.
I wonder if, when burn invokes msi, if it is overriding the default /fm behavior of msiexec.
That switch means "repair all required computer-specific registry entries "
Is there any way I can confirm, deny, or modify that behavior?
When planning a "Repair" operation in Burn the REINSTALLMODE is "cmuse". For a "Modify" operation the REINSTALLMODE is "cmuso". So "m" is present in both cases.
The Burn log file should say, "Planning action: Action" and that will tell you which it is doing. If you are executing a Repair operation and there is not newer version of the executable on the machine than what your MSI expects, Burn's REINSTALLMODE should work. If you are doing a "Repair", look in the generated MSI log file for the same Burn execution and see what the Component states are for the Components that are not repaired. That should help you track back to see why the Component was not fixed.
From the provided log file:
Command Line: ARPSYSTEMCOMPONENT=1 MSIFASTINSTALL=7 REINSTALLMODE=cmuse
REBOOT=ReallySuppress IGNOREDEPENDENCIES=ALL CURRENTDIRECTORY=C:\temp
CLIENTUILEVEL=3 MSICLIENTUSESEXTERNALUI=1
The lack of REINSTALL=ALL shows that EnableFeatureSelection='yes'. Either remove that attribute (or change it to the default 'no') or your BA needs to handle the OnPlanMsiFeature() callback

ProgramFilesFolder Set to C:\ when using /a switch for msiexec

I have an .MSI installer that I created using WIX and works fine when opening the file from windows explorer or installing from a command window using msiexec /i. The problem is that I need to use /a to install it using a group policy when the computer turns on.
When using the /i option the ProgramFilesFolder value is set correctly to "C:\Program Files (x86)\".
When using the /a option the value of ProgramFilesFolder is set to "C:\", and then I get an error (on the Log) that says:
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2203. The arguments are: C:\Referrals.msi, -2147287035,
Note: I am not running the .MSI file from "C:\"
Try
msiexec /a TARGETDIR="c:\temp\location" /passive
I think you may have the msiexec.exe command line mixed up: /a is admin install. This is essentially a command to create a network installation point with extracted files to use for installation on a lot of computers. This ensures the source files are available for patching, self-repair, repair, reinstall, etc...
To deal with advertisement and group policy you need to use these command line options. So a very basic operation would be advertise product to all users silently and write a log file:
msiexec.exe /JM "Installer.msi" /QN /L* "C:\msilog.log"