Solved

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

Posted on 2016-10-16
4
44 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 69

Accepted Solution

by:
Qlemo earned 200 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 18

Assisted Solution

by:Mal Osborne
Mal Osborne earned 150 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 34

Assisted Solution

by:sarabande
sarabande earned 150 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 34

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

This article explains the steps required to use the default Photos screensaver to display branding/corporate images
Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
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 from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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