安装项目安装完成后重新启动的最简单方法是什么?
我不想问这个问题,因为我知道已经有很多关于它的问题,其中一些非常接近我想做的事情:
第一个似乎表明它是没有外部软件是不可能的,但第二个问题给出的答案似乎正是我想要的。但我不太明白当建议设置REBOOT=Force
时它指的是什么。
我通读了有关属性的链接文章,我不知道这是否只是 MSDN 的编写方式,但我对如何在安装项目中使用它们一无所知。总的来说,我对 C# 和安装项目还相当陌生。
除了属性之外,使用最少的外部依赖项做的下一个最简单的事情似乎是创建一个小型 C# 应用程序,它除了关闭系统之外什么也不做。然后将自定义操作添加到提交部分以调用此应用程序。这对我来说似乎有点过分了,这是否意味着无用的应用程序必须成为安装的一部分并留在用户计算机上?
我发现了很多关于使用 WIX 或 Orca 的资料,但我有不使用它们的理由(至少因为我必须为任何软件编写业务案例用过的)。我什至不想创建一个非常复杂的安装程序,它只是复制一些新的 EXE,然后重新启动以确保在启动时使用新的 EXE。尽管我现在认为可能不值得重新启动的麻烦,只是将新的 exe 作为自定义操作调用。
I hate to ask this question as I am aware that there are plenty of questions about it already, some coming very close to what I am wanting to do:
The first one seems to suggest that it is impossible without external software but the second question gives an answer that seems exactly what I want. But I don't really understand what it's referring to when it's suggested to set REBOOT=Force
.
I read through the linked articles about properties, I don't know if it's just the way MSDN is written but I feel none the wiser about how I'm supposed to use them in a setup project. I'm still fairly new to C# in general and Setup Projects specifically.
Outside of properties it seems like the next easiest thing to do with the least external dependencies is to create a little C# application, which does nothing but shutdown the system. Then add a Custom Action to the Commit section to call this application. This seems like an overkill to me and does that mean that the useless application has to be part of the installation and left on the users machine?
I've found plenty of stuff about using WIX or Orca but I have my reasons for not using them (at the very least because I have to write Business Cases for any software used). I am not even trying to create a very complicated installer, it is just a few new EXEs being copied over and then restarting to be sure that the new EXE is used at startup. Though I am now thinking that it may not be worth the hassle of restarting and just call the new exe as a custom action.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
REBOOT 是预定义的 Windows Installer 属性:
http://msdn.microsoft。 com/en-us/library/windows/desktop/aa371101(v=vs.85).aspx
安装程序属性存储在 来自 MSI 的属性表数据库。因此,您只需在属性表中添加一个包含以下信息的新行:
您可以在此处阅读有关安装程序属性的更多信息:
http:// msdn.microsoft.com/en-us/library/windows/desktop/aa372432(v=vs.85).aspx?ppud=4
请注意Visual Studio 安装项目不支持设置属性值。因此,您可以使用 Orca 编辑 MSI 以添加新行或切换到不同的设置创作工具。
REBOOT is a predefined Windows Installer property:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa371101(v=vs.85).aspx
Installer properties are stored in Property table from the MSI database. So you can simply add a new row in Property table with this information:
You can read more about installer properties here:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa372432(v=vs.85).aspx?ppud=4
Please note that Visual Studio setup projects do not support setting property values. So you can either edit the MSI with Orca to add the new row or switch to a different setup authoring tool.