删除注册表项,在 Windows 7 中使用 Visual Studio 2008 安装和部署项目

发布于 2024-08-26 11:19:50 字数 289 浏览 2 评论 0原文

我在 Visual Studio 2008 Professional 中创建了一个安装和部署项目。我正在使用 Visual C++,其中有两个在自定义操作下运行的 exe 文件。一个在提交中运行,另一个在卸载中运行。目的是在安装时添加注册表项并在卸载时删除它。它在 Windows XP 上完美运行,但当我切换到 Windows 7 并运行安装程序时,只有密钥添加部分起作用。卸载时该密钥不会被删除。但是,当我从安装程序中取出卸载 exe 文件并在 Windows 7 上单独运行它时(不是通过安装程序,只需双击 exe),它会完美删除注册表项。知道问题是什么吗?

I have created a setup and deployment project in Visual Studio 2008 Professional. I'm using Visual C++, and in it I have two exe files which run under custom actions. One is running in commit and other in uninstall. Purpose is to add a registry key at install time and remove it at uninstall. It works perfectly on Windows XP but when I change to Windows 7 and run the setup, only the key-adding part works. The key doesn't get deleted at uninstall. But when I take the uninstall exe file out from the setup and run it separately on Windows 7, (not through the setup, by just double-clicking on the exe) it removes the registry entry perfectly. Any idea what the problem is?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

世界等同你 2024-09-02 11:19:50

是什么阻止您检查 RegDeleteKey 返回的错误代码?我想您的问题与在不同上下文中启动程序时不同的访问权限有关。也许您尝试从 HKLM 中删除密钥。检查自定义程序和卸载程序的清单。

What prevent you from checking error code returned by RegDeleteKey? I suppose your problem is releated to access rights which are different while launching your program in various contexts. Probably you try ro remove key from HKLM. Check manifests of your custom program and uninstaller.

月隐月明月朦胧 2024-09-02 11:19:50

再次。我解决了我的问题,创建了一个 .reg 文件,所以用这个 .reg 文件,我用 vb 制作了一个 process.start() ,然后我从硬盘上删除了 de .reg 文件。通过这种方式,我可以为没有完全访问 regedit 权限的用户创建密钥。

关于卸载,我将进行新的研究..无论如何谢谢

again. I solved my problem, creating a .reg file, so with this .reg file, i made with vb, a process.start() and then i deleted de .reg file from hard disk. With this way, i can create keys on users that don't have a full access to his permissions on regedit.

About uninstall, i'll make a new research..thanks any way

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文