简体   繁体   English

重新启动后重新启动安装程序

[英]Restart Setup after reboot

We have a custom setup engine (written in C#) that needs to continue the installation after a reboot, because the .NET Framework 4.0 setup requires this.我们有一个自定义安装引擎(用 C# 编写),需要在重启后继续安装,因为 .NET Framework 4.0 安装需要这个。

The RunOnce Registry Key cannot be used, as Windows blocks applications that require administrator rights.无法使用RunOnce注册表项,因为 Windows 会阻止需要管理员权限的应用程序。 When we use the Run Key, a balloon message pops up that indicates that windows has blocked the application.当我们使用 Run Key 时,会弹出一个气球消息,指示 windows 已阻止该应用程序。 We you click on the ballon you can start the application regardless, but that is not suitable for a business application.我们你点击气球就可以启动应用了,但是那不适合商业应用。

Are there any other ways we could solve this problem?我们还有其他方法可以解决这个问题吗?

//edit: The RunOnce key works, but you have to make sure that it is created under the HKEY_CURRENT_USER of the current user. //edit: RunOnce键有效,但您必须确保它是在当前用户的HKEY_CURRENT_USER下创建的。

Thanks a lot, Simon非常感谢,西蒙

The RunOnce Key seems to work. RunOnce密钥似乎有效。 I think that the tester that looked into the matter created the Key under HKEY_LOCAL_MACHINE , which doesn't work because the RunOnce key is only executed when the program has the right to remove itself from the entry.我认为调查此事的测试人员在HKEY_LOCAL_MACHINE下创建了密钥,这不起作用,因为RunOnce密钥仅在程序有权从条目中删除自身时执行。 (Which is not the case when you use HKEY_LOCAL_MACHINE when logged in using a standard user account). (当您使用标准用户帐户登录时使用HKEY_LOCAL_MACHINE时,情况并非如此)。 Thank you!谢谢!

If you can't access the registry for any reason, you could create a shortcut of your setup in the Startup folder, and delete it as soon as your setup is finished (you don't want it to run at the next reboot).如果您因任何原因无法访问注册表,您可以在 Startup 文件夹中创建设置的快捷方式,并在设置完成后立即将其删除(您不希望它在下次重新启动时运行)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM