[wix-users] Strange problem with permanent component, folder delete, and upgrade.

Edwin Castro egcastr at gmail.com
Tue Aug 31 10:59:33 PDT 2021


https://docs.microsoft.com/en-us/windows/win32/msi/component-table has two
paragraphs which is lost in the WiX documentation.

> If this bit is set, the installer does not install or reinstall the
> component if a key path file or a key path registry entry for the
> component already exists. The application does register itself as a
> client of the component.
>
> Use this flag only for components that are being registered by the
> Registry table. Do not use this flag for components registered by the
> AppId, Class, Extension, ProgId, MIME, and Verb tables.

I think these are two separate thoughts. The second paragraph is making an
additional comment that applies only to registry resources. The AppId,
Class, Extension, ProgId, MIME, and Verb tables manage registry resources
but the NeverOverwrite bit does not work with them. The NeverOverwrite bit
works only with registry resources managed by the Registry table. This
clarification makes less sense when applied to other types of resources
managed by other tables. But that's just my guess. It could have been
worded a little different to make it clear it was an exception that only
applies to registry resources.

--
Edwin G. Castro

On Tue, Aug 31, 2021 at 10:27 AM Hoover, Jacob via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> I haven't used it myself but...
> https://newbedev.com/copy-if-not-exist-in-wix
>
> https://wixtoolset.org/documentation/manual/v3/xsd/wix/component.html
> doesn't explicitly exclude the file table, though it doesn't include it
> either. (Possible DocBug?)
>
> https://docs.microsoft.com/en-us/windows/win32/msi/component-table The
> SDK docs aren't any better.
>
> Not wix specific, but others seem to imply it works on files:
>
> https://community.flexera.com/t5/InstallShield-Forum/Problem-with-preventing-file-overwrite-on-upgrade/td-p/16826
>
> The other possible option may be to have a reg key as the key path
> (satisfies the docs), and include the file in the same component. I believe
> if a component's keypath is detected, it would skip all companion files in
> the never overwrite scenario. (Test this before taking it as gospel.)
>
> HTH.
>
> From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of
> rmacfadyen--- via wix-users
> Sent: Monday, August 30, 2021 7:20 PM
> To: 'WiX Toolset Users Mailing List' <wix-users at lists.wixtoolset.org>
> Cc: rmacfadyen at rmtrack.com
> Subject: Re: [wix-users] Strange problem with permanent component, folder
> delete, and upgrade.
>
> Jacob,
>
>
>
> The authoring looks like:
>
>
>
> <Component Id="Web.config" DiskId="1"
> Guid="{59F376F4-A90C-4F21-91E5-847A3308E64D}" Permanent="yes">
>
> <File Id="Web.config" Name="Web.config"
> Source="$(var.WebFilesPath)\Web.config" />
>
> </Component>
>
>
>
> The help on "NeverOverwrite" is confusing:
>
>
>
> If this attribute is set to 'yes', the installer does not install or
> reinstall the component if a key path file or a key path registry entry for
> the component already exists. The application does register itself as a
> client of the component. Use this flag only for components that are being
> registered by the Registry table. Do not use this flag for components
> registered by the AppId, Class, Extension, ProgId, MIME, and Verb tables.
> Values of this type will be either "yes" or "no".
>
>
>
> The bit "Use this flag only for. Registry table" and "Do not use . AppId,
> Class [etc]" seem to all be about Windows registry items. Does this flag
> apply to filesystem items?
>
>
>
> BUT. I think you may be on the trail with timestamps. If through the
> copy/pasting/renaming going on maybe the web.config file ended up with the
> same timestamp as the web.config in the installer and therefore the
> installer overwrote it?
>
>
>
> Anyways thanks!!
>
>
>
> Rob
>
>
>
>
>
>
>
>
>
> From: Hoover, Jacob <Jacob.Hoover at greenheck.com<mailto:
> Jacob.Hoover at greenheck.com>>
> Sent: August 25, 2021 4:18 PM
> To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org<mailto:
> wix-users at lists.wixtoolset.org>>
> Cc: rmacfadyen at rmtrack.com<mailto:rmacfadyen at rmtrack.com>
> Subject: RE: [wix-users] Strange problem with permanent component, folder
> delete, and upgrade.
>
>
>
> https://wixtoolset.org/documentation/manual/v3/xsd/wix/component.html<
> https://wixtoolset.org/documentation/manual/v3/xsd/wix/component.html>
>
>
>
> What's the component authoring loo like for that file? Is it in its own
> component, and is it the key path? Did you specify NeverOverwrite?
>
>
>
> Windows installer doesn't monitor the file system, but at the time you
> install the newer MSI, it will compare timestamps (because it's not a
> binary
> w/ version info) to determine if it should lay down a new file.
>
>
>
> From: wix-users <wix-users-bounces at lists.wixtoolset.org
> <mailto:wix-users-bounces at lists.wixtoolset.org<mailto:
> wix-users-bounces at lists.wixtoolset.org%
> 0b%3cmailto:wix-users-bounces at lists.wixtoolset.org>> > On Behalf Of
> rmacfadyen---
> via wix-users
> Sent: Wednesday, August 25, 2021 1:31 PM
> To: wix-users at lists.wixtoolset.org<mailto:wix-users at lists.wixtoolset.org>
> <mailto:wix-users at lists.wixtoolset.org>
> Cc: rmacfadyen at rmtrack.com<mailto:rmacfadyen at rmtrack.com> <mailto:
> rmacfadyen at rmtrack.com>
> Subject: [wix-users] Strange problem with permanent component, folder
> delete, and upgrade.
>
>
>
> Hey all,
>
>
>
> I've encountered a very odd problem with my installer.
>
>
>
> Background: The installer is for a webforms application. It installs a
> program files folder and a folder full of web stuff in
> c:\inetpub\wwwroot\[whatever]. In the [whatever] folder there is a
> component, web.config, that is marked Permanent.
>
>
>
> Situation: Customer originally installed months ago. Runs the installer for
> the new version. Installer detects that it is upgrading and proceeds to do
> it's thing. However. the end result is that the permanent component,
> web.config, is overwritten with the web.config from the installer. This is
> bad because the web.config had been modified and should not have been
> overwritten.
>
>
>
> I could hardly believe it. My testing guy poked and prodded and has been
> successful in reproducing the problem. It appears that if the [whatever]
> folder is deleted and a new [whatever] folder created from a backup copy
> then on upgrading the [whatever]\web.config file will be overwritten.
>
>
>
> So to me it seems like Windows installer is monitoring folders and
> detecting
> that a permanent component folder has been removed? Does that sound like
> something Windows installer does?
>
>
>
> I'm not looking for a solution (other than a "don't do that" advisory).
> Rather I'm looking for any sort of confirmation that Windows Installer is
> indeed the culprit.
>
>
>
> Thanks very much!
>
>
>
> Rob
>
>
>
>
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/<http://www.firegiant.com> <
> http://www.firegiant.com<http://www.firegiant.com>>
>
> NOTE: This email was received from an external source. Please use caution
> when opening links or attachments in the message.
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/<http://www.firegiant.com/>
> NOTE: This email was received from an external source. Please use caution
> when opening links or attachments in the message.
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list