Changed or Corrupt msi
Asked Answered
A

1

1

I am new to wix so please bear with me.

I have a working installer for our WPF Windows application. I am now trying to make a prerequisite application install before my application installs. I am able build the installer packaged with the prerequisite for my application but when I run it and click "yes" to if I want to run the install for my prerequisite program it throws and error.

Setup has detected that the file 'C:\Users\DevMachine\AppData\Local\Temp\VSDC06D.tmp\SlimDX\SlimDX Runtime .NET 4.0 x64 (January 2012).msi' has either changed since it was initially published or may be corrupt.

I know the slimDx msi is not corrupt as I can run it from my installer directory just fine. So maybe it thinks it has changed.

I use code signing with a .snk key on all the projects in my application, could this somehow be the cause? I am at a loss on how to fix it if this is the problem.

I copy the redistributable slimDx package to the Setup folder in the msbuild part.

  <ItemGroup>
    <BootstrapperFile Include=".NETFramework,Version=v4.0">
      <ProductName>Microsoft .NET Framework 4.0</ProductName>
    </BootstrapperFile>
    <BootstrapperFile Include="Microsoft.Windows.Installer.4.5">
      <ProductName>Windows Installer 4.5</ProductName>
    </BootstrapperFile>
    <BootstrapperFile Include="ESRIArcEngine$(EsriVersionLinked)Runtime">
      <ProductName>ESRIArcEngine$(EsriVersionLinked)Runtime</ProductName>
    </BootstrapperFile>
    <BootstrapperFile Include="SlimDX.January.2012">
      <ProductName>SlimDX (January 2012)</ProductName>
    </BootstrapperFile>
  </ItemGroup>

So in the end I am trying to make it when I launch my applications Setup.exe it will first run the installer for SlimDx redistributable and then run the install for my application.

Please help, thank you.

Anticyclone answered 19/7, 2018 at 16:38 Comment(2)
In many bootstrapper systems, including the Visual Studio Bootstrapper system you are using, perform integrity checks. So, you can't change the content after building. Is this the problem? It's also not clear what part of your work uses WiX, nor how you're creating the package and product manifests.Eurydice
You might consider a WiX Bootstrapper instead, though it is sufficiently different that it does not consume the same package manifests. (You could translate them manually, yourself.)Eurydice
C
0

Downloaded From The Internet Flag?: Just to make sure, when you check the file properties for SlimDX Runtime .NET 4.0 x64 (January 2012).msi does it have the "downloaded from the Internet" flag set?

I wouldn't think so, but need to verify. I think a test run of the MSI might remove the flag, but it is possible that you have made a copy of the downloaded file without removing the flag and that is the copy that gets included in the package (not the MSI you ran):

Blocked File

  • When downloaded from the internet the file will have an alternate data stream Zone.Identifier with a value of 3 indicating that the file was downloaded from the Internet. This triggers security warnings.
  • In your case just remove the flag manually using the indicated button in the file property dialog and then recompile your setups and launcer.

More on this alternate stream here: How to pass the Windows Defender SmartScreen Protection?


Signing: How do you actually sign your Setup.exe and the various components / prerequisities? Some info about signing: snk vs. code signing certificate (recommended).

And there is the issue where the Setup.exe expects SHA1 hashing and the setup is signed with SHA2 hashing: "File has... changed... or may be corrupt" error when you publish a ClickOnce application in Visual Studio 2010 and the .NET Framework 4.5 with custom prerequisites

Extract: "...this problem occurs because the build process generates the prerequisite file’s digest by using the SHA2 hashing algorithm when it packages the prerequisite file. However, Setup.exe file tries to read the digest by using the SHA1 algorithm. Therefore, a mismatch occurs between the expected digests and the actual digests, and Setup.exe determines the .msi file to be either missing or corrupted."


Security Software: And although I think it irrellevant in this case, maybe verify that any security software isn't blocking your installation (for whatever reason). Try to disable it temporarily, or test on a clean virtual without anything else installed?


Some Links:

Carlie answered 19/7, 2018 at 23:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.