Registry issue

Started by Randem, December 10, 2008, 06:45:55 AM

Previous topic - Next topic

Randem

BTW, when you create the shortcut and have gotten the admin name and password for it store the shortcut in the All Users Desktop folder so that when a new user is create the desktop application is there to run.

afridy

ok fair enough. ill try D

Randem

The exe is just an exe that creates the registry entries for the user. This exe will be in the {app} folder.
 
Option 1: In a limited users account create a shortcut for the exe. Right click on the shortcut then click on properties, then click on advanced. Tick the box to run under different credentials.
 
When this exe is run it will as for the account to be run under. You can mark this exe to use the administrator account. The user will need to set the user account and password for it to work.
 
Option 2: Create a service that will run in the system account and this service will create the user account in the registry.

afridy

Quoteseparate exe the is set to run as administrator

sorry, i could not get the plan. pls explain a bit.
where to place this exe. how to run as admin etc.

Randem

Still do the same thing, you just have to have a separate exe the is set to run as administrator and the only thing it does is to create the keys.

afridy

Got in to a problem Rendam,
 
QuoteWell, yes and no.When you uninstall only the current users keys can be uninstalled. Since you have no access to the other users areas you cannot uninstall those keys. The only way to uninstall all keys is to create the keys for each user in the HKLM area, then all the keys can be deleted at once. But this has to be done in your application not automatically by the installer.

It seems the user requir admin privileges to create registry keys under HKLMsoftwaremysoftware  
 
what shall i do now?

Randem

Check to see if the key for that user exists, if it doesn't exist then it is the first time the user is running the app, then create the keys for that user.
 
(Message edited by randem on December 11, 2008)

afridy

one more question,
what is the best way to determine weather the user running out app for the first time or not?

afridy

wow, very good tip i got finally from you !
ok ill instruct the installer to create the base key so it will be uninstalled lator. then ill create all the values using my app for each user on the first run under that key. :D

Randem

Lots of product do this because if they have an update to the application they can change the keys of all users and it is done. If each user is responsible for the update... there can be many problems.

afridy

i have never seen any one doing this  
seems a very good trick.
is there any populer products doing this for example?

Randem

The problem with that is the keys will still exist after installation, however if you create all keys in the HKLM\Software\YOURCOMPANYNAME\YOURAPPNAME\USERNAME you can delete them all at unistall time from and application you create to delete these keys that can be called from the uninstaller.

afridy

yah rendam,
my plan is like this. my current installer creates (& removes when unstall) all the values & keys necessary for the current user who run the installation.  
 
so for other uses i plan to create the values and keys manually.  
 
so this will uninstall the regkeys atleast for the user who intalled the app is it.

Randem

You are welcome. So you will want to create an uninstaller application that the uninstaller can run to remove the keys (or vice verse).

afridy