安装后启动,没有 UI? [英] Launch after install, with no UI?

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

问题描述

如何在安装后没有 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.

推荐答案

来自 排序自定义操作:

与标准动作一样,计划的自定义操作InstallUISequence 或AdminUISequence 仅在内部用户界面设置为满级.

As in the case of standard actions, custom actions that are scheduled in the InstallUISequence or AdminUISequence run only if the internal user interface is set to the full level.

所以我猜你的自定义操作是按 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.

编辑:我查看了 instructions 您遵循的,我没有看到以任何顺序安排启动应用程序的自定义操作.它仅由 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
otepad.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>

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

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