为 Visual Studio 安装项目中的每个用户添加注册表项到 HKCU RunOnce [英] Add registry key to HKCU RunOnce for every user from Visual Studio setup project

查看:38
本文介绍了为 Visual Studio 安装项目中的每个用户添加注册表项到 HKCU RunOnce的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要安装一个应用程序,该应用程序对于在 Windows 安装上拥有配置文件的任何登录用户都会运行一次.我不需要它来为新用户运行.我正在使用 Visual Studio 2010 安装项目来创建 MSI,如果 MSI 注册表不够灵活,我很乐意在 C# 中创建自定义操作来处理注册表.

I need to install an application that will run once for any user that logs in who has a profile on a Windows installation. I don't need it to run for new users. I am using a Visual Studio 2010 Setup Project to create an MSI, and I am happy to make Custom Actions in C# to fiddle with the registry if the MSI registry stuff isn't flexible enough.

我知道如何使用 MSI 向 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce 添加注册表值,但这只会为运行安装程序的用户启动应用程序.我可以将该值添加到 HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce 中,但它只会在用户下次登录时运行,而不是为每个用户运行.

I know how to add a registry value to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce with the MSI, but that will only start the app for the user that ran the installer. I can add the value to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce but it'll only run the next time a user logs in, not for every user.

那么,首先它是否可能(使用 VS 安装项目或 C#),如果是,如何实现?

So, firstly is it at all possible (with VS Setup Project or C#), and if so, how?

谢谢.

推荐答案

我认为 Active Setup 是您所需要的:http://www.sepago.de/helge/2010/04/22/active-setup-explained/

I think Active Setup is what you need: http://www.sepago.de/helge/2010/04/22/active-setup-explained/

通常宣传的快捷方式用于在安装软件包后触发每个用户的操作,但这不适合您的情况.

Normally advertised shortcuts are used to trigger per-user actions after a package is installed, but this does not fit with your scenario.

这篇关于为 Visual Studio 安装项目中的每个用户添加注册表项到 HKCU RunOnce的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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