English 中文(简体)
VS 2005 Setup - HKCU
原标题:

I am trying to fix an existing application that 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?





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签