2. Commit
3. OnCommitting
4. Install
5. OnBeforeRollback
Create a custom Microsoft Windows Installer for the .NET Framework components by using the
System.Configuration.Install namespace, and configure the .NET Framework applications by using
configuration files, environment variables, and the .NET Framework Configuration tool
(Mscorcfg.msc).). Installer class
MCTS Self-Paced Training Kit (Exam 70-536): Microsoft .NET Framework 2.0--Application Development
Foundation, Microsoft
Chapter 9 - Lesson 2
Installer Class
MSDN Library, Microsoft
Link: http://msdn2.microsoft.com/en-us/library/system.configuration.install.installer(VS.80).aspx
* Users must be able to read, but not modify, the configuration file.
* Administrators must be able to edit the configuration file.
* An event must be added to the event log each time an administrator modifies the file.
Dim ar1 As FileSystemAccessRule = New FileSystemAccessRule(a, FileSystemRights.FullControl,
AccessControlType.Allow)
Dim ar2 As FileSystemAccessRule = New FileSystemAccessRule(u, FileSystemRights.Read,
AccessControlType.Allow)
Dim ar3 As FileSystemAuditRule = New FileSystemAuditRule(a, FileSystemRights.Modify,
AuditFlags.Success)
Dim fs As FileSecurity = New FileSecurity
fs.AddAccessRule(ar1)
fs.AddAccessRule(ar2)
fs.AddAuditRule(ar3)
// C#
NTAccount a = new NTAccount("Administrators");
NTAccount u = new NTAccount("Users");
FileSystemAccessRule ar1 = new FileSystemAccessRule(a, FileSystemRights.FullControl,
AccessControlType.Allow);
FileSystemAccessRule ar2 = new FileSystemAccessRule(u, FileSystemRights.Read,
AccessControlType.Allow);
FileSystemAuditRule ar3 = new FileSystemAuditRule(a, FileSystemRights.Modify, AuditFlags.Success);
FileSecurity fs = new FileSecurity();
fs.AddAccessRule(ar1);
fs.AddAccessRule(ar2);
fs.AddAuditRule(ar3);
Dim ar1 As FileSystemAuditRule = New FileSystemAuditRule(a, FileSystemRights.FullControl,
AccessControlType.Allow)
Dim ar2 As FileSystemAuditRule = New FileSystemAuditRule(u, FileSystemRights.Read,
AccessControlType.Allow)
Dim ar3 As FileSystemAuditRule = New FileSystemAuditRule(a, FileSystemRights.Modify,
AuditFlags.Success)
Dim fs As FileSecurity = New FileSecurity
fs.AddAuditRule(ar1)
fs.AddAuditRule(ar2)
fs.AddAuditRule(ar3)
// C#
NTAccount a = new NTAccount("Administrators");
NTAccount u = new NTAccount("Users");
FileSystemAuditRule ar1 = new FileSystemAuditRule(a, FileSystemRights.FullControl,
AccessControlType.Allow);
FileSystemAuditRule ar2 = new FileSystemAuditRule(u, FileSystemRights.Read, AccessControlType.Allow);
FileSystemAuditRule ar3 = new FileSystemAuditRule(a, FileSystemRights.Modify, AuditFlags.Success);
Dim ar1 As FileSystemAccessRule = New FileSystemAccessRule(a, FileSystemRights.FullControl,
AccessControlType.Allow)
Dim ar2 As FileSystemAccessRule = New FileSystemAccessRule(u, FileSystemRights.Read,
AccessControlType.Allow)
Dim ar3 As FileSystemAccessRule = New FileSystemAccessRule(a, FileSystemRights.Modify,
AuditFlags.Success)
Dim fs As FileSecurity = New FileSecurity
fs.AddAccessRule(ar1)
fs.AddAccessRule(ar2)
fs.AddAccessRule(ar3)
// C#
NTAccount a = new NTAccount("Administrators");
NTAccount u = new NTAccount("Users");
FileSystemAccessRule ar1 = new FileSystemAccessRule(a, FileSystemRights.FullControl,
AccessControlType.Allow);
FileSystemAccessRule ar2 = new FileSystemAccessRule(u, FileSystemRights.Read,
AccessControlType.Allow);
FileSystemAccessRule ar3 = new FileSystemAuditRule(a, FileSystemRights.Modify, AuditFlags.Success);
FileSecurity fs = new FileSecurity();
fs.AddAccessRule(ar1);
fs.AddAccessRule(ar2);
fs.AddAccessRule(ar3);
Dim ar1 As FileSystemAccessRule = New FileSystemAccessRule(a, FileSystemRights.FullControl,
AccessControlType.Allow)
Dim ar2 As FileSystemAccessRule = New FileSystemAccessRule(u, FileSystemRights.Read,
AccessControlType.Allow)
Dim ar3 As FileSystemAuditRule = New FileSystemAuditRule(a, FileSystemRights.Modify,
AuditFlags.Success)
Dim fs As FileSecurity = New FileSecurity
fs.AddAuditRule(ar1)
fs.AddAuditRule(ar2)
fs.AddAccessRule(ar3)
// C#
NTAccount a = new NTAccount("Administrators");
NTAccount u = new NTAccount("Users");
FileSystemAccessRule ar1 = new FileSystemAccessRule(a, FileSystemRights.FullControl,
AccessControlType.Allow);
FileSystemAccessRule ar2 = new FileSystemAccessRule(u, FileSystemRights.Read,
AccessControlType.Allow);
FileSystemAuditRule ar3 = new FileSystemAuditRule(a, FileSystemRights.Modify, AuditFlags.Success);
FileSecurity fs = new FileSecurity();
fs.AddAuditRule(ar1);
fs.AddAuditRule(ar2);
fs.AddAccessRule(ar3);
You need to create two instances of FileSystemAccessRule to create the Discrectionary Access Control
Lists (DACLs) for Administrators and Users, and one instance of FileSystemAuditRule to create the
System Access Control List (SACL) for Administrators.