OpenFileDialog 在 Win7 上失败
我的安装程序需要打开一个文件浏览对话框。由于 WIX 没有提供文件浏览对话框,因此我编写了一个 C# dll,其中包含一个在由自定义操作调用时调用标准 OpenFileDialog 的方法。然而,虽然这在 Win2003 中运行良好,但自定义操作在 Windows 7 上运行时只是挂起。它似乎一直到 ShowDialog() 调用然后停止。作为测试,我编写了一个单独的 Windows 窗体应用程序,其中包含一个对话框和按钮来调用 OpenFileDialog,正如预期的那样,效果很好。我只是无法让 OpenFileDialog 从我的 msi 中出现!
我怀疑这可能是一个安全问题,所以我从以管理员身份打开的 msiexec 运行安装程序,但没有区别!
有谁知道如何解决这个问题?
非常感谢。
My installer needs to open a file browse dialog. As there is no file browse dialog provided by WIX I have written a C# dll containing a method to invoke the standard OpenFileDialog when called by a Custom Action. However while this works fine in Win2003 the Custom Action just hangs when run on Windows 7. It seems to get as far as the ShowDialog() call then stop. As a test I have written a separate Windows Forms app with a single dialog and button to invoke the OpenFileDialog and, as expected, that works fine. I just can't get the OpenFileDialog to appear from within my msi!
I suspect it may be a security thing so I ran the installer from msiexec opened as Administrator but with no difference!
Does anyone have any ideas how to fix this?
Many Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当我尝试执行此操作时,我发现它在其他 MSI 窗口后面弹出。在我弄清楚这一点之前,它看起来就像是一个挂起。
出于这个原因以及一大堆其他原因,我最终编写了一个定制的安装机制并放弃了 MSI。最终对用户及其系统更加友好。
When I attempted this I found it was popping up behind the other MSI windows. Until I figured this out, it looked just like a hang.
For this and a whole heap of other reasons, I ended up writing a bespoke install mechanism and ditching MSI. Much friendlier on the user and their system in the end.