本文介绍了从安装项目重新启动系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建使用Visual Studio安装项目。我要重新启动成功完成安装后的系统。

I am creating a setup project using Visual Studio. I want to reboot the system after the installation completed successfully.

我想这一次的努力。我不希望使用任何外部工具/程序将其传送到客户端之前,每次修改设置。

I want it one time effort. I do not want to modify the setup each time using any external tool/ utility before delivering it to client.

我可以调整设置项目本身?

Can I tweak the setup project itself?

我怎样才能做到这一点?

How Can I do that?

推荐答案

请不要swhoot我失望,但是我不会回答你的具体问题,然而,这是一种方式的MSI后重新启动计算机安装。

Please dont swhoot me down, but Im not going to answer your specific question, however this is a way to reboot PC after an msi install.

使用维克斯相反,它是这么多灵活的VS内置的设置,并有一个插件VS。

Use WiX instead, it is so much more flexible the the VS built in setup, and there is a plugin for VS.

如果你使用维克斯这是code表示开始重新启动。

If you do use WiX this is the code that initiates a reboot.

<InstallExecuteSequence>
  <ScheduleReboot After='InstallFinalize' />
</InstallExecuteSequence>

另外,您可以创建一个变换你的VS安装项目只包含其他条目开始重新启动,那么任何时候你建立你的项目的所有你需要做的就是应用转换,你可以在一个批处理文件将此包的客户或相似的。

Alternatively you could create a transform for your VS setup project that only contains the additional entries to initiate the reboot, then anytime you build your project all you need do is apply the transform, you could ship this to customers in a batch file or similar.

PS牢记发出一个shell命令作为自定义动作不做到这一点的最好办法。这将导致机器重启,而不是返回正确的退出code 3010 因此,如果有人试图套住退出code还是在命令行上一个/ norestart更新日志文件shell命令会忽略这一点。

ps bear in mind that issuing a shell command as a custom action is not the best way to do it. This will cause the machine to reboot and not return the proper exit code 3010 so if someone is trying to trap the exit code or do a /norestart on the command line the shell command will ignore this.

修改一旦你创建了一个msi文件打开它与逆戟鲸,然后添加必要的更改表到schedulereboot。保存更改为一个变换,然后只要将MSI文件并没有改变显着,你可以简单地套用变换微星每次你运行它。

EDITOnce you have created a msi file open it up with orca and then add the necessary changes to the tables to schedulereboot. Save the changes as a transform then as long as the msi file doesnt change dramatically you can simply apply the transform to the msi everytime you run it.

本人来说我不会想这样做,因为它是一个额外的步骤,你应该能够做到这一点的来源中。

Personaly I wouldnt want to do this as it is an extra step and you ought to be able to do it in the source.

要添加的重启过程中ORCA转到了InstallExecuteSequence表,找到InstallFinalize项。添加一个名为ScheduleReboot新条目并输入号码的顺序列比从InstallFinalize阶段的顺序更大的1。

To add the reboot sequence in orca goto the InstallExecuteSequence table and find the InstallFinalize entry. Add a new entry called ScheduleReboot and enter a number in the sequence column that is 1 greater than the sequence from the InstallFinalize stage.

这篇关于从安装项目重新启动系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 22:57