安装项目安装完成后重启的最简单方法是什么? [英] What is the simplest way to reboot after a Setup Project installation completes?

查看:63
本文介绍了安装项目安装完成后重启的最简单方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想问这个问题,因为我知道已经有很多关于它的问题,有些非常接近我想要做的:

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:

第一个问题似乎表明没有外部软件是不可能的,但第二个问题给出的答案似乎正是我想要的.但是当建议设置 REBOOT=Force 时,我真的不明白它指的是什么.

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.

我通读了有关属性的链接文章,我不知道这是否只是 MSDN 的编写方式,但我觉得我应该如何在设置项目中使用它们并不明智.总的来说,我对 C# 和安装项目还是很陌生.

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.

在属性之外,对于最少的外部依赖似乎下一个最简单的事情是创建一个小的 C# 应用程序,它除了关闭系统之外什么都不做.然后向 Commit 部分添加自定义操作以调用此应用程序.这对我来说似乎有点矫枉过正,这是否意味着无用的应用程序必须成为安装的一部分并留在用户机器上?

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?

我发现很多关于使用 WIX 或 Orca 的东西,但我有我不使用它们的原因(至少因为我必须为任何编写商业案例 使用的软件).我什至不想创建一个非常复杂的安装程序,它只是复制几个新的 EXE,然后重新启动以确保在启动时使用新的 EXE.虽然我现在认为重新启动的麻烦可能不值得,只是将新的 exe 作为自定义操作调用.

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.

推荐答案

REBOOT 是预定义的 Windows Installer 属性:http://msdn.microsoft.com/en-us/library/windows/desktop/aa371101(v=vs.85).aspx

REBOOT is a predefined Windows Installer property: http://msdn.microsoft.com/en-us/library/windows/desktop/aa371101(v=vs.85).aspx

安装程序属性存储在 来自MSI数据库的属性表.因此,您可以简单地使用以下信息在属性表中添加一个新行:

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:

  • 属性 - 重新启动
  • 价值 - 力量

您可以在此处阅读有关安装程序属性的更多信息:http://msdn.microsoft.com/en-us/library/windows/desktop/aa372432(v=vs.85).aspx?ppud=4

You can read more about installer properties here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa372432(v=vs.85).aspx?ppud=4

请注意,Visual Studio 安装项目不支持设置属性值.因此,您可以使用 Orca 编辑 MSI 以添加新行或切换到不同的设置创作工具.

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.

这篇关于安装项目安装完成后重启的最简单方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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