C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to apply permissions for registry key in WIX installer


Posted Date: 14 Aug 2008      Total Responses: 1

Posted By: Nandhini Raman       Member Level: Bronze     Points: 1



Hi all,

Im using WIX installer to create MSI for my project. when im applying permission for registry key as follows.

<Component Id="ASPNET_SETREGComponent" DiskId="1" Guid="8219C955-CCD1-4941-A76C-65FDD55349AC">
<CreateFolder/>
<Registry Id="ASPNET_SETREGPermissions" Root="HKLM" Key="SOFTWARE\BHOLD\b1Core\ASPNET_SETREG" Action="createKeyAndRemoveKeyOnUninstall" >
<Permission User="ASPNET" ChangePermission="yes" GenericAll="yes" />
<Permission User="NETWORK" ChangePermission="yes" GenericAll="yes" />
<Permission User="NETWORK SERVICE" ChangePermission="yes" GenericAll="yes" />
<Permission User="Administrators" ChangePermission="yes" GenericAll="yes" />
<Permission User="IIS_WPG" ChangePermission="yes" GenericAll="yes" />
<Permission User="BholdApp" ChangePermission="yes" GenericAll="yes" />
<Permission User="CREATOR OWNER" ChangePermission="yes" GenericAll="yes" />
</Registry>
</Component>


but then im getting error as 'Requested registry access is not allowed'
pls let me know how to solve this error.



Thanks in Advance.





Responses

Author: B.Satishkumar    17 Aug 2008Member Level: BronzeRating:     Points: 6

First Check
============
To do this, follow these steps:
1. Click Start, and then click Run.
2. In the Open text box, type regedit.
3. Locate the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application
4. Right-click the Application subkey, point to New, and then click Key.
5. Type TEST for the key name.
6. Close Registry Editor.


Second Approach
The EventLogInstaller class in the System.Diagnostics namespace permits you to install and configure an event log that your application reads from or writes to while running. You can create an event source by using EventLogInstaller. To do this, follow these steps: 1. Use Microsoft Visual Basic .NET or Microsoft Visual C# .NET to create a new Class Library named EventLogSourceInstaller. By default, the Class1.vb file or the Class1.cs file is created.
2. In Solution Explorer, right-click EventLogSourceInstaller, and then click Add References.
3. In the Add Reference dialog box, double-click System.Configuration.Install.dll, and then click OK.
4. Rename the Class1.vb\Class1.cs to MyEventLogInstaller.vb\MyEventLogInstaller.cs.
5. Replace the existing code in MyEventLogInstaller.vb or MyEventLogInstaller.cs with the following sample code:

Visual Basic .NET SampleImports System.Diagnostics
Imports System.Configuration.Install
Imports System.ComponentModel

<RunInstaller(True)> _
Public Class MyEventLogInstaller
Inherits Installer
Private myEventLogInstaller As EventLogInstaller

Public Sub New()
' Create an instance of 'EventLogInstaller'.
myEventLogInstaller = New EventLogInstaller()
' Set the 'Source' of the event log, to be created.
myEventLogInstaller.Source = "TEST"
' Set the 'Log' that the source is created in.
myEventLogInstaller.Log = "Application"
' Add myEventLogInstaller to 'InstallerCollection'.
Installers.Add(myEventLogInstaller)
End Sub
End Class

6. On the Build menu, click Build Solution to create EventLogSourceInstaller.dll.
7. Open the Visual Studio .NET Command Prompt.
8. At the command prompt, change to the folder where EventLogSourceInstaller.dll is located.
9. Run the following command to create the EventSource:
InstallUtil EventLogSourceInstaller.dll





Post Reply
You must Sign In to post a response.
Next : XML
Previous : How to compare two xml schemas
Return to Discussion Forum
Post New Message
Category: XML

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use