开发者

VS 2005 Setup - HKCU

I am trying to fix an existing application th开发者_StackOverflow中文版at uses a Visual Studio 2005 setup project.

We are requiring it to work on limited user accounts for XP, our app is written in C# for .Net 2.0.

It writes keys into HKCU during the setup, but skips the UI step for choosing 'Install for Everyone' versus 'Just me'. So it defaults to installing for Everyone.

The problem is, you install on an admin account, and then switch to a limited account. This makes it do a repair install that fails. If I go to any other admin account, it works just fine.

My question is, where is it putting these keys for HKCU that the limited account is trying read/write to?

Is there a magical place in HKEY_USERS that applies to "Everyone"? I do not understand how it work going from admin user to another admin user. To test this theory, I manually entered the keys in HKCU on the limited user, and it still tried to repair.

If I knew where this "Everyone" key is, I could merely grant full access to all users with a custom action so the limited account would not force a repair install.


There's no such thing as an "Everyone" HKCU key. HKCU is per user. Windows Installer will always try to repair, and unless everyone has access to the original MSI file then it will probably fail.

Basically the rule of thumb I always follow is to never write to HKCU during install, instead I write to HKLM during installation, and the first time the application runs then I create the relevant HKCU keys.

See my answer on the SO question Launching a program in different creds or HKCU and installers and check out ActiveSetup as a viable alternative for writing the relevant HKCU configuration.


Is

HKEY_USERS\.DEFAULT\  

the branch you're looking for?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜