0

I have products - ProductA and ProductB - that I install using the installer created with WIX toolkit. If I install ProductA it updated the environment path to add C:\MyEnvPath. ProductB will also add C:\MyEnvPath if it is not already present.

ProductA is installed at C:\MyEnvPath\ProductAPath ProductB is installed at C:\MyEnvPath\ProductBPath

When I uninstall ProductA, it must check if C:\MyEnvPath has any other folder except C:\MyEnvPath\ProductAPath. If there is a folder (C:\MyEnvPath\ProductBPath), then do not remove the path.

If there is no other folder except C:\MyEnvPath\ProductAPath, then remove the path from environment variable.

How do I modify the uninstaller setting to do that?

Updating the 'Permanent' attribute to 'yes' in the line below will never remove the environment path which is not what is required. I require that 'Permanent' should be no but removal of the path should be conditional.

Vijay
  • 167
  • 6

1 Answers1

0

I believe you could accomplish what you want to do with a combination of DirectorySearch and making use of the Transitive component element.

As an example, note this is more pseudo-code than anything

<Property Id='IS_PRODUCTB_INSTALLED' Secure='yes'>
  <DirectorySearch Id='IsInstalled' Path='C:\MyEnvPath\ProductBPath' />
</Property>

...

<Directory Id="ProductBFolder" Name="ProductBPath">
  <Component Id="ProductBComponent" Guid="{YOUR-GUID-HERE}" Transitive="Yes"><!CDATA[(NOT UPGRADINGPRODUCTCODE) AND (NOT IS_PRODUCTB_INSTALLED)]]>
     <CreateFolder />
  </Component>
</Directory>

Again that's more of a pseudo-code answer as I've not tested it and it's cobbled together from some snippets on my machine but I think it would get you where you want to go.

Community
  • 1
  • 1
Rick Bowerman
  • 1,866
  • 12
  • 12