简体   繁体   中英

WIX Installer - prevent install and register of dll if it is already installed and/or registered

I have an installer that consists of lots of files in individual components that installs correctly.

I have now been told that one of these files needs to be registered only if it doesn't already exist and hasn't yet been registered.

I have use heat to generate the appropriate entries for the file;

<Component Id="AXSListenerdll" Guid="b1f80295-8806-4f6a-bf28-0ee35540317c">
              <File Name="AXSListener.dll" KeyPath="yes" Vital="yes">
                <TypeLib Id="{CE807033-6BEE-44D3-A86A-E9BC1D0716A4}" Description="AXSListenerLib" Language="0" MajorVersion="1" MinorVersion="0">
                  <Class Id="{C66BC66D-546E-4E74-A69F-BA97E4117E6B}" Context="InprocServer32" Description="IImplementedAlarmTypesCollection Class" ThreadingModel="both" Programmable="yes">
                    <ProgId Id="SymEvents.IImplementedAlarmTypesCollection.1" Description="IImplementedAlarmTypesCollection Class">
                      <ProgId Id="SymEvents.IImplementedAlarmTypesCollection" Description="IImplementedAlarmTypesCollection Class" />
                    </ProgId>
                  </Class>
                </TypeLib>
              </File>
            </Component>

My question is, how do I prevent this particular file from being installed if it is already there and registered.

I just having a bit of a mental block about this.

I'm sure the answer must be obvious, I just can't see it!

Thanks in advance.

By default, Windows Installer uses file versioning to decide if this file needs to be installed/reinstalled. As an example, if the MSI has version 1.0.0.0 to install and 1.0.0.0 is already there then it won't reinstall. When it installs, it will reapply the registry entries for the DLL.

The requirement provided to you is a little weird / wrong. It could be read as if the MSI has file 2.0 but 1.0 is already present, don't install. That's not a good design and MSI doesn't operate that way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM