我可以在安装结束时使用 WiX 启动我的应用程序,但我无法让我的应用程序在前台运行 [英] I can use WiX to launch my app at the end of install, but I can't get my app to run in the foreground

查看:27
本文介绍了我可以在安装结束时使用 WiX 启动我的应用程序,但我无法让我的应用程序在前台运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 WiX,我的安装完成后将有选择地启动我已安装的程序文件之一.但是,当我的应用程序由安装程序启动时,它通常不会显示在用户桌面的前台.它隐藏在其他窗口下,因此用户无法立即清楚该程序正在运行.

Using WiX, my install will optionally launch one of my installed program files when it completes. However, when my application is launched by the installer, it is usually not displayed in the foreground of the user's desktop. It's buried under other windows, so it's not immediately clear to the user that the program is running.

我试过让我的程序在运行时强行进入顶部,但这并没有改变它在安装程序启动时的运行方式.

I've tried having my program forcibly bring itself to the top when it runs, but that hasn't changed the way it runs when started by the installer.

推荐答案

为此找到了解决方案.我将 CustomAction 定义更改为使用FileKey"而不是BinaryKey".我不确定,但我猜是通过 shell exec 命令启动应用程序导致我的应用程序没有显示在前台.

Found a solution for this. I changed my CustomAction definition to use 'FileKey' rather than 'BinaryKey'. I'm not sure, but I'm guessing that launching the application through a shell exec command was responsible for my application not being displayed in the foreground.

<!-- old code -->
<CustomAction Id="LaunchApp" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />

<!-- new code -->
<CustomAction Id="LaunchApp" FileKey="FooBarEXE" ExeCommand="" Return="asyncNoWait" Impersonate="yes" />

这篇关于我可以在安装结束时使用 WiX 启动我的应用程序,但我无法让我的应用程序在前台运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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