[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Write registry keys to current user rather than admin user that installs the application

Posted on 2016-10-16
4
Medium Priority
?
54 Views
Last Modified: 2016-11-05
I have a c# application that writes registry keys to the current user profile on installation. The company wants to roll out the application use an admin user and so when they run the MSI as that admin user, the registry keys get stored under that profile, rather than the profile that is currently logged in.

How can I fix this?
0
Comment
Question by:thinklings
  • 2
4 Comments
 
LVL 71

Accepted Solution

by:
Qlemo earned 800 total points (awarded by participants)
ID: 41845909
You can't - that easily. Your choices are always to install for everyone (using HKLM and the All Users file locations) or for the current user.
But if you run an installer as admin while logged in as the user, you should have access to the user profile. I have to admit I don't know if HKCU points to non-admin or admin user, and if the latter how to know which is the correct profile ...
0
 
LVL 20

Assisted Solution

by:Mal Osborne
Mal Osborne earned 600 total points (awarded by participants)
ID: 41846195
If the target machine is a terminal server, make sure you throw it into install mode before you do the install. This is done at the command prompt with "Change user /install". Once the app has been installed, use "Change user /execute".

More here:

https://support.microsoft.com/en-us/kb/186504
0
 
LVL 35

Assisted Solution

by:sarabande
sarabande earned 600 total points (awarded by participants)
ID: 41846806
if the target user already has admin rights, you easily could run the Setup program (after uninstalling) from user account 'as administrator'. then the current user automatically should get the right settings in the registry.

if they are not Administrator, I mean the 'run as administrator' will ask for both, adminstrator account and password, what also should have the wished result.

if i am wrong, it may simplest for you, to temporary make them an Administrator.

if that isn't an option the user may login at their account. then you would open a command window and start the setup with runas command:

runas /profile /env /user:mydomain\admin "setup program or msc"

the /env would make that the local environment was used for the setup.

Sara
0
 
LVL 35

Expert Comment

by:sarabande
ID: 41875267
Unfortunately the Asker didn't respond, but the given solutions are valid nevertheless and should be PAQ'ed.

Sara
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here's a look at newsworthy articles and community happenings during the last month.
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question