nikhil
nikhil

Reputation: 1736

Wix installer clear file cache

I am facing a weird issue with the Wix installer. It looks like the files are being cached somewhere. I have a VM where I already ran the installer and installed version 3.5.32. At this location, C:/ProgramFiles/PharmSpec/Database, I can UpdateTriggersToSQL2017.sql file getting copied. Now in the installer project, I have removed this file component completely.

After I rebuild the project, I took the installer and tried to install it on the VM. It prompts, Do want to upgrade to v3.5.33 and I say yes. I can see when it is uninstalling 3.5.32 in the process, the PharmSpec folder is clearly being deleted. But after installing the 3.5.33, it created the folder C:/ProgramFiles/PharmSpec/Database. But it is still copying the file UpdateTriggersToSQL2017 from somewhere although I updated the code to remove this file.

Here is the code in version 3.5.32.

<Component Id='DatabaseTemplateFile' Guid='05E6C42C-7798-44DE-926B-979F7E373953' KeyPath='yes' Directory='Database' Win64='yes'>
            <File Id='DBTemplate' Name='PharmSpecDB_Template.mdb' DiskId='1' Source='$(var.ReleaseFolder)\Database\PharmSpecDB_Template.mdb'  />
        </Component>
        <Component Id='DatabaseUpdateScripts' Guid='05CE7EBE-3F9C-4E39-B0C8-CD4880FE782D' KeyPath='yes' Directory='Database' Win64='yes'>
            <File Id='UpdateTriggersToSQL2017' Name='UpdateTriggersToSQL2017.sql' DiskId='1' Source='$(var.ReleaseFolder)\Database\UpdateTriggersToSQL2017.sql'  />
        </Component>

Now in 3.5.33, I removed the component with id DatabaseUpdateScripts completely, built the solution and copied the installer to the VM. I checked the entire solution and no where UpdateTriggersToSQL2017.sql file is being used other than this place. I don't understand how it is still copying that file after upgrading from 3.5.32 to 3.5.33. When doing this update, I can see 3.5.32 being uninstalled, under C:/ProgramFiles I can see the PharmSpec folder being removed when uninstallation.

My problem is, After DatabaseUpdateScripts component, I added a new component to copy an other sql file. But that file is never being copied. But if I do a fresh install, it's working fine. With Upgrade it's not, although it's deleting C:/ProgramFiles/PharmSpec in the installation process and creating the new one. What can I try next?

This is how the PharmSpec MsiPackage is being built.

<PackageGroup Id="PharmSpecMsi">
            <MsiPackage Id="PharmSpecInstaller"
                              SourceFile="$(var.ReleaseFolder)\!(loc.CULTURE)\PharmSpec.msi"
                              DisplayInternalUI="yes"
                              ForcePerMachine="yes"
                              Visible="no"
                InstallCondition="1">
                <MsiProperty Name="UPGRADEPHARM" Value="[MAINUPGRADE]"/>
                <MsiProperty Name="ADD_USER_ADMIN" Value="[UserAdmin]"/>
                <MsiProperty Name="ADD_USER_CALTECH" Value="[TechUser]"/>
                <MsiProperty Name="CUSTOMER" Value="[Customer]"/>
                <MsiProperty Name="SERIALNUMBER" Value="[CdKey]"/>
                <MsiProperty Name="REGSEVERITY" Value="[Severity]"/>
                <MsiProperty Name="DBSERVERNAME" Value="[DBServerName]"/>
                
                <MsiProperty Name="DBDSN" Value="[Dbdsn]"/>
                <MsiProperty Name="DBUID" Value="[Dbuid]"/>
                <MsiProperty Name="DBPWD" Value="[Dbpwd]"/>
                
                <MsiProperty Name="REGDATE" Value="[RegDate]"/>
                <MsiProperty Name="REGLANG" Value="[RegLang]"/>
                <MsiProperty Name="REGSEP" Value="[RegSep]"/>
                <MsiProperty Name="REGTIME" Value="[RegTime]"/>
                
                <MsiProperty Name="DBSELECTED" Value="[INSTALLSQL]"/>
                <MsiProperty Name="NOTCURRENTDB" Value="[SqlInstanceKeyFound64]"/>
                <MsiProperty Name="PHARMSPECSELECTED" Value="[INSTALLPHARM]"/>
                <MsiProperty Name="OLDDBDATAPATH" Value="[OLDDBDATAPATH]"/>
                <MsiProperty Name="INSTALLDIR" Value="[InstallDir]"/>
                <MsiProperty Name="TARGETDIR" Value="[TargetDir]"/>

            </MsiPackage>
        </PackageGroup>

Inside the log file, I can see this.

MSI (s) (18:E4) [13:33:24:534]: Executing op: FileCopy(SourceName=g9h9v-td.sql|UpdateTriggersToSQL2017.sql,SourceCabKey=UpdateTriggersToSQL2017,DestName=UpdateTriggersToSQL2017.sql,Attributes=512,FileSize=168538,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,,,InstallMode=58982400,HashOptions=0,HashPart1=1881770846,HashPart2=2094329563,HashPart3=129652292,HashPart4=467259323,,) MSI (s) (18:E4) [13:33:24:534]: File: C:\Program Files\PharmSpec\Database\UpdateTriggersToSQL2017.sql; To be installed; Won't patch; No existing file MSI (s) (18:E4) [13:33:24:534]: Source for file 'UpdateTriggersToSQL2017' is compressed InstallFiles: File: UpdateTriggersToSQL2017.sql, Directory: C:\Program Files\PharmSpec\Database, Size: 168538

Upvotes: 0

Views: 49

Answers (0)

Related Questions