如何提示用户在.NET安装中重新启动? [英] How can I prompt the user to reboot in a .NET installation?
问题描述
我正在使用Visual Studio 2008编写安装,并且对安装是全新的.我创建了一个安装程序,并使用C#程序集成功编写了一些自定义操作.一个操作设置了RunOnce注册表值,现在我需要在安装完成时提示用户重新启动,但是我不知道如何.我已经阅读了Installer类的文档,但是找不到任何有关重启的信息.
I'm using Visual Studio 2008 to write an installation, and I'm a completely new to installations. I've created an installation and successfully written some custom actions using a C# assembly. One action sets a RunOnce registry value, and now I need to prompt the user to reboot when the installation finishes, but I have no idea how. I've read the Installer class documentation, but I can't find any mention of rebooting.
我假设我需要以某种方式开始能够调用MsiSetProperty并设置REBOOT属性,但是我不知道如何通过
I'm assuming I need to somehow get down to being able to call MsiSetProperty and set a REBOOT property, but I don't know how to do that from my .NET installer project.
推荐答案
谢谢.我最终使用构建后事件通过以下命令运行批处理文件.最困难的部分是跟踪WiRunSQL.vbs,它位于下载用于Windows Installer开发人员的Windows SDK组件".
Thanks. I ended up using a post-build event to run a batch file with the following command. The hard part was tracking down WiRunSQL.vbs, which was in the "Windows SDK Components for Windows Installer Developers" download.
cscript "C:\Program Files\Microsoft SDKs\Windows\v6.0\Samples\SysMgmt\MSI\scripts\WiRunSQl.vbs" my.msi "INSERT INTO `Property`(`Property`, `Value`) VALUES ('REBOOT', 'F')"
这篇关于如何提示用户在.NET安装中重新启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!