How to create a shortcut in Start->Programs? - wix

I have 3 Installers which install different products. I need to create shortcut for every product like this
Start->Programs->CompanyName->Product 1
->Product 2
->Product 3
How to do this?
Also, I'd like to remove CompanyName folder during uninstall if it is empty. i.e. one from un-installers must remove it if it is empty.

If you are having problems with orphaned shortcuts during the uninstall process of any of the three installers, you might be using the same GUID for the shortcut component or others.
This will cause the installer to disallow the uninstall of the component because it is in use for an other client(application installed) if you look at the logs you will find this message :
Disallowing uninstallation of component: {GUID_ID}
Following the instructions of the Wix Manual in the previous answer, you should not have any trouble creating the shortcuts you want and the behavior you want as well.

Related

How to add an entry for WiX bundle to View Installed Updates menu in control panel?

In general, a WiX bundle adds an entry to Uninstall a program menu in control panel. But, when I installed Visual Studio 2012 Update 4(It seems to be made by using WiX burn, maybe?) it added an entry to View Installed Updates menu in control panel. And I want my WiX update(patch) bundle (for my WiX installer bundle) to do like this. How can I achieve this?
You need to use a RelatedBundle element similar to the following:
<RelatedBundle Id="PUT-GUID-HERE" Action="Patch"/>
Here is the documentation for the allowable values. If Action="Patch" doesn't work, try Action="Addon" (it's been a while since I tried this so I'm not 100% which one will give you the desired results).
Set the attribute "ParentName" of Bundle element to your main product name. For example:
<Bundle ParentName="Your main product name" ...>

WiX 3.7: How to add or update a dialog during uninstall?

I need to add a dialog box that would pop up during complete uninstall (not major upgrade) right after the confirmation ("Are you sure you want to uninstall this product?") dialog. This dialog would prompt the user to answer a question and based on the response, set up a property that would be used in the condition for the RemoveRegistryKey element (i.e. it will remove a registry key only if the user selects an option to delete the key).
I have an idea how to add a dialog to the install sequence (I am using a modified WixUI_InstalLDir sequence to which I added a custom dialog I need during installation), but I can't find any references that would explain how to add a custom dialog to an uninstall sequence. It would be even better if I could modify the uninstall confirmation dialog, so the user would see one dialog instead of two. An the key thing would be to be able to set up a property that could be used in the component condition.
Is this possible? Are there any examples how to do this?
This is against Microsoft design guidelines. Add/Remove programs calls the uninstall with a silent UI argument and the UI sequence is never processed.
The only place you can author UI during an uninstall is a "change" or "maintenance" UI experience where they select Repair | Change | Remove and on Remove do your UI. But you'd have to lock down the Remove buttom and force them through this path. Also realize they could call msiexec /x /qb from the command line.
Bottom line is Microsoft made this choice to make the uninstall process simple and easy for the user. As for removing the registry key, Microsoft would say that you should leave user data on uninstall.

WIX: how to specify different text on exit dialog for repair and remove?

I'm using WIX 3.0
After I install my product, I can run installer again and remove or repair my product.
How to specify different text on exit dialog for repair and remove?
I used "Installed" property, but it has the same value for repair and remove
Do you have any ideas?
Thanks in advance
You'll have to modify the ExitDialog.wxs for this (taking it from WiX sources and including to your project).
Take ProgressDlg.wxs as an example. It contains several pairs of controls, prefixed with 'Text' and 'Title', for instance 'TextInstalling' and 'TitleInstalling'. These pairs of controls are located at the same positions on a dialog, but are conditioned differently. For instance, 'TextRemoving' and 'TitleRemoving' are shown when WixUI_InstallMode='Remove'. Hence, setting WixUI_InstallMode to 'Remove' at the beginning of uninstall shows "Removing files", etc. on a progress dialog.
You can use this technique for other dialogs as well.
Thanks for update, Yan.
My problem was not how to change some text, but how to know what action was performed, remove or repair.
I don't know if this is good solution, but I used custom action and set the all text I need in the properties. The custom action runs with condition $MyInstalledComponent=2, which means that component is removed and is TRUE only on remove, but not on repair

WIX RemoveFolder issue

I am trying to add a feature to my msi based installer, written in wix, which will allow the user to change the name of the folder that keeps the shortcuts within the Windows start menu.
What I did so far is to add a folder there (with a static name), add shortcuts to that folder and remove all of them during uninstall (by using the RemoveFolder tag). Then I added a custom action that will pick up the property that is set from an edit box in UI and set that as the name of the folder, something like:
By running this within the InstallExecuteSequence, the folder is created correctly (with the name the user set for it) and all things are set into place. However, when I uninstall the product, the folder remains with all of it's shortcuts in it (that point to nothing now and they ask for deletion when you click them).
Is there any way to remove a folder that I dynamically changed it's Name attribute during installation, as described above?
Thanks.
You'll need to save the dynamic property to the registry, and read it back during maintenance/repair/uninstall. Windows Installer doesn't "remember" property changes, you need to do it yourself.

WiX Show Dialog Based on Feature to be Installed

Let me be upfront I am novice with WiX. I have a custom dialog CustomSetupTypeDlg.wxs that changes the Typical/Custom/Complete to Desktop/Server/Suite. It sets WixUI_InstallMode to InstallDesktop, InstallServer and InstallSuite appropriately.
I need to have the user browse for an installation folder depending upon what feature is to be installed. If InstallDesktop or InstallSuite is selected the user has to select two different paths for DESKTOPINSTALLDIRECTORY and SERVERINSTALLDIRECTORY. However if the install mode is InstallServer only SERVERINSTALLDIRECTORY choice should be presented.
I am uncertain on how to go about doing this.
You want to have actions in your InstallExecute sequence that display the dialogs you need. Inside the tag you provide a conditional, which, when true, causes the action to actually happen. See this tutorial, specifically section 5.3 for a list of conditionals.
I decided to simplify the project by splitting the desktop and server features into two separate installers.