本文介绍了安装后启动,没有用户界面吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在没有UI(或处于安静模式)的安装后,如何启动我的应用程序?谢谢!

How do I launch my application after install with no UI (or in quiet mode)? Thanks!

我有一个带有UI的安装程序,可以选择在安装后运行.现在,我希望我的应用程序通过以安静模式下载并运行新版本的安装程序来进行自我更新,但是更新完成后,它将不会再次启动.

I had a installer with UI which has an option to run after install. Now I want my application to updates itself by downloading and running the new version of installer in quiet mode, but after updating done, it won't launch again.

推荐答案

来自排序自定义操作:

所以我想您的自定义操作是按UI顺序安排的,而不是按InstallExecuteSequence安排的.尝试像这样在InstallExecuteSequence中安排您的自定义操作:

So I guess your custom action is scheduled in a UI sequence, not in InstallExecuteSequence. Try scheduling your custom action in the InstallExecuteSequence like this:

  <InstallExecuteSequence>
     <Custom Action='LaunchApplication' After='InstallFiles'/>
  </InstallExecuteSequence>

其中"LaunchApplication"应替换为CustomAction元素的Id.

where "LaunchApplication" should be replaced by the Id of your CustomAction element.

编辑:我查看了说明,但我看不到以任何顺序启动正在启动的应用程序的自定义操作.它仅是通过UI操作(单击完成"按钮)触发的.这解释了为什么在静默安装期间永远不会执行它.

edit: I looked at the instructions that you followed, and I don't see the custom action for launching the application being scheduled in any sequence. It is only triggered from a UI action (clicking the Finish button). This explains why it is never executed during a silent install.

编辑:完整示例(这有点草率,因为它还会尝试执行有关卸载,修复等的自定义操作,但是由于某种原因,我无法获得未安装"条件工作)

edit: full sample (it's a bit sloppy as it also tries to execute the custom action on uninstall, repair etc. but for some reason I couldn't get the "NOT Installed" condition to work)

<?xml version='1.0' encoding='utf-8'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
   <Product
         Name='ProductName'
         Id='*'
         Language='1033'
         Version='0.0.1'
         Manufacturer='ManufacturerName' >
      <Package
            Keywords='Installer'
            Description='Launch application demo'
            Manufacturer='ManufactererName'
            InstallerVersion='100'
            Languages='1033'
            Compressed='yes'
            SummaryCodepage='1252'/>

      <Media Id='1' Cabinet='test.cab' EmbedCab='yes'/>

      <Directory Id='TARGETDIR' Name="SourceDir">
         <Directory Id='ProgramFilesFolder'>
            <Directory Id='TestFolder' Name='Test' >
               <Component Id="ExeComponent" Guid="*">
                  <File Id="ExeFile" Source="c:\windows\notepad.exe" />
               </Component>
            </Directory>
         </Directory>
      </Directory>

      <Feature Id='Complete'
            Display='expand'
            Level='1'
            Title='Test'
            Description='Test'>
         <ComponentRef Id="ExeComponent" />
      </Feature>

      <InstallExecuteSequence>
         <Custom Action='LaunchInstalledExe' After='InstallFinalize'/>
      </InstallExecuteSequence>

      <CustomAction Id="LaunchInstalledExe"
         FileKey="ExeFile"
         ExeCommand=""
         Execute="immediate"
         Impersonate="yes"
         Return="asyncNoWait" />

   </Product>
</Wix>

这篇关于安装后启动,没有用户界面吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 17:34