Running Process as Admin / Registry Editing

  • Thread starter Thread starter _Shovers2013_
  • Start date Start date
S

_Shovers2013_

Guest
I am creating an installer for a product we have in our environment. The installer will be run on Windows7.
At the moment the install is just a batch file - It copies Dlls and other files to various places, creates folder etc.
It also sets an ACL on the folders it creates and edits some permissions in the registry.

When its running as a batch file all the media for the app is stored in the same folder and this can become quite cluttered.

The idea is to tidy it up and have one single .exe with all the other files embedded as resources.


Ive made fairly good progress turning it into a single exe, however the problem I seem to have at the moment is with permissions.

The ACL was originally set by passing parameters cacls.exe and I can do this in VB using process.start and process.startinfo to specify the details.

However, whilst the error code returned from this process is "0" the ACL is not set correctly - Ive got round this since by using:

Dim FolderInfo As IO.DirectoryInfo = New IO.DirectoryInfo(fp)
Dim FolderAcl As New DirectorySecurity
FolderAcl.AddAccessRule

And thats working fine.


My Question is in 2 parts:

1. Is there anyway to do the same thing to "HKLM\Software\Wow6432Node\Javasoft"

I want to allow "Users" full control of this key and all subkeys.
This is required as the app in question stores data here and is required to read it back out

2. If the regedit cant be done is there some other way I can elevate reg.exe and pass parameters to it to accomplish this.


Apologies if this is the wrong forum.

Any help is appreciated.
Thanks

Continue reading...
 
Back
Top