Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.1k views
in Technique[技术] by (71.8m points)

visual studio - Changed or Corrupt msi

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:UsersDevMachineAppDataLocalTempVSDC06D.tmpSlimDXSlimDX 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...