In my installer, I have two features. If I disable one feature, the Browse button (and the edit control containing the INSTALLDIR path) disappears from the UI. I suspect this is because both Feature elements use the same ConfigurableDirectory="INSTALLDIR" attribute:
<Feature Id="MYCLIENT" AllowAdvertise="no" ConfigurableDirectory="INSTALLDIR"
Title="Client component"
Description="Client Component" Level="1">
<ComponentGroupRef="Client1"/>
</Feature>
<Feature Id="MYMMC" AllowAdvertise="no" ConfigurableDirectory="INSTALLDIR"
Title="MMC Components"
Description="MMC Components" Level="1">
<ComponentGroupRef Id="MMC1"/>
<!-- MMC snap-in requires some client components -->
<ComponentGroupRef Id="Client1"/>
</Feature>
What would I need to implement to prevent the INSTALLDIR Browse controls from disappearing when a feature is de-selected/not installed ?
TIA
Browse button is related to the selected feature in the tree. If you have excluded some feature and it is still selected, it is logical that there is no sense to set install path for this feature. So Browse button is disabled. I suppose when you select another feature in the tree, the Browse button will appear again.
By the way, why do you need the same ConfigurableDirectory for both features? That's a bit strange to install 2 main parts of the system in the same folder. I usually make a root Feature with ConfigurableDirectory while all sub-features can only be installed in predefined sub-folders. On the other hand, if you really need to set different locations for 2 features, you'd rather use differect ConfigurableDirectories.
Related
In WIX I'd like a feature to be installed and uninstalled normally but not to be touched during repair.
I was not able to find a condition which would allow me to do this.
My attempts has failed: the feature is reinstalled on repair (what I do not need) or is not uninstalled.
This is a sample that I tried last:
<Feature Id="aFeature" Title="A Features" Level="1">
<ComponentRef Id="aComponent" />
<Condition Level="0">
<![CDATA[WixUI_InstallMode="Repair"]]>
</Condition>
</Feature>
What is the right condition to uninstall but not re-install during repair?
Or what did I do wrong?
This works for me:
<Feature Id="aFeature" Title="A Features" Level="1">
<ComponentRef Id="aComponent" />
<Condition Level="0">
<![CDATA[REINSTALL<>""]]>
</Condition>
</Feature>
This way during Repair the feature is ignored and not touched, but normally uninstalled
The only way I can think of is to give all the components in that feature an empty guid, that's the signal to Windows Installer not to do anything with them, such as repair them, patch them, uninstall them. If the product is already shipped it's too late for that. However that's a drastic step that is normally necessary only when you want to install some things for temporary use and then delete them. So you are fighting the framework here. It's look like you have a problem that disabling feature repair might solve, so why not describe the problem to see if there is another solution?
I created an Installer using WiX to install a VSIX along with two dependent components. These two components were available to me in the form of Merge Modules. Below is the code where I used the merge modules in my code:
<DirectoryRef Id="TARGETDIR">
<Merge Id="MergeModuleID1" SourceFile="MergeModule1.msm" DiskId="1" Language="0"/>
<Merge Id="MergeModuleID2" SourceFile="MergeModule2.msm" DiskId="1" Language="0" />
</DirectoryRef>
and I've referred these merge modules as:
<Feature Id="ProductFeature" Title="Title" Level="1">
<ComponentRef Id="VSPackage"/>
<ComponentRef Id="ApplicationShortcut"/>
<ComponentRef Id="DesktopShortcut"/>
<ComponentRef Id="LicenseComp"/>
<MergeRef Id="MergeModuleID1"/>
<MergeRef Id="MergeModuleID2"/>
</Feature>
The problem I'm facing is, that my VSIX is installed to all the user accounts on the machine, but these merge modules are not, they're installed only on the user account where the product is installed. On other user accounts, an installation dialog appears, which I believe is installing these merge modules, after which everything works fine.
How do I make these merge modules to be installed to all users?
P.S: ALLUSERS property in both the MSI and merge modules are set to '1'.
You may need to clarify that question somewhat. Merge modules are not installed, just the files, so you mean the files in merge modules are going somewhere incorrect, yes? Also, files are not installed on a user account they got to a location on disk.
Guessing my way through this, you're probably saying that the files get installed to somewhere like the User's Application Data location for the installing user. If that's what the merge modules specify in their internals, that's normal. You can obviously install files to the current user's application data folder even if you're doing a per machine install. I can't say if those merge modules are correctly designed or not, but if they are then:
The initial install will put those files in the installing users file location.
If another logs on and uses a shortcut and your MSI is correctly designed, the install-on-demand feature will install those files for that user in that user's folder, maybe asking for the original install media. That's the way this is designed to work because:
a) There is no mechanism that that allows a file to be installed simultaneously to all user file locations on the system, and it makes no sense anyway if they never use the app.
b) What happens if you create a new user account AFTER the product has been installed? The file will not be in that user's location, however the install on demand scheme guarantees that this new user will get the file in their location if they log on and use the app.
The short answer is that this is probably all working as intended.
Setting ALLUSERS is fine.
What you've described looks like "advertising".
To remove advertising for the Merge Modules, add AllowAdvertise="no" to the Attributes of the Feature containing the MergeRef element :
<Feature Id="ProductFeature" Title="Title" AllowAdvertise="no" Level="1">
<ComponentRef Id="VSPackage"/>
<ComponentRef Id="ApplicationShortcut"/>
<ComponentRef Id="DesktopShortcut"/>
<ComponentRef Id="LicenseComp"/>
<MergeRef Id="MergeModuleID1"/>
<MergeRef Id="MergeModuleID2"/>
</Feature>
My Installer required all the wizard options so I used WixUI_Mondo. That displays all the setup optoins: ( Typical, Custom and Complete ).
As per my requirement the Custom type shouldn't be displayed. By default the package so install under program files.
How can I disable this feature also just would like to display like "C:\Program Files\MyProduct" in the setup type screen?
<Feature Id='MainProgram' Title='Program' Description='The main executable.' Level='1'>
<ComponentRef Id='MainExecutable' />
</Feature>
<UIRef Id="WixUI_Mondo" />
<UIRef Id="WixUI_ErrorProgressText" />
If you don’t want to use Custom Setup, then go for WixUI_InstallDir. It has Install Directories option.
If you want to modify anything in Custom Setup, use Wix Source code. Inside the Source code you can find the UI WXS files in below location.
src\ext\UIExtension\wixlib
Open WixUI_Mondo.WXS file and Copy all coding inside the Fragment and use it in your project. If you modify the Dialog publish sequence you can do anything, (Adding Custom dialog or disabling existing dialog, etc.)
Note: You can download the Source Code from here.
I have a software that assembled with about 19 different components. Right now I use 19 setup projects and 1 Winforms project that is the main installer. I want to move to WiX since I want to upgrade to visual studio 2012. My question is: is it possible to do that in WiX? In current setup I have, user able to decide which components to install by checking them out. Is it possible to create such experience with WiX? also is it possible in future to upgrade only one of those components?
Yes, Wix it brilliant for this kind of thing, it calls them Features, you can simply setup a set of features (you can set the Level so that things you want installed by default (if you do) are checked, and things that are optional are unchecked (if you like). You can also have a feature under a feature, for children like:
Product
-Feature 1
-Feature 2
--Feature 2 Documentation
--Feature 2 Admin Tools
-Feature 3
(etc)
These support title/description etc to make it nice and user friendly.
To setup the more advances UI features you will need to add a reference to the WixUIExtension.dll to the installer project, and add a UIRef element into the product (see this article) like:
<UIRef Id="WixUI_FeatureTree" />
You'll probably want to setup a Feature for each of the "things" you want installed, then setup a ComponentGroup for each one, in that you can define any number of sub components that you want installed.
Here's a snippet that should do the above (note it's not fully fleshed out, just an example):
<UIRef Id="WixUI_FeatureTree" />
<ComponentGroup Id="Component1">
<ComponentRef Id="Component1"/>
</ComponentGroup>
<Component Id="Component1" Directory="directorytobeinstalledto">
<File Id="File1" Source="fileweareinstalling"/>
</Component>
<Feature Id="Feature1" Title="Feature 1" Description="My Feature 1" Level="1">
<ComponentGroupRef Id="Component1"/>
</Feature>
<Feature Id="Feature2" Title="Feature 2" Description="My Feature 2" Level="1">
<Feature Id="Feature2.Docs" Title="Feature 2 Documentation" Description="My Feature 2 Documentation" Level="1000"/>
<Feature Id="Feature2.Admin" Title="Feature 2 Admin Tools" Description="My Feature 2 Administration Tools" Level="1000"/>
</Feature>
<Feature Id="Feature3" Title="Feature 3" Description="My Feature 3" Level="0"/> <!-- disabled! -->
I am very new to WIX installer, I have the following feature:
<Feature Id="F_MyFeature" Title="My Feature" TypicalDefault="install" Level="1" Display="expand" >
Obviously it shows in the feature list as "Will be installed on local hard drive"
I want this feature to show the "X" on it and not to be installed by default, how do I do that ?
Features are marked for installation only if their Level is lower than INSTALLLEVEL property value. Most installers have a low INSTALLLEVEL, for example 4 or 1000.
So to make your feature not installed by default (with an X next to it), simply set it's Level to a very high value. For example 32767:
<Feature Id="F_MyFeature" Title="My Feature" TypicalDefault="install" Level="32767" Display="expand" >