WiX静默安装无法启动内置的.EXE:WiX v3 [英] WiX silent install unable to launch built in .EXE: WiX v3

查看:95
本文介绍了WiX静默安装无法启动内置的.EXE:WiX v3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这似乎是重复的,但是我已经尝试了几乎所有在线方法,包括以下链接:

I know this might seem like a duplicate, but I have tried almost anything online including the following links below:

使用双击时,安装成功完成,并且

When using double click, the installation completes successfully and it launches my EXE which is a WPF UI.

问题是,如果在命令行中运行,WiX安装程序将安装但我的WPF无法启动。没有驱动程序更新。 请注意,我有一些自定义开关,例如/?。在我的WPF中/ q / forerestart / noreboot。

The problem is that if run in the command line, the WiX installer installs but my WPF doesn't launch. There is no driver update. Note that I have custom switches such as /? /q /forerestart /noreboot in my WPF.

是否在没有UI的情况下启动?
http://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/run_program_after_install.html

以下是我的代码

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"><?define INF_INSTALLER_TargetDir=$(var.INF_INSTALLER.TargetDir)?>
    <Product Id="guid here" Name="INF_INSTALLER" Language="1033" Version="1.1.1.3" Manufacturer="Intel Corporation" UpgradeCode="guid here">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"  InstallPrivileges="elevated" />

        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
        <MediaTemplate EmbedCab="yes" />

    <!--User Agrrement-->
    <WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)EULAsingleuselicense.rtf" />
    <WixVariable Id="WixUIBannerBmp" Value="images\Banner.jpg" />
    <WixVariable Id="WixUIDialogBmp" Value="images\Background.png" />


    <!--Chosing the UI version-->
    <!-- Step 2: Add UI to your installer / Step 4: Trigger the custom action -->
    <!-- UI to installer -->
    <UI>
      <UIRef Id="WixUI_Minimal" />
      <!-- Launch the applicaiton -->
      <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">NOT Installed</Publish>
    </UI>
    <!--<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch INF INSTALLER" /> -->

    <!-- Step 3: Include the custom action -->
    <Property Id="WixShellExecTarget" Value="[#INF_INSTALLER.exe]" />
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
    <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />



    <Feature Id="ProductFeature" Title="INF INSTALLER" Level="1">
      <ComponentGroupRef Id="ProductComponents" />
      <ComponentRef Id="ApplicationShortcut" />
      <!--<ComponentRef Id="ApplicationShortcutDesktop" /> -->
    </Feature>
  </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="TempFolder">
        <Directory Id="ManufacturerFolder" Name="INF_INSTALLER">
          <Directory Id="INSTALLFOLDER" Name="INF_INSTALLER" />
        </Directory>
        <Directory Id="ProgramMenuFolder">
          <Directory Id="ApplicationProgramsFolder" Name="!(bind.property.ProductName)" />
        </Directory>
        <!--<Directory Id="DesktopFolder" Name="Desktop" />-->
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <DirectoryRef Id="ApplicationProgramsFolder">
      <Component Id="ApplicationShortcut" Guid="guid here">
        <Shortcut Id="ApplicationStartMenuShortcut" Name="!(bind.property.ProductName)" Description="INF INSTALLER" Target="[INSTALLFOLDER]INF_INSTALLER.exe" WorkingDirectory="INSTALLFOLDER" />
        <RemoveFolder Id="RemoveApplicationProgramsFolder" Directory="ApplicationProgramsFolder" On="uninstall" />
        <RegistryValue Root="HKCU" Key="Software\INF_INSTALLER" Name="installed" Type="integer" Value="1" KeyPath="yes" />
      </Component>
    </DirectoryRef>
    <!--<DirectoryRef Id="DesktopFolder">
      <Component Id="ApplicationShortcutDesktop" Guid="guid here">
        <Shortcut Id="ApplicationDesktopShortcut" Name="!(bind.property.ProductName)" Description="INF INSTALLER" Target="[INSTALLFOLDER]INF_INSTALLER.exe" WorkingDirectory="INSTALLFOLDER" />
        <RemoveFolder Id="RemoveDesktopFolder" Directory="DesktopFolder" On="uninstall" />
        <RegistryValue Root="HKCU" Key="Software\INF_INSTALLER" Name="InstalledCompleted" Type="integer" Value="1" KeyPath="yes" />
      </Component>
    </DirectoryRef>-->
  </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
            <Component Id="windowscert.cer" Guid="guid here">
              <File Id="windowscert.cer" Name="windowscert.cer" Source="$(var.INF_INSTALLER_TargetDir)windowscert.cer" />
            </Component>
            <Component Id="myinf.inf" Guid="guid here">
              <File Id="myinf.inf" Name="myinf.inf" Source="$(var.INF_INSTALLER_TargetDir)myinf.inf" />
            </Component>
            <Component Id="INF_INSTALLER.exe" Guid="guid here">
              <File Id="INF_INSTALLER.exe" Name="INF_INSTALLER.exe" Source="$(var.INF_INSTALLER_TargetDir)INF_INSTALLER.exe" />
            </Component>
            <Component Id="INF_INSTALLER.exe.config" Guid="guid here">
              <File Id="INF_INSTALLER.exe.config" Name="INF_INSTALLER.exe.config" Source="$(var.INF_INSTALLER_TargetDir)INF_INSTALLER.exe.config" />
            </Component>
            <Component Id="INF_INSTALLER.pdb" Guid="guid here">
              <File Id="INF_INSTALLER.pdb" Name="INF_INSTALLER.pdb" Source="$(var.INF_INSTALLER_TargetDir)INF_INSTALLER.pdb" />
            </Component>
        </ComponentGroup>
    </Fragment>

  <Fragment>

    <CustomAction Id="LaunchFile" FileKey="INF_INSTALLER.exe" ExeCommand="/quiet" Return="asyncNoWait" />

    <Property Id="WixSilentExecCmdLine" Value="/silent" Hidden="yes"/>
    <CustomAction Id="SilentExecExample" BinaryKey="WixCA" DllEntry="WixSilentExec" Execute="immediate" Return="check"/>

    <InstallExecuteSequence>

      <Custom Action="LaunchFile" After="InstallFinalize">NOT  Installed</Custom>
      <Custom Action="SilentExecExample" After="TheActionYouWantItAfter"/>
      <RemoveExistingProducts After="InstallFinalize" />

    </InstallExecuteSequence>


  </Fragment>
</Wix>


推荐答案

错误的配置 :无论静默模式还是交互式模式,此行都将永远不会运行:

Faulty Configuration: This line would never run - regardless of silent or interactive mode:

<Custom Action="SilentExecExample" After="TheActionYouWantItAfter"/>

After属性必须指定有效的 StandardAction CustomAction 名称。

The After attribute must specify a valid StandardAction or CustomAction name.

静默模式失败 :以下行将在静默模式下失败,因为您运行了它在 InstallFinalize 之后。在这种情况下,它将不会随海拔高度运行(除非您从升高的 cmd.exe 提示符下启动安装程序),因此无法完成安装(安装程序仅在两次运行之间升高运行) InstallExecuteSequence 中的 InstallInitialize InstallFinalize ):

Silent Mode Failure: The line below will fail in silent mode because you run it after InstallFinalize. In this case it will not run with elevation (unless you launch the setup from an elevated cmd.exe prompt) and the setup can therefore not complete (the setup runs elevated only between InstallInitialize and InstallFinalize in the InstallExecuteSequence):

<Custom Action="LaunchFile" After="InstallFinalize">NOT  Installed</Custom>

还有一些您应该知道的事情。请阅读以下内容。

There are a few more things you should know. Please read the below.

Windows Update发行版 :从记录来看,Microsoft似乎希望将来通过Windows Update或至少通过独立的软件包分发驱动程序,而无需安装程序。

Windows Update Distribution: For the record, it appears Microsoft wants driver distribution to happen via Windows Update in the future, or at least via a standalone package without the need for an installer.

从Windows开始10,版本1607:

As of Windows 10, Version 1607:


  • DIFx工具 不再包含在 WDK (Windows驱动程序工具包)中。

    • DIFx tools are no longer included in the WDK (Windows Driver Kit).
      • Some important tidbits if you choose to use DIFx anyway.

      • 硬件认证

      • 协作驱动程序开发

      • 通过Windows Update分发驱动程序

      • Hardware certification
      • Collaborative driver development
      • Driver distribution through Windows Update

      驱动程序元素 :WiX当前具有 驱动程序元素 用于驱动程序安装。据我所知,它在后台使用了DIFx框架。 在github上找到的一个小而实际的示例。 com 。我从未使用过此功能。 FireGiant的WiX扩展包具有更高级的驱动程序安装支持。

      Driver Element: WiX currently has the Driver Element for driver installation. It uses the DIFx framework under the hood - as far as I know. A small, practical example found on github.com. I have never used this feature. FireGiant's WiX Expansion Pack features more advanced driver installation support. Never tried by me.

      DPInst.exe :我对 <$ c $不熟悉c> INF_INSTALLER.exe -这是您创建的专有组件吗?也可以使用 <$ DIFx框架中的c $ c> DPInst.exe 工具。可以通过MSI内部的自定义操作来调用它,也可以直接从Burn(WiX Bundle-换句话说,不属于MSI)中运行它。 在github.com上找到了一个相当简短的例子

      DPInst.exe: I am not familiar with INF_INSTALLER.exe - is that a proprietary component you have created? It is also possible to install signed drivers using the DPInst.exe tool from the DIFx framework. It can be called via custom actions inside an MSI or it can probably be run directly from Burn (WiX Bundle - in other words not part of an MSI). A fairly short example found on github.com.

      小提示 :搜索 DPInst.exe http://schemas.microsoft.com/wix/2006/wi 将产生大量匹配。根据我的经验,您可以使用此github搜索技术查找有关任何内容的帮助。不过请务必谨慎,我会利用节省的时间进行额外的测试。只是我的2美分。

      A Little Tip: Searching for "DPInst.exe http://schemas.microsoft.com/wix/2006/wi" will yield heaps of hits. You can use this github search technique to find help with pretty much anything in my experience. Be critical though, and I would use the time saved to do extra testing. Just my 2 cents.

      某些链接

      Some Links:

      • Roadmap for Device and Driver Installation
      • Distributing a driver package
      • Can't seem to get Wix to install driver
      • How do I install drivers using Burn and DPInst after MSI installation?
      • https://github.com/trondr/DpInstExitCode2ExitCode
      • Driver installation github

      这篇关于WiX静默安装无法启动内置的.EXE:WiX v3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆