views:

26

answers:

1

This seems like a fairly straightforward question but I've been unable to find an answer:

Let's say I have two products: A and B created by MyCompany. Both products A and B will have shortcuts in the start menu in this fashion:

MyCompanyFolder->Product_A_Folder->A.exe and MyCompanyFolder->Product_B_Folder->B.exe

If I uninstall "Product B" I don't want it to delete the "MyCompanyFolder" unless it is the last product left. I would just check to see if "Product A" exists or not (through a component or registry search) but it is impossible for me to know at this time how many future applications will be added to this folder.

The only solution I came up with was to create a registry key that simply contains an integer denoting the number of apps installed - but that seems a bit inelegant (not to mention I don't know how to increment registry values in Wix either).

Any thoughts? Thanks.

+2  A: 

You must be doing something unusual in your install because this should all work automatically. You shouldn't need to have any components or createfolder elements for your start menu directory. Just create a reference like below and use the ApplicationProgramsFolder Id in your ShortCut element across your installs and MSI will automatically handle the case of last one off removes the folder.

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramMenuFolder">
    <Directory Id="ApplicationProgramsFolder" Name="IsWiX" />
  </Directory>
</Directory>
Christopher Painter
Yes I just realized that this is the default behavior. I didn't find anywhere that specified this though. Thanks!
lifeR00t