0

I have an MSI (built with Wix 3) already distributed to customers. Among others, the product has a directory named Reporter that contains two files, A and B. A is the implicit KeyPath, because it is the first entry in the XML.

For security reasons, we need to eliminate file A. So we need to produce an MSI that:

  • does not contain A
  • on upgrade, removes A, but keeps file B (in the same component, in the same directory)
  • on clean install, deploys only B (obviously)

Here is the current WXS file:

<Directory Id="DirX" Name="Reporter">
    <Component Id="componentX" Guid="47A2D991-AC4D-43C0-94F3-02E3D4D2AB3D" DiskId="1" Win64="yes">
        <File Id='A' Name='A' Source='A'/>
        <File Id='B' Name='B' Source='B'/>
    </Component>
</Directory>

<Feature Id="featureX" Title="bla" Level="1">
    <ComponentRef Id="componentX" />
</Feature>

How can one reasonably accomplish this? Remarks:

  • no we cannot keep file A

  • it would be very nice to keep file B in the same directory (Reporter)

  • we usually perform minor upgrades

  • we don't really care about features or components, the product is usually installed as a whole by network admins, without user interference.

I tried everything I could find on the internet:

  • setting file B as KeyPath -> on upgrade, the entire directory Reporter is wiped.
  • creating a new feature, new component, new GUID, with only file B -> on upgrade, the entire directory Reporter is wiped.
  • using RemoveFile for file A -> same result

I am reluctant to create a custom action, but will do if that is the only way.

4
  • I would not expect the directory to get removed in all of those scenarios so verbose log files and a derailed analysis would be necessary. I'm not sure you'll find that is a good fit for StackOverflow. Commented Dec 5, 2024 at 1:19
  • Thank you Rob! I also don't know why, but I do see the feature and the component as absent in the log. In the end, I will just switch over to a new name for the directory, and eat the cost (mainly documentation). Commented Dec 5, 2024 at 10:24
  • In minor upgrades, removing a component or changing keypath won't work. You may refer below comparision: docs.revenera.com/installshield22helplib/helplibrary/… Also, I believe if you delete a file using a custom action, Installer will try to bring it back due to its self healing feature on next minor upgrade/patch but yes your custom action will be executed every time to remove that. Commented Dec 6, 2024 at 14:30
  • Can't you just puncture this component and define a new one? Commented Dec 7, 2024 at 16:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.