5

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.

4

1 回答 1

7

REBOOT 是预定义的 Windows 安装程序属性: 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 以添加新行或切换到不同的设置创作工具。

于 2011-11-30T19:04:24.290 回答