Exemplo n.º 1
0
        /// <summary>
        /// Decompile the UserGroup table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileUserGroupTable(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Util.User user = (Util.User) this.Core.GetIndexedElement("User", (string)row[0]);

                if (null != user)
                {
                    Util.GroupRef groupRef = new Util.GroupRef();

                    groupRef.Id = (string)row[1];

                    user.AddChild(groupRef);
                }
                else
                {
                    this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerCore.PrimaryKeyDelimiter), "Group_", (string)row[0], "Group"));
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Decompile the User table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileUserTable(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Util.User user = new Util.User();

                user.Id = (string)row[0];

                user.Name = (string)row[2];

                if (null != row[3])
                {
                    user.Domain = (string)row[3];
                }

                if (null != row[4])
                {
                    user.Password = (string)row[4];
                }

                if (null != row[5])
                {
                    int attributes = (int)row[5];

                    if (UtilCompiler.UserDontExpirePasswrd == (attributes & UtilCompiler.UserDontExpirePasswrd))
                    {
                        user.PasswordNeverExpires = Util.YesNoType.yes;
                    }

                    if (UtilCompiler.UserPasswdCantChange == (attributes & UtilCompiler.UserPasswdCantChange))
                    {
                        user.CanNotChangePassword = Util.YesNoType.yes;
                    }

                    if (UtilCompiler.UserPasswdChangeReqdOnLogin == (attributes & UtilCompiler.UserPasswdChangeReqdOnLogin))
                    {
                        user.PasswordExpired = Util.YesNoType.yes;
                    }

                    if (UtilCompiler.UserDisableAccount == (attributes & UtilCompiler.UserDisableAccount))
                    {
                        user.Disabled = Util.YesNoType.yes;
                    }

                    if (UtilCompiler.UserFailIfExists == (attributes & UtilCompiler.UserFailIfExists))
                    {
                        user.FailIfExists = Util.YesNoType.yes;
                    }

                    if (UtilCompiler.UserUpdateIfExists == (attributes & UtilCompiler.UserUpdateIfExists))
                    {
                        user.UpdateIfExists = Util.YesNoType.yes;
                    }

                    if (UtilCompiler.UserLogonAsService == (attributes & UtilCompiler.UserLogonAsService))
                    {
                        user.LogonAsService = Util.YesNoType.yes;
                    }
                    
                    if (UtilCompiler.UserDontRemoveOnUninstall == (attributes & UtilCompiler.UserDontRemoveOnUninstall))
                    {
                        user.RemoveOnUninstall = Util.YesNoType.no;
                    }

                    if (UtilCompiler.UserDontCreateUser == (attributes & UtilCompiler.UserDontCreateUser))
                    {
                        user.CreateUser = Util.YesNoType.no;
                    }
                }

                if (null != row[1])
                {
                    Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]);

                    if (null != component)
                    {
                        component.AddChild(user);
                    }
                    else
                    {
                        this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerCore.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component"));
                    }
                }
                else
                {
                    this.Core.RootElement.AddChild(user);
                }
                this.Core.IndexElement(row, user);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Decompile the User table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileUserTable(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Util.User user = new Util.User();

                user.Id = (string)row[0];

                user.Name = (string)row[2];

                if (null != row[3])
                {
                    user.Domain = (string)row[3];
                }

                if (null != row[4])
                {
                    user.Password = (string)row[4];
                }

                if (null != row[5])
                {
                    int attributes = (int)row[5];

                    if (UtilCompiler.UserDontExpirePasswrd == (attributes & UtilCompiler.UserDontExpirePasswrd))
                    {
                        user.PasswordNeverExpires = Util.YesNoType.yes;
                    }

                    if (UtilCompiler.UserPasswdCantChange == (attributes & UtilCompiler.UserPasswdCantChange))
                    {
                        user.CanNotChangePassword = Util.YesNoType.yes;
                    }

                    if (UtilCompiler.UserPasswdChangeReqdOnLogin == (attributes & UtilCompiler.UserPasswdChangeReqdOnLogin))
                    {
                        user.PasswordExpired = Util.YesNoType.yes;
                    }

                    if (UtilCompiler.UserDisableAccount == (attributes & UtilCompiler.UserDisableAccount))
                    {
                        user.Disabled = Util.YesNoType.yes;
                    }

                    if (UtilCompiler.UserFailIfExists == (attributes & UtilCompiler.UserFailIfExists))
                    {
                        user.FailIfExists = Util.YesNoType.yes;
                    }

                    if (UtilCompiler.UserUpdateIfExists == (attributes & UtilCompiler.UserUpdateIfExists))
                    {
                        user.UpdateIfExists = Util.YesNoType.yes;
                    }

                    if (UtilCompiler.UserDontRemoveOnUninstall == (attributes & UtilCompiler.UserDontRemoveOnUninstall))
                    {
                        user.RemoveOnUninstall = Util.YesNoType.no;
                    }

                    if (UtilCompiler.UserDontCreateUser == (attributes & UtilCompiler.UserDontCreateUser))
                    {
                        user.CreateUser = Util.YesNoType.no;
                    }
                }

                if (null != row[1])
                {
                    Wix.Component component = (Wix.Component) this.Core.GetIndexedElement("Component", (string)row[1]);

                    if (null != component)
                    {
                        component.AddChild(user);
                    }
                    else
                    {
                        this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerCore.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component"));
                    }
                }
                else
                {
                    this.Core.RootElement.AddChild(user);
                }
                this.Core.IndexElement(row, user);
            }
        }