Ambro
Ambro

Reputation: 73

For a Bootstrapper, the FileCheck element isn't finding the file on 64 bit OS in System32

Hi I am attempting to create a new boostrapper from my WiX generated MSI. I have done one and it worked but now I need to do another where I check the file version on the file.

According to MSDN I should use the FileCheck element.

  <InstallChecks>
    <FileCheck Property="VersionDll" FileName="cimwin32.dll" SearchPath="wbem" SpecialFolder="SystemFolder"/>
  </InstallChecks>

But it doesn't work for me.

The log generated says:

Running check with folder 'C:\Windows\System32\wbem' and file 'cimwin32.dll'
Attempting to find file 'C:\Windows\System32\wbem\cimwin32.dll'
Could not find file 'cimwin32.dll' in folder 'C:\Windows\System32\wbem'
Not setting value for property 'VersionDll'

Even though the listed path in the log file is correct! Very confusing. Any help would be appreciated

I am not sure if this matters or not but I am seeing this on a 64 Windows 7 OS.

UPDATE Based off of help from Micheal and some testing this is a problem with File Redirection on 64 bit machines and the FileCheck tag in the bootstrapper. Regardless of architecture I need to check Windows/System32/wbem/cimwin32.dll

Upvotes: 0

Views: 744

Answers (1)

Ambro
Ambro

Reputation: 73

Alright. I got it. Thanks to Michael Urman for brainstorming with me. It got me thinking about File Redirection on 64bit OSs that I didn't know happened.

For the bootstrapper to get access to a 32 bit directory on a 64 bit OS it needs to use the alias Sysnative for System32

More info

So I just created another file check. One for 32 and one for 64 and I am up and going.

<InstallChecks>
    <FileCheck Property="VersionDll" FileName="cimwin32.dll" SearchPath="System32\wbem" SpecialFolder="WindowsFolder" />
    <FileCheck Property="VersionDll64bit" FileName="cimwin32.dll" SearchPath="Sysnative\wbem" SpecialFolder="WindowsFolder" />
</InstallChecks>

Upvotes: 1

Related Questions