I am making an installer, which need read a registry key and get a value, then use this value to access another registry then get the INSTALL dir.
Any condition mentioned above will stop the installation if fails.
How to set such conditions that one is dependent on the other?
Thanks.
Use RegistrySearch then a Condition element in the Product element using the Property from the result of the RegistrySearch.
Related
I would like to do this.
Check if a registry key exist. If it does, use the value as installdir. If it doesn't, show UI step to select a path and then use it as installdir but also create a registry key and set the value to the given path. The next time I run the installer the registry key should be found and not show that UI step.
Thankful for any help I can get!!
This is quite a common scenario and known within WiX as the Remember Property pattern.
A good explanation can be found on Rob Mensching's blog
How can I achieve the following: Before product A is installed, uninstall product B, but only if it is installed in the same installation directory.
Product A and product B are completely independent and different products, i.e they have different product codes and upgrade codes.
I assume that "same installation directory" means the browsable folder that a user can choose, and therefore you don't know if B is to be uninstalled until the user chooses the folder and the installation is committed to start (because of Back buttons). Obviously if there are file or registry conflicts in other locations there is a bigger problem.
Perhaps the easiest way to do this is:
Use a ComponentSearch for a component id in A's installation directory, that will give you the path to that component.
Compare that path with your installation folder (after it's chosen) to see if they are the same - I know of nothing built-in to do that. So use a custom action and set a property if they are the same.
It doesn't matter that the UpgradeCodes are different - you can have an Upgrade element that refers to A's UpgradeCode and do the upgrade automatically, perhaps the odd part being that you condition RemoveExistingProducts on the path compare property true and the upgrade property set, the one that you define in the UpgradeVersion element. That will clearly affect your ability to upgrade your own product, and you haven't said if that's a requirement or not. If it is an issue, then you'd add your own UpgradeCode in an Upgrade element with another UpgradeVersion property for detecting that, then your condition on REP is the condition for removing B OR your own upgrade property, and both will be uninstalled and your A installed.
I have a WiX project in which there is a need to check for certain registry keys that should be added as part of install.
But using the RegistrySearch element, as it is scheduled with AppSearch execute sequence, I always end up getting a blank value because till AppSearch no keys are written.
Is there any way I can determine existence of Registry keys somewhere around PostInstall?
This question is somewhat similar to : this question
Why do you need a search to see if a registry from the package is installed or not? You could simply just check the state of its component. If the state say the component got installed it means the registry is on the machine, and vice versa.
Condition examples.
I'm implementing exe installer with two msi. During installation of first one user have to select value from ComboBox and I want to use selected value as parameter to run transformation on second msi. I'm using dotNetInstaller bootstrapper (with no UI) and have to configure msiexec parameters as TRANSFORMS="[variable from first msi]"
I tried to use system variable but it wan't work. How can I get ui-property value to transform second msi?
Based on your current design, I'd say the simplest way is for the first MSI to store the property in a registry value and then have the second MSI ( or a transform of the second MSI ) read the registry value into a property.
Normally I'd have your boostrapper/chainer (EXE) do the UI and then pass the values to the child packages.
I am trying to write a Wix3 install for a visual studio add-in.
I have it just about there, but I need reset the plugin by deleting a registry entry. Specifically any value starting with
HKCU\Software\Microsoft\VisualStudio\8.0\PreloadAddinStateManaged\MyAddinName.Connect;
How to a convince Wix to delete any such entries?
You need to use registry element.
http://wix.sourceforge.net/manual-wix2/wix_xsd_registry.htm
This should solve your issue you're having. There is a great WiX tutorial and registry is discussed in chapter called Beyond Files.
Is your issue the need to do a partial match on the registry value. If not, then you might be looking for the RemoveRegistryValue element (nests under Component). If yes, then I would think you'd probably need to create a custom action to search for the registry value(s) to delete and populate the RemoveRegistry table with what you find. I would think a DTF (Deployment Tools Foundation) custom action would a viable option.