简体   繁体   English

重启后运行一次应用程序

[英]Running an application once after reboot

I'm currently working on a small application that removes a piece of software and re installs it. 我目前正在研究一个小型应用程序,该应用程序删除了一部分软件并重新安装。 Part of the removal process requires a reboot, so I have had to relaunch the application on startup. 删除过程的一部分需要重新启动,因此我不得不在启动时重新启动应用程序。 I'm currently using a runonce registry key under local machine. 我当前在本地计算机下使用runonce注册表项。

During testing, I've found that on some devices in our fleet, the exe starts before explorer, which is very bad for UX as the installation process takes ~20 minutes and leaves the user with a black screen for this time. 在测试过程中,我发现在我们机队中的某些设备上,该exe在资源管理器之前启动,这对UX来说非常糟糕,因为安装过程需要20分钟左右的时间,而此时用户却黑屏。

Initially, I used the runonce key under current user, however I ran into issues during deployment via SCCM.(I know there are ways to remove and reinstall using SCCM, but the requirements I was given state it needs to be an application) 最初,我在当前用户下使用过runonce密钥,但是在通过SCCM进行部署时遇到了问题(我知道可以使用SCCM进行删除和重新安装的方法,但是我的要求是它必须是一个应用程序)

So how can I run my exe once at startup, without getting a black screen? 那么,如何在启动时一次运行exe而不出现黑屏?

Thanks! 谢谢!

How about dropping a shortcut to your installer into the startup folder and removing it once done with the install? 如何将安装程序的快捷方式放入启动文件夹,并在安装完成后将其删除?

All users: C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp 所有用户:C:\\ ProgramData \\ Microsoft \\ Windows \\开始菜单\\ Programs \\ StartUp

Current user: C:\\Users[Username]\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup 当前用户:C:\\ Users [用户名] \\ AppData \\ Roaming \\ Microsoft \\ Windows \\开始菜单\\ Programs \\ Startup

您可以在延迟启动/登录后使用任务计划程序启动应用程序。

创建两个部署,一个用于卸载软件,另一个用于重新安装。将卸载部署设置为重新安装部署的依赖项,并设置卸载部署所需的Configuration Manager重新启动。

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

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