[wix-users] Copy full installer to local drive during install

Benny Bürger buerger at simba.de
Mon May 4 08:00:36 PDT 2020


Hi,

I have a similar setup.
The msi installfile is copied to a specific location if the installation is on the databaseserver:

In product.wxs:

    <Feature Id="UpdateFile" Level="0" >
      <ComponentGroupRef Id="CopyMsiFileToSBCache"/>
        <Condition Level="1">
          <![CDATA[INSTALLDATABASE~="true" AND NOT PATCH AND (REINSTALLMODE="" OR REINSTALLMODE><"v" OR REINSTALLMODE="cmuse")]]></Condition>
    </Feature>

MsiUpdateFile.wxs:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <?include $(var.ProjectDir)config.wxi?>
  <Fragment>
    <DirectoryRef Id="INSTALLFOLDER" />
  </Fragment>
  <Fragment>
    <ComponentGroup Id="CopyMsiFileToSBCache">
      <Component Id="MsiFile" Guid="2871376D-EB77-4D50-9A32-E1A54466A062" Directory="INSTALLFOLDER">
        <RemoveFile Id="MsiFileRemove" Property="SBCACHECLIENTUPDATELOCATION" Name="HybridShell.Setup.msi" On="both"/>
        <RemoveFile Id="VersionFileRemove" Property="SBCACHECLIENTUPDATELOCATION" Name="ClientUpdateVersion.xml" On="both"/>
        <RemoveFolder Id="RemoveFolderUpdateClient" Property="SBCACHECLIENTUPDATELOCATION" On="uninstall"/>
        <CopyFile Id="MsiFileCopy" SourceProperty="SOURCEMSIFILE" DestinationProperty="SBCACHECLIENTUPDATELOCATION" />
        <CreateFolder/>
      </Component>
    </ComponentGroup>
  </Fragment>
</Wix>

Using the ClientUpdateVersion.xml file I can easily check whether the client needs an update without querying the database (useful in some occasions)

I hope this helps.

Benny



More information about the wix-users mailing list