Wix Bootstrap 防止使用临时目录

Wix Bootstrap prevent temp directory use

我已经使用 Bootstrapper 项目为 Wix v3 项目类型构建了 "HelloWord" 安装程序。

我的bundle.wxs是

    <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
     xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">

  <Bundle Name="Bundle_name"
          Version="1.0.0.0"
          Manufacturer="Producter"
          UpgradeCode="C82A383C-751A-43B8-90BF-A250F7BC2863"
          IconSourceFile="..\WpfForms\Assets\my_lovely.ico"  >

    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
      <Payload SourceFile="..\WpfForms\BootstrapperCore.config"/>
      <Payload SourceFile="..\WpfForms\bin\Debug\WpfForms.dll"/>
      <Payload SourceFile="..\WpfForms\bin\Debug\GalaSoft.MvvmLight.dll"/>
      <!--<Payload SourceFile="..\WpfForms\bin\Debug\Microsoft.Practices.ServiceLocation.dll"/>
      <Payload SourceFile="..\WpfForms\bin\Debug\Microsoft.WindowsAPICodePack.dll"/>
      <Payload SourceFile="..\WpfForms\bin\Debug\Microsoft.WindowsAPICodePack.Shell.dll"/>-->

      <Payload SourceFile="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.ServiceProcess.dll"/>
      <Payload SourceFile="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Configuration.Install.dll"/>
      <Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.11\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
    </BootstrapperApplicationRef>

    <Chain>
      <PackageGroupRef Id='Netfx4Full'/>
      <MsiPackage SourceFile="..\WixSetupProject\bin\Debug\WixSetupProject.msi" Id="InstallationPackageId" Cache="yes" Visible="no"/>
    </Chain>
  </Bundle>

  <Fragment>
    <WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />

    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4FullVersion" />
    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4x64FullVersion" Win64="yes" />

    <PackageGroup Id="Netfx4Full">
      <ExePackage Id="Netfx4Full" Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes" Name="DotNet_4"
                  SourceFile="../WixBootstrapper/DotNet/NDP462-KB3151800-x86-x64-AllOS-ENU.exe"
                  DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=164193"
                  DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
    </PackageGroup>
  </Fragment>
</Wix>

我的问题是工作站的防病毒配置为阻止来自 temp 目录的任何 activity,并且构建的 installer.exe 将自身复制为 "C:\Windows\Temp{74EA5B2A-DA46-4B3F-A8E9-4FCEC4B4523C}.cr\WixBootstrapper.exe" 和 运行 默认情况下。所以它被防病毒锁定,所以安装在开始时就结束了。

有人知道如何防止 WiX 组件在临时目录中创建缓存或其他东西,并设置为 运行 当前文件夹中的任何嵌套可执行文件和它们自己,而不是 temp

After checking Windows's group policy settings this turned out to be an anti-virus blocking problem.


Group Policy?:日志中是否包含这样的内容:

Error 0x800704ec: Failed to launch clean room process: "C:\WINDOWS\Temp\{AB10C981-0D7D-4AA6-857F-CC37696DB4BE}\.cr\Bundle.exe" -burn.clean.room="C:\Test\Bundle.exe" -burn.filehandle.attached=652 -burn.filehandle.self=656 -log "C:\Test\bundle.log"
Error 0x800704ec: Failed to run untrusted mode.

还是说别的什么?有一个组策略可能会导致类似的问题。 See WiX issue 5856.

Anti-Virus Grace Period?:如果您是管理员,应该有可能从您的反病毒我会想。这样您就可以执行测试了。我会先给您自己的支持台打个电话,如果不成功,再按 Kaspersky user forums。也许您有优先支持的卡巴斯基支持协议?

误报:我还坚持要将二进制文件上传到 virustotal.com to test for false positives. That you should do no matter what. Antivirus Whitelisting Pains Bogdan Mitrache .

False positives can actually be worse than actual malware at times (so far as the malware isn't devastating) because you cannot just tell the user to rebuild their machine(s). Instead you actually have to fix the problem for them in a general sense. Not only does the user have a problem to fix, you have one as the vendor as well. How do you whitelist your product with 60+ anti-malware suites? You try virustotal.com first I think (not affiliated) - to check if you actually have such a problem.