How to find the Hash for RemotePayloads of WIX projects

Problem:

I need to determine the Hash value of the RemotePayload element for my WIX Bootstrapper.

<PackageGroup Id="SQL_SERVER_2012_EXPRESS">
   <ExePackage Id="SQLSERVER"
      DownloadUrl="$(var.SqlDownloadUrl)"
      Name="SQLEXPRWT_x64_ENU.exe"
      Compressed="no"
      Permanent="yes"
      Vital="yes"
      DetectCondition="SqlInstanceFound"
      InstallCommand="$(var.SqlInstallCommand)">
   <RemotePayload Description="Microsoft SQL Server 2012 Express Edition With Tools"
      ProductName="Microsoft SQL Server 2012 Express Edition With Tools"
      Version="11.0.2100.60"
      Size="702474328"
      Hash="5669d84bf3ae66cf715f956b17d49140dd1b691d" />
   </ExePackage>
</PackageGroup>

Solution:

Download and run the Microsoft File Checksum Integrity Verifier from https://www.microsoft.com/en-us/download/details.aspx?id=11533

Explanation:

I needed to change the version of SQL Server Express that I downloaded with my application. For the bootstrapper to work it must be able to verify the hash of the file it downloads.  Therefore, you have to store the hash in the RemotePayload element of your WSX file in your bootstrapper.  To find this value download a copy of the file for which you need the hash.  Then download and install the Microsoft File Checksum Integrity Verifier. Once you extract the file you will have a file named fciv.exe. Fciv is a command line utility that computes and verifies hashes of files.  To determine the hash of a file simply run the following command

fciv -sha1 {filename}

Replace {filename} with the full path to the file for which you need the hash.  The output will look something like this.

fciv -sha1 SQLEXPRWT_x64_ENU.exe
//
// File Checksum Integrity Verifier version 2.05.
//
5669d84bf3ae66cf715f956b17d49140dd1b691d sqlexprwt_x64_enu.exe

Now you can copy and paste the hash (5669d84bf3ae66cf715f956b17d49140dd1b691d) into your RemotePayload element's Hash attribute.

Add comment

Loading