[英]How do I create a installation package in visual studio 2010 after installed it is automatically run when boot?
I have .net windows application project, I can able to create installation package and installation has been done successfully. 我有.net windows应用程序项目,我能够创建安装包并且安装已成功完成。 After installed my project, it has been run successfully when i click manually. 安装完我的项目后,我手动点击它已成功运行。 I need to run my project automatically when my system boot. 我需要在系统启动时自动运行我的项目。
How to create installer after install my project,it has to run automatically whenever my system boot. 如何在安装我的项目后创建安装程序,它必须在我的系统启动时自动运行。 Teach me how to done this work. 教我如何完成这项工作。
You can either add an registry key to HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Run
which contains the path to your executable, or you can add a shortcut in the directory Startup
in the user's start menu. 您可以添加注册表项以HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Run
包含你可执行文件的路径,也可以在目录中添加一个快捷方式Startup
用户的开始菜单。 I'd recommend the registry key, as the user won't see more of your program's shortcuts but the functionality is thesame. 我建议使用注册表项,因为用户不会看到更多程序的快捷方式,但功能相同。
Another way to approach this is to let the user decide what to do. 解决这个问题的另一种方法是让用户决定做什么。 You could create some sort of configuration screen, which lets the user decide if your software should run at boot. 您可以创建某种配置屏幕,让用户决定您的软件是否应该在启动时运行。 Essentially, you could do thesame thing I described above, but handle it in your code rather than in your installer. 基本上,你可以做我上面描述的同样的事情,但是在你的代码而不是你的安装程序中处理它。 Depending on what software you built, this way you don't push the user to have your software started at boot. 根据您构建的软件,这种方式不会促使用户在启动时启动软件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.