通过ClickOnce安装设置注册表项 [英] Set registry key through ClickOnce installation

查看:268
本文介绍了通过ClickOnce安装设置注册表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将应用程序添加到启动中,因此需要使用安装路径设置注册表项。我已经在Visual Studio安装程序项目中完成了此工作,但无法弄清楚如何通过ClickOnce部署来完成此工作。

I need to add my application to the startup and hence, need to set the Registry Key with the Installation path. I have got this working through the Visual Studio Setup project but can't figure out how to do it through a ClickOnce deployment.

有人知道如何在使用ClickOnce进行安装时设置注册表项吗?

Anyone know how to set registry keys when using ClickOnce for installation?

推荐答案

ClickOnce无法执行此操作。如果您想让应用程序在用户登录时启动,则必须在应用程序中编写代码(将快捷方式复制到启动文件夹,编辑注册表等)。

ClickOnce can't do this. If you want your app to start when the user logs in, you have to write code in your application to do it (copy a shortcut to the startup folder, edit the registry, etc.)

此外,请记住,如果您编写代码来处理这种情况,则在用户卸载应用程序时该操作不会被撤消。

Also, keep in mind that if you write code to handle this scenario, it won't be undone when the user uninstalls your application.

这里是一个论坛问题和博客文章可以为您提供帮助出来。这是类似的SO问题, 401816 1650650

Here is a forum question and blog post that should help you out. And here are similar SO questions, 401816 and 1650650.

这篇关于通过ClickOnce安装设置注册表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆