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" >
Related
I am trying to execute an EXE file through my installation and this file should be installed if the related feature will be installed in the feature tree.
I have two questions :
1-How to relate the Custom Action to this feature."The condition"
2- How I can include this exe file in the generated file. "This EXE File is a SQL Installation which I already made in WIX BOOTSTRAPPER "
http://apprize.info/web/wix/13.html
and my code is
<Feature Id="SubFeature1" Title="SQL Installation" Level="1" >
<ComponentRef Id="SubComponent1"/>
</Feature>
<Feature Id="SubFeature2" Title="Second Subfeature" Level="1" >
<ComponentRef Id="SubComponent2"/>
<!-- <Condition Level="0">IISMAJORVERSION=""</Condition> -->
</Feature>
</Feature>
<CustomAction Id="CreateSQLINSTALLER" Directory="BMSS4_Installer"
Execute= "deferred" Impersonate="no" Return="ignore"
ExeCommand="[BMSS4_Installer]Sql_Installation_Test1.exe -install" />
<InstallExecuteSequence>
<Custom Action="CreateSQLINSTALLER" Before="InstallFinalize"><![CDATA[(&SubFeature1)]]></Custom>
</InstallExecuteSequence>
the Sql_Installation_Test1.exe is included in the main folder so BMSS4_Installer..
But is it right to use it direclty like that in Directory tag om CustomAction !!
Feature conditions are documented here:
https://msdn.microsoft.com/en-us/library/aa368012(v=vs.85).aspx
in the action state of the feature. Basically you use a condition such as:
&featurename=3
where 3 is INSTALLSTATE_LOCAL, as there in the documentation. There are limits on where the condition can be used, the main one being after CostFinalize.
It's not clear if you are installing some version of SQL itself, but that would have its own install and wouldn't need repackaging, and it would be a prerequisite installed with Burn, for example. If it's a separate MSI setup of yours, again a Burn package would probably be the best way to install it and your other MSI.
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?
How can I have a Feature depend on a system dependency (e.g. powershell), but still indicate to users that this feature is available in the installer.
Currently features are listed as follows (screenshot):
Feature List
My current idea is to put a condition on the feature:
<Property Id="POWERSHELL_3_INSTALLED">
<RegistrySearch Id="Powershell3Installed"
Root="HKLM"
Key="SOFTWARE\Microsoft\PowerShell\3"
Type="raw"
Name="Install" />
</Property>
<Feature Id="TestFeature"
Title="Test Feature"
Description="Test Feature Description. Note: This feature requires Powershell 3 or higher."
Level="1"
Absent="allow"
InstallDefault="local"
AllowAdvertise="no">
<Condition Level="0">
<![CDATA[(POWERSHELL_3_INSTALLED <> "#1") AND NOT REMOVE]]>
</Condition>
</Feature>
This does hide TestFeature for users without powershell installed, preventing them to install it, but this way users are not aware that this extra feature would be available if they would install powershell.
Any ideas how to achieve this?
The SelectionTree control in Windows Installer does not support showing disabled features. You would have to reimplement that -- for example, using checkboxes.
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! -->
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.