使用 NET Compact Framework 从 CAB 安装后重新启动
我们需要在安装 Windows CE 设备后重新启动/en.wikipedia.org/wiki/Cabinet_%28file_format%29" rel="nofollow noreferrer">CAB 文件。我们基本上在 Visual Studio 2008 中创建了一个智能设备 CAB 项目。我们使用 C# 进行开发。
我在 Stack Overflow 问题中看到了修改 MSI 属性的示例如何在 .NET 安装中提示用户重新启动?。所以我打算尝试在 Orca.exe。但 CAB 文件似乎无法在 Orca.exe 中打开,因此我认为它不是智能设备上 CAB 文件的选项。
我还看到了一个在 C++ 中实现这一点的示例,Stack Overflow 问题安装 .CAB WM 时重新启动,但我们宁愿避免使用 C++。智能设备也没有 C# 自定义操作选项。
在 C# 中是否有设置或某种方法可以做到这一点?
We need to reboot a Windows CE device after installation of our CAB file. We basically created a smart device CAB project in Visual Studio 2008. We are developing in C#.
I have seen examples of modifying MSI properties in Stack Overflow question How can I prompt the user to reboot in a .NET installation?. So I was going to try setting this MSI property in Orca.exe. But CAB files don't seem to open in Orca.exe, so I assume it isn't an option for CAB files on smart devices.
I also see an example of making it happen in C++, Stack Overflow question Reboot on installation of .CAB WM, but we would rather avoid using C++. There isn't an option for C# custom actions for smart devices either.
Is there a setting or some way for us to do this in C#?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 C# 中对此无能为力,不。 CAB 文件由 wceload 解压和解析。如果您需要执行任何自定义操作,则必须使用自定义安装 DLL,它必须用 C 编写。也就是说,你所追求的并不复杂,所以用 C 编写它确实不成问题。您只需添加软重置调用到
Install_Exit
(可能是在检查没有失败之后)。There's nothing you can do in C# for this, no. The CAB file is unpacked and parsed by wceload. If you need to do any custom actions, you must use a custom setup DLL, which must be written in C. That said, what you're after is not at all complex, so writing it in C really shouldn't be a problem. You simply need to add the soft reset call to
Install_Exit
(probably after checking that nothing failed).