├── .gitignore ├── CodeCrib.AX.AXBuild └── CodeCrib.AX.AXBuild │ ├── AXBuild.cs │ ├── CodeCrib.AX.AXBuild.csproj │ ├── CodeCrib.AX.AXBuild.sln │ ├── Command.cs │ └── Properties │ └── AssemblyInfo.cs ├── CodeCrib.AX.Client ├── CodeCrib.AX.Client.PowerShell │ ├── Cmdlets.cs │ ├── CodeCrib.AX.Client.PowerShell.csproj │ └── Properties │ │ └── AssemblyInfo.cs ├── CodeCrib.AX.Client.sln └── CodeCrib.AX.Client │ ├── AutoRun.cs │ ├── CILGenerationOutput.cs │ ├── Client.cs │ ├── CodeCrib.AX.Client.csproj │ ├── CombineXPOs.cs │ ├── Command.cs │ ├── CompileOutput.cs │ ├── Properties │ └── AssemblyInfo.cs │ └── XPOLabelCheck.cs ├── CodeCrib.AX.Config ├── AxConfig │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── AxConfig.csproj │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ └── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings ├── CodeCrib.AX.Config.PowerShell │ ├── Client.cs │ ├── CodeCrib.AX.Config.PowerShell.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Server.cs ├── CodeCrib.AX.Config.sln └── CodeCrib.AX.Config │ ├── Client.cs │ ├── CodeCrib.AX.Config.csproj │ ├── ConfigBase.cs │ ├── ConfigProperty.cs │ ├── Properties │ └── AssemblyInfo.cs │ └── Server.cs ├── CodeCrib.AX.Manage ├── AxManage │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── AxManage.csproj │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ └── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings ├── CodeCrib.AX.Manage.PowerShell │ ├── AOS.cs │ ├── CodeCrib.AX.Manage.PowerShell.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Server.cs ├── CodeCrib.AX.Manage.sln └── CodeCrib.AX.Manage │ ├── AOS.cs │ ├── CodeCrib.AX.Manage.csproj │ ├── ModelStore.cs │ ├── Properties │ └── AssemblyInfo.cs │ └── ServerConfiguration.cs ├── CodeCrib.AX.Setup ├── AxSetup │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── AxSetup.csproj │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ └── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings ├── CodeCrib.AX.Setup.PowerShell │ ├── Cmdlets.cs │ ├── CodeCrib.AX.Setup.PowerShell.csproj │ └── Properties │ │ └── AssemblyInfo.cs ├── CodeCrib.AX.Setup.sln └── CodeCrib.AX.Setup │ ├── CodeCrib.AX.Setup.csproj │ ├── LogParser.cs │ ├── Parameter.cs │ ├── ParameterFile.cs │ ├── Properties │ └── AssemblyInfo.cs │ └── Setup.cs ├── CodeCrib.AX.Sql ├── CodeCrib.AX.Sql.PowerShell │ ├── CodeCrib.AX.Sql.PowerShell.csproj │ ├── Disable_CustomerExperience.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Reset_Admin.cs │ ├── Reset_GlobalGuid.cs │ └── Restore_SqlDb.cs ├── CodeCrib.AX.Sql.sln └── CodeCrib.AX.Sql │ ├── CodeCrib.AX.Sql.csproj │ ├── DbManagement.cs │ ├── DbServerExtensions.cs │ └── Properties │ └── AssemblyInfo.cs ├── CodeCrib.AX.TFS ├── CodeCrib.AX.TFS.sln └── CodeCrib.AX.TFS │ ├── AOSService.cs │ ├── AXBuild.cs │ ├── Clean.cs │ ├── Client.cs │ ├── CodeCrib AX TFS Build.xaml │ ├── CodeCrib.AX.TFS.csproj │ ├── CombineXPOs.cs │ ├── Compile.cs │ ├── CopyReferences.cs │ ├── Database.cs │ ├── GenerateCIL.cs │ ├── Helper.cs │ ├── ModelStore.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── SetAOSDatabase.cs │ └── XPOLabelCheck.cs ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio. 3 | ################################################################################ 4 | 5 | /.vs 6 | **/obj 7 | **/bin/Debug/ 8 | **/bin/Release 9 | *.suo 10 | -------------------------------------------------------------------------------- /CodeCrib.AX.AXBuild/CodeCrib.AX.AXBuild/AXBuild.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Diagnostics; 10 | using System.IO; 11 | using System.Linq; 12 | using System.Text; 13 | 14 | namespace CodeCrib.AX.AXBuild 15 | { 16 | public class AXBuild 17 | { 18 | public string ExecutablePath { get; set; } 19 | 20 | public static AXBuild NewServerBinPath(string serverBinPath) 21 | { 22 | return new AXBuild(Path.Combine(new[] { serverBinPath, "AxBuild.exe" })); 23 | } 24 | 25 | public AXBuild(string executablePath) 26 | { 27 | ExecutablePath = executablePath; 28 | } 29 | 30 | public static void ExecuteCommand(string serverBinPath, Commands.Command command, int timeOutMinutes) 31 | { 32 | AXBuild axBuild = NewServerBinPath(serverBinPath); 33 | 34 | axBuild.Execute(command.Parameters(), timeOutMinutes); 35 | } 36 | 37 | public static Process StartCommand(string serverBinPath, Commands.Command command) 38 | { 39 | AXBuild axBuild = NewServerBinPath(serverBinPath); 40 | 41 | return axBuild.Start(command.Parameters()); 42 | } 43 | 44 | public void Execute(Commands.Command command, int timeOutMinutes) 45 | { 46 | Execute(command.Parameters(), timeOutMinutes); 47 | } 48 | 49 | public Process Start(Commands.Command command) 50 | { 51 | return Start(command.Parameters()); 52 | } 53 | 54 | public void Execute(List parameterList, int timeOutMinutes) 55 | { 56 | Process process = Start(parameterList); 57 | 58 | if (timeOutMinutes > 0) 59 | { 60 | if (!process.WaitForExit((int)new TimeSpan(0, timeOutMinutes, 0).TotalMilliseconds)) 61 | { 62 | // Process is still running after the timeout has elapsed. 63 | 64 | Exception outerException = null; 65 | 66 | try 67 | { 68 | // TODO - How can the timeout handler account for the worker processes? 69 | process.Kill(); 70 | } 71 | catch (Exception ex) 72 | { 73 | // Error trying to kill the process 74 | // Don't throw the error just yet... 75 | outerException = ex; 76 | } 77 | 78 | if (outerException != null) 79 | { 80 | throw new TimeoutException(string.Format("AXBuild time out of {0} minutes exceeded, additionally an exception was encountered while trying to kill the AXBuild process (see innerexception)", timeOutMinutes), outerException); 81 | } 82 | else 83 | { 84 | throw new TimeoutException(string.Format("AXBuild time out of {0} minutes exceeded", timeOutMinutes)); 85 | } 86 | } 87 | } 88 | else 89 | { 90 | process.WaitForExit(); 91 | } 92 | } 93 | 94 | public Process Start(List parameterList) 95 | { 96 | string parameterString = string.Join(" ", parameterList.ToArray()); 97 | 98 | ProcessStartInfo processStartInfo = new ProcessStartInfo(ExecutablePath, parameterString); 99 | 100 | return Process.Start(processStartInfo); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /CodeCrib.AX.AXBuild/CodeCrib.AX.AXBuild/CodeCrib.AX.AXBuild.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {C1E5B831-90A6-4AB5-80DD-7918F817AFE7} 8 | Library 9 | Properties 10 | CodeCrib.AX.AXBuild 11 | CodeCrib.AX.AXBuild 12 | v4.0 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 54 | -------------------------------------------------------------------------------- /CodeCrib.AX.AXBuild/CodeCrib.AX.AXBuild/CodeCrib.AX.AXBuild.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.AXBuild", "CodeCrib.AX.AXBuild.csproj", "{C1E5B831-90A6-4AB5-80DD-7918F817AFE7}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {C1E5B831-90A6-4AB5-80DD-7918F817AFE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {C1E5B831-90A6-4AB5-80DD-7918F817AFE7}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {C1E5B831-90A6-4AB5-80DD-7918F817AFE7}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {C1E5B831-90A6-4AB5-80DD-7918F817AFE7}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /CodeCrib.AX.AXBuild/CodeCrib.AX.AXBuild/Command.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | 12 | namespace CodeCrib.AX.AXBuild.Commands 13 | { 14 | public class Command 15 | { 16 | public string AltBinDir { get; set; } 17 | public string LogPath { get; set; } 18 | public string AOSInstance { get; set; } 19 | public string DbServer { get; set; } 20 | public string DbName { get; set; } 21 | public bool NoCleanup { get; set; } 22 | public int Workers { get; set; } 23 | 24 | virtual public List Parameters() 25 | { 26 | List parameters = new List(); 27 | 28 | if (!String.IsNullOrEmpty(AltBinDir)) 29 | { 30 | parameters.Add(String.Format("/altbin=\"{0}\"", AltBinDir)); 31 | } 32 | 33 | if (!String.IsNullOrEmpty(LogPath)) 34 | { 35 | parameters.Add(String.Format("/log=\"{0}\"", LogPath)); 36 | } 37 | 38 | if (!String.IsNullOrEmpty(AOSInstance)) 39 | { 40 | parameters.Add(String.Format("/aos=\"{0}\"", AOSInstance)); 41 | } 42 | 43 | if (!String.IsNullOrEmpty(DbServer)) 44 | { 45 | parameters.Add(String.Format("/dbserver=\"{0}\"", DbServer)); 46 | } 47 | 48 | if (!String.IsNullOrEmpty(DbName)) 49 | { 50 | parameters.Add(String.Format("/modelstore=\"{0}\"", DbName)); 51 | } 52 | 53 | if (NoCleanup) 54 | { 55 | parameters.Add("/nocleanup"); 56 | } 57 | 58 | if (Workers > 0) 59 | { 60 | parameters.Add(String.Format("/workers={0}", Workers)); 61 | } 62 | 63 | return parameters; 64 | } 65 | } 66 | 67 | public class Compile : Command 68 | { 69 | public string Compiler { get; set; } 70 | 71 | public override List Parameters() 72 | { 73 | List parameters = base.Parameters(); 74 | 75 | parameters.Insert(0, "xppcompileall"); 76 | 77 | if (!String.IsNullOrEmpty(Compiler)) 78 | { 79 | parameters.Add(String.Format("/compiler=\"{0}\"", Compiler)); 80 | } 81 | 82 | return parameters; 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /CodeCrib.AX.AXBuild/CodeCrib.AX.AXBuild/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CodeCrib.AX.Compile")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CodeCrib.AX.Compile")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("fd00fda5-3419-44c3-af2c-047c205d3c6e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.9.0.0")] 36 | [assembly: AssemblyFileVersion("0.9.0.0")] 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.Client/CodeCrib.AX.Client.PowerShell/Cmdlets.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Management.Automation; 6 | 7 | namespace CodeCrib.AX.Client.PowerShell 8 | { 9 | [Cmdlet(VerbsLifecycle.Start, "AxClient")] 10 | public class Start_AxClient : PSCmdlet 11 | { 12 | [Parameter(HelpMessage = "Command to execute", Mandatory = true, ParameterSetName = "objects")] 13 | public Commands.Command command; 14 | 15 | [Parameter(HelpMessage = "Client object", Mandatory = true, ParameterSetName = "objects")] 16 | public Client client; 17 | 18 | [Parameter(HelpMessage = "Time-out (in minutes) for execution of command", Mandatory = false, ParameterSetName = "objects")] 19 | public int timeout; 20 | 21 | protected override void ProcessRecord() 22 | { 23 | switch (this.ParameterSetName) 24 | { 25 | case "objects": 26 | client.Execute(command, timeout); 27 | break; 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /CodeCrib.AX.Client/CodeCrib.AX.Client.PowerShell/CodeCrib.AX.Client.PowerShell.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {1531BECD-52C7-4D55-873F-E0ED8EA00B68} 8 | Library 9 | Properties 10 | CodeCrib.AX.Client.PowerShell 11 | CodeCrib.AX.Client.PowerShell 12 | v3.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | False 38 | ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | {9f793fc4-3616-44fa-8ced-6475c840be00} 52 | CodeCrib.AX.Client 53 | 54 | 55 | 56 | 63 | -------------------------------------------------------------------------------- /CodeCrib.AX.Client/CodeCrib.AX.Client.PowerShell/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CodeCrib.AX.Client.PowerShell")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CodeCrib.AX.Client.PowerShell")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("617ec6e7-2f25-4db3-bdde-21365fb90253")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.9.0.0")] 36 | [assembly: AssemblyFileVersion("0.9.0.0")] 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.Client/CodeCrib.AX.Client.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Client", "CodeCrib.AX.Client\CodeCrib.AX.Client.csproj", "{9F793FC4-3616-44FA-8CED-6475C840BE00}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Client.PowerShell", "CodeCrib.AX.Client.PowerShell\CodeCrib.AX.Client.PowerShell.csproj", "{1531BECD-52C7-4D55-873F-E0ED8EA00B68}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {9F793FC4-3616-44FA-8CED-6475C840BE00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {9F793FC4-3616-44FA-8CED-6475C840BE00}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {9F793FC4-3616-44FA-8CED-6475C840BE00}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {9F793FC4-3616-44FA-8CED-6475C840BE00}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {1531BECD-52C7-4D55-873F-E0ED8EA00B68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {1531BECD-52C7-4D55-873F-E0ED8EA00B68}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {1531BECD-52C7-4D55-873F-E0ED8EA00B68}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {1531BECD-52C7-4D55-873F-E0ED8EA00B68}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /CodeCrib.AX.Client/CodeCrib.AX.Client/Client.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Diagnostics; 10 | using System.Linq; 11 | using System.Text; 12 | 13 | using Microsoft.Win32; 14 | 15 | namespace CodeCrib.AX.Client 16 | { 17 | public class Client 18 | { 19 | public const string regKey = @"Software\Microsoft\Dynamics\6.0\Setup\Components"; 20 | 21 | public string ExecutablePath { get; set; } 22 | 23 | public static string GetInstallDir32() 24 | { 25 | RegistryKey componentsKey = Registry.CurrentUser.OpenSubKey(regKey, false); 26 | String installDir32 = componentsKey.GetValue("InstallDir32", null) as String; 27 | 28 | return System.Environment.ExpandEnvironmentVariables(installDir32); 29 | } 30 | 31 | public Client() 32 | { 33 | ExecutablePath = string.Format(@"{0}\Client\bin\ax32.exe", GetInstallDir32()); 34 | } 35 | 36 | public Client(string executablePath) 37 | { 38 | ExecutablePath = executablePath; 39 | } 40 | 41 | public static void ExecuteCommand(Commands.Command command, int timeOutMinutes) 42 | { 43 | Client client = new Client(); 44 | 45 | client.Execute(command.Parameters(), timeOutMinutes); 46 | } 47 | 48 | public static Process StartCommand(Commands.Command command) 49 | { 50 | Client client = new Client(); 51 | 52 | return client.Start(command.Parameters()); 53 | } 54 | 55 | public static void ExecuteCommand(string clientPath, Commands.Command command, int timeOutMinutes) 56 | { 57 | Client client = new Client(clientPath); 58 | 59 | client.Execute(command.Parameters(), timeOutMinutes); 60 | } 61 | 62 | public static Process StartCommand(string clientPath, Commands.Command command) 63 | { 64 | Client client = new Client(clientPath); 65 | 66 | return client.Start(command.Parameters()); 67 | } 68 | 69 | public void Execute(Commands.Command command, int timeOutMinutes) 70 | { 71 | Execute(command.Parameters(), timeOutMinutes); 72 | } 73 | 74 | public Process Start(Commands.Command command) 75 | { 76 | return Start(command.Parameters()); 77 | } 78 | 79 | public void Execute(List parameterList, int timeOutMinutes) 80 | { 81 | Process process = Start(parameterList); 82 | 83 | if (timeOutMinutes > 0) 84 | { 85 | if (!process.WaitForExit((int)new TimeSpan(0, timeOutMinutes, 0).TotalMilliseconds)) 86 | { 87 | // Process is still running after the timeout has elapsed. 88 | 89 | Exception outerException = null; 90 | 91 | try 92 | { 93 | process.Kill(); 94 | } 95 | catch (Exception ex) 96 | { 97 | // Error trying to kill the process 98 | // Don't throw the error just yet... 99 | outerException = ex; 100 | } 101 | 102 | if (outerException != null) 103 | { 104 | throw new TimeoutException(String.Format("Client time out of {0} minutes exceeded, additionally an exception was encountered while trying to kill the client process (see innerexception)", timeOutMinutes), outerException); 105 | } 106 | else 107 | { 108 | throw new TimeoutException(String.Format("Client time out of {0} minutes exceeded", timeOutMinutes)); 109 | } 110 | } 111 | } 112 | else 113 | { 114 | process.WaitForExit(); 115 | } 116 | } 117 | 118 | public Process Start(List parameterList) 119 | { 120 | string parameterString = String.Join(" ", parameterList.ToArray()); 121 | 122 | ProcessStartInfo processStartInfo = new ProcessStartInfo(ExecutablePath, parameterString); 123 | processStartInfo.WindowStyle = ProcessWindowStyle.Minimized; 124 | 125 | return Process.Start(processStartInfo); 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /CodeCrib.AX.Client/CodeCrib.AX.Client/CodeCrib.AX.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {9F793FC4-3616-44FA-8CED-6475C840BE00} 8 | Library 9 | Properties 10 | CodeCrib.AX.Client 11 | CodeCrib.AX.Client 12 | v3.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | -------------------------------------------------------------------------------- /CodeCrib.AX.Client/CodeCrib.AX.Client/CombineXPOs.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Text; 10 | using System.IO; 11 | using System.Text.RegularExpressions; 12 | using System.Linq; 13 | 14 | namespace CodeCrib.AX.Client 15 | { 16 | public class CombineXPOs 17 | { 18 | public enum IncludeObjects 19 | { 20 | AllObjects, 21 | ExcludeSystemObjects, 22 | SystemObjectsOnly 23 | } 24 | 25 | private static List defaultSystemClasses = new List() { "syssetupformrun.xpo", "info.xpo", "classfactory.xpo", "application.xpo", "session.xpo" }; 26 | public static List SystemClasses { get { return defaultSystemClasses; } set { defaultSystemClasses = value; } } 27 | 28 | const string XPOSTARTLINE1 = @"Exportfile for AOT version 1.0 or later"; 29 | const string XPOSTARTLINE2 = @"Formatversion: 1"; 30 | const string XPOENDLINE1 = @"***Element: END"; 31 | 32 | public static void Combine(string folder, bool recursive, string combinedXPOFilename, IncludeObjects inclusion) 33 | { 34 | CombineXPOs combine = new CombineXPOs(); 35 | List files = new List(); 36 | combine.GetFiles(folder, recursive, files); 37 | 38 | if (files.Count < 1) 39 | throw new Exception(String.Format("No XPO files found in {0}", folder)); 40 | 41 | switch (inclusion) 42 | { 43 | case IncludeObjects.AllObjects: 44 | // we already have this one 45 | break; 46 | case IncludeObjects.ExcludeSystemObjects: 47 | files = (from f in files where !SystemClasses.Contains(System.IO.Path.GetFileName(f)) select f).ToList(); 48 | break; 49 | case IncludeObjects.SystemObjectsOnly: 50 | files = (from f in files where SystemClasses.Contains(System.IO.Path.GetFileName(f)) select f).ToList(); 51 | break; 52 | } 53 | 54 | combine.Combine(files, combinedXPOFilename); 55 | } 56 | 57 | public void Combine(List files, string combinedXPOFilename) 58 | { 59 | if (files.Count != 0) 60 | { 61 | using (StreamWriter writer = new StreamWriter(combinedXPOFilename, false, Encoding.Unicode)) 62 | { 63 | writer.WriteLine(XPOSTARTLINE1); 64 | writer.WriteLine(XPOSTARTLINE2); 65 | 66 | List.Enumerator fileEnumerator = files.GetEnumerator(); 67 | while (fileEnumerator.MoveNext()) 68 | { 69 | Combine(fileEnumerator.Current, writer); 70 | } 71 | 72 | writer.WriteLine(XPOENDLINE1); 73 | writer.Flush(); 74 | } 75 | } 76 | } 77 | 78 | //protected void AddMacro(string macroName, string contents, StreamWriter combinedFile) 79 | //{ 80 | // string xpoText = ""; 81 | 82 | // xpoText = String.Format("***Element: MCR{0}", System.Environment.NewLine); 83 | // xpoText = String.Format("{0}{1}", xpoText, System.Environment.NewLine); 84 | // xpoText = String.Format("{0}; Microsoft Dynamics AX Macro: {1} unloaded{2}", xpoText, macroName, System.Environment.NewLine); 85 | // xpoText = String.Format("{0}; --------------------------------------------------------------------------------{1}", xpoText, System.Environment.NewLine); 86 | // xpoText = String.Format("{0} JOBVERSION 1{1}", xpoText, System.Environment.NewLine); 87 | // xpoText = String.Format("{0} {1}", xpoText, System.Environment.NewLine); 88 | // xpoText = String.Format("{0} SOURCE #{1}{2}", xpoText, macroName, System.Environment.NewLine); 89 | 90 | // string[] lines = contents.Split('\n'); 91 | // foreach (string line in lines) 92 | // { 93 | // xpoText = String.Format("{0} #{1}{2}", xpoText, line, System.Environment.NewLine); 94 | // } 95 | // xpoText = String.Format("{0} ENDSOURCE{1}", xpoText, System.Environment.NewLine); 96 | 97 | // combinedFile.Write(xpoText); 98 | //} 99 | 100 | protected void Combine(string filename, StreamWriter combinedFile) 101 | { 102 | using (StreamReader streamReader = new StreamReader(File.OpenRead(filename))) 103 | { 104 | while (!streamReader.EndOfStream) 105 | { 106 | string line = streamReader.ReadLine(); 107 | 108 | if (!line.Equals(XPOENDLINE1) 109 | && !line.Equals(XPOSTARTLINE1) 110 | && !line.Equals(XPOSTARTLINE2)) 111 | { 112 | combinedFile.WriteLine(line); 113 | } 114 | } 115 | } 116 | } 117 | 118 | protected void GetFiles(string directory, bool recursive, List files) 119 | { 120 | foreach (string filename in Directory.GetFiles(directory, "*.xpo")) 121 | { 122 | files.Add(filename); 123 | } 124 | 125 | if (recursive) 126 | { 127 | foreach (string subdirectory in Directory.GetDirectories(directory)) 128 | { 129 | GetFiles(subdirectory, recursive, files); 130 | } 131 | } 132 | } 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /CodeCrib.AX.Client/CodeCrib.AX.Client/CompileOutput.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.IO; 10 | using System.Text; 11 | using System.Xml; 12 | 13 | namespace CodeCrib.AX.Client 14 | { 15 | public class CompileOutputItem 16 | { 17 | public Int32 ElementType { get; set; } 18 | public string ElementName { get; set; } 19 | public string MethodName { get; set; } 20 | public string PropertyName { get; set; } 21 | public string TreeNodePath { get; set; } 22 | public Int32 LineNumber { get; set; } 23 | public Int32 ColumnNumber { get; set; } 24 | public Int16 Severity { get; set; } 25 | public string Message { get; set; } 26 | public Int32 ErrorCode { get; set; } 27 | public DateTime Date { get; set; } 28 | } 29 | 30 | public class CompileOutput 31 | { 32 | protected List output = new List(); 33 | public List Output 34 | { 35 | get 36 | { 37 | return output; 38 | } 39 | set 40 | { 41 | if (value == null) 42 | output = new List(); 43 | else 44 | output = value; 45 | } 46 | } 47 | 48 | protected XmlDocument ExtractXML(string filename) 49 | { 50 | string xml = ""; 51 | 52 | bool xmlBlock = false; 53 | using (StreamReader streamReader = new StreamReader(File.OpenRead(filename))) 54 | { 55 | while (!streamReader.EndOfStream) 56 | { 57 | string line = streamReader.ReadLine().Trim(); 58 | 59 | if (line == "") 60 | xmlBlock = true; 61 | 62 | if (!xmlBlock) 63 | continue; 64 | 65 | xml = String.Format("{0}{1}{2}", xml, line, System.Environment.NewLine); 66 | 67 | if (line == "") 68 | xmlBlock = false; 69 | } 70 | } 71 | 72 | XmlDocument doc = new XmlDocument(); 73 | doc.LoadXml(xml); 74 | 75 | return doc; 76 | } 77 | 78 | public void Parse(string filename) 79 | { 80 | output = new List(); 81 | 82 | XmlDocument doc = ExtractXML(filename); 83 | 84 | XmlNodeList nodes; 85 | System.Collections.IEnumerator nodeEnumerator; 86 | 87 | XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable); 88 | nsmgr.AddNamespace("Table", "urn:www.microsoft.com/Formats/Table"); 89 | nodes = doc.SelectNodes("//Table:Record", nsmgr); 90 | if (nodes != null) 91 | { 92 | nodeEnumerator = nodes.GetEnumerator(); 93 | while (nodeEnumerator.MoveNext()) 94 | { 95 | XmlNode node = nodeEnumerator.Current as XmlNode; 96 | 97 | CompileOutputItem item = new CompileOutputItem(); 98 | item.Severity = Int16.Parse(node.SelectSingleNode("Table:Field[@name='SysCompilerSeverity']", nsmgr).InnerText); 99 | item.TreeNodePath = node.SelectSingleNode("Table:Field[@name='TreeNodePath']", nsmgr).InnerText; 100 | item.LineNumber = Int32.Parse(node.SelectSingleNode("Table:Field[@name='Line']", nsmgr).InnerText); 101 | item.ColumnNumber = Int32.Parse(node.SelectSingleNode("Table:Field[@name='Column']", nsmgr).InnerText); 102 | item.Message = node.SelectSingleNode("Table:Field[@name='SysCompileErrorMessage']", nsmgr).InnerText; 103 | item.PropertyName = node.SelectSingleNode("Table:Field[@name='SysPropertyName']", nsmgr).InnerText; 104 | item.MethodName = node.SelectSingleNode("Table:Field[@name='SysAotMethodName']", nsmgr).InnerText; 105 | item.ErrorCode = Int32.Parse(node.SelectSingleNode("Table:Field[@name='CompileErrorCode']", nsmgr).InnerText); 106 | // UtilElementType not present in R2 CU7 log. 107 | XmlNode typeNode = node.SelectSingleNode("Table:Field[@name='UtilElementType']", nsmgr); 108 | if (typeNode != null) 109 | { 110 | item.ElementType = Int32.Parse(typeNode.InnerText); 111 | } 112 | item.ElementName = node.SelectSingleNode("Table:Field[@name='SysUtilElementName']", nsmgr).InnerText; 113 | item.Date = DateTime.Parse(node.SelectSingleNode("Table:Field[@name='createdDateTime']", nsmgr).InnerText); 114 | 115 | output.Add(item); 116 | } 117 | } 118 | } 119 | 120 | public static CompileOutput CreateFromFile(string filename) 121 | { 122 | CompileOutput output = new CompileOutput(); 123 | output.Parse(filename); 124 | 125 | return output; 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /CodeCrib.AX.Client/CodeCrib.AX.Client/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CodeCrib.AX.Client")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CodeCrib.AX.Client")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d6a11495-4e46-490d-bda7-defb24a63c92")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.9.1.0")] 36 | [assembly: AssemblyFileVersion("0.9.1.0")] 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.Client/CodeCrib.AX.Client/XPOLabelCheck.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Text; 10 | using System.IO; 11 | using System.Text.RegularExpressions; 12 | using System.Linq; 13 | 14 | namespace CodeCrib.AX.Client 15 | { 16 | public class XPOLabelCheck 17 | { 18 | public static List FindTempLabels(string folder, bool recursive) 19 | { 20 | XPOLabelCheck combine = new XPOLabelCheck(); 21 | List files = new List(); 22 | List filesWithTempLabels = new List(); 23 | combine.GetFiles(folder, recursive, files); 24 | 25 | if (files.Count < 1) 26 | { 27 | throw new Exception(String.Format("No XPO files found in {0}", folder)); 28 | } 29 | else 30 | { 31 | foreach (string filename in files) 32 | { 33 | using (StreamReader streamReader = new StreamReader(File.OpenRead(filename))) 34 | { 35 | while (!streamReader.EndOfStream) 36 | { 37 | string line = streamReader.ReadLine(); 38 | 39 | if (Regex.IsMatch(line, @"@\$[A-Z]{2}\d+")) 40 | { 41 | filesWithTempLabels.Add(filename); 42 | break; 43 | } 44 | } 45 | } 46 | } 47 | } 48 | 49 | return filesWithTempLabels; 50 | } 51 | 52 | protected void GetFiles(string directory, bool recursive, List files) 53 | { 54 | foreach (string filename in Directory.GetFiles(directory, "*.xpo")) 55 | { 56 | files.Add(filename); 57 | } 58 | 59 | if (recursive) 60 | { 61 | foreach (string subdirectory in Directory.GetDirectories(directory)) 62 | { 63 | GetFiles(subdirectory, recursive, files); 64 | } 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/AxConfig/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/AxConfig/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/AxConfig/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace AxConfig 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/AxConfig/AxConfig.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {0E0847B8-6684-44E4-8326-61BD7CF3BE61} 8 | WinExe 9 | Properties 10 | AxConfig 11 | AxConfig 12 | v4.5 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 4.0 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | MSBuild:Compile 54 | Designer 55 | 56 | 57 | MSBuild:Compile 58 | Designer 59 | 60 | 61 | App.xaml 62 | Code 63 | 64 | 65 | MainWindow.xaml 66 | Code 67 | 68 | 69 | 70 | 71 | Code 72 | 73 | 74 | True 75 | True 76 | Resources.resx 77 | 78 | 79 | True 80 | Settings.settings 81 | True 82 | 83 | 84 | ResXFileCodeGenerator 85 | Resources.Designer.cs 86 | 87 | 88 | SettingsSingleFileGenerator 89 | Settings.Designer.cs 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | {e84f034b-0fea-49a6-8cba-b801cb494533} 99 | CodeCrib.AX.Config 100 | 101 | 102 | 103 | 110 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/AxConfig/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/AxConfig/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace AxConfig 17 | { 18 | /// 19 | /// Interaction logic for MainWindow.xaml 20 | /// 21 | public partial class MainWindow : Window 22 | { 23 | public MainWindow() 24 | { 25 | InitializeComponent(); 26 | 27 | AOSes.ItemsSource = CodeCrib.AX.Config.Server.GetAOSInstances(); 28 | } 29 | 30 | private void AOSes_Selected(object sender, RoutedEventArgs e) 31 | { 32 | string aosName = (string)AOSes.SelectedItem; 33 | 34 | CodeCrib.AX.Config.Server config = CodeCrib.AX.Config.Server.GetConfigFromRegistry(aosName); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/AxConfig/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("AxConfig")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("AxConfig")] 15 | [assembly: AssemblyCopyright("Copyright © 2013")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/AxConfig/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18046 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AxConfig.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AxConfig.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/AxConfig/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/AxConfig/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18046 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AxConfig.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/AxConfig/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/CodeCrib.AX.Config.PowerShell/CodeCrib.AX.Config.PowerShell.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {CD47D20E-260C-4D33-A3E7-A0E9A801DF58} 8 | Library 9 | Properties 10 | CodeCrib.AX.Config.PowerShell 11 | CodeCrib.AX.Config.PowerShell 12 | v3.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | False 38 | ..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | {e84f034b-0fea-49a6-8cba-b801cb494533} 53 | CodeCrib.AX.Config 54 | 55 | 56 | 57 | 64 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/CodeCrib.AX.Config.PowerShell/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CodeCrib.AX.Config.PowerShell")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CodeCrib.AX.Config.PowerShell")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8846408f-bb59-4c6c-a174-9ec64c399aff")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/CodeCrib.AX.Config.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Config", "CodeCrib.AX.Config\CodeCrib.AX.Config.csproj", "{E84F034B-0FEA-49A6-8CBA-B801CB494533}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Config.PowerShell", "CodeCrib.AX.Config.PowerShell\CodeCrib.AX.Config.PowerShell.csproj", "{CD47D20E-260C-4D33-A3E7-A0E9A801DF58}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AxConfig", "AxConfig\AxConfig.csproj", "{0E0847B8-6684-44E4-8326-61BD7CF3BE61}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {E84F034B-0FEA-49A6-8CBA-B801CB494533}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {E84F034B-0FEA-49A6-8CBA-B801CB494533}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {E84F034B-0FEA-49A6-8CBA-B801CB494533}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {E84F034B-0FEA-49A6-8CBA-B801CB494533}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {CD47D20E-260C-4D33-A3E7-A0E9A801DF58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {CD47D20E-260C-4D33-A3E7-A0E9A801DF58}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {CD47D20E-260C-4D33-A3E7-A0E9A801DF58}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {CD47D20E-260C-4D33-A3E7-A0E9A801DF58}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {0E0847B8-6684-44E4-8326-61BD7CF3BE61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {0E0847B8-6684-44E4-8326-61BD7CF3BE61}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {0E0847B8-6684-44E4-8326-61BD7CF3BE61}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {0E0847B8-6684-44E4-8326-61BD7CF3BE61}.Release|Any CPU.Build.0 = Release|Any CPU 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/CodeCrib.AX.Config/CodeCrib.AX.Config.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {E84F034B-0FEA-49A6-8CBA-B801CB494533} 8 | Library 9 | Properties 10 | CodeCrib.AX.Config 11 | CodeCrib.AX.Config 12 | v3.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 56 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/CodeCrib.AX.Config/ConfigProperty.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | 12 | namespace CodeCrib.AX.Config 13 | { 14 | [Serializable] 15 | public class ConfigProperty 16 | { 17 | public string Name 18 | { 19 | get; 20 | set; 21 | } 22 | public string DataType 23 | { 24 | get; 25 | set; 26 | } 27 | public string Value 28 | { 29 | get; 30 | set; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /CodeCrib.AX.Config/CodeCrib.AX.Config/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CodeCrib.AX.Config")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CodeCrib.AX.Config")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8499da4a-4e75-493a-a889-d39d02e7cbe7")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.1")] 36 | [assembly: AssemblyFileVersion("1.0.0.1")] 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/AxManage/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/AxManage/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/AxManage/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace AxManage 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/AxManage/AxManage.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {8BB6FBE2-5182-48CB-B5A2-2D5182A9FE39} 8 | WinExe 9 | Properties 10 | AxManage 11 | AxManage 12 | v4.5 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 4.0 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | MSBuild:Compile 54 | Designer 55 | 56 | 57 | MSBuild:Compile 58 | Designer 59 | 60 | 61 | App.xaml 62 | Code 63 | 64 | 65 | MainWindow.xaml 66 | Code 67 | 68 | 69 | 70 | 71 | Code 72 | 73 | 74 | True 75 | True 76 | Resources.resx 77 | 78 | 79 | True 80 | Settings.settings 81 | True 82 | 83 | 84 | ResXFileCodeGenerator 85 | Resources.Designer.cs 86 | 87 | 88 | SettingsSingleFileGenerator 89 | Settings.Designer.cs 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | {9696d89c-9df8-43d0-b870-cbd4cabc8ba1} 99 | CodeCrib.AX.Manage 100 | 101 | 102 | 103 | 110 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/AxManage/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/AxManage/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace AxManage 17 | { 18 | /// 19 | /// Interaction logic for MainWindow.xaml 20 | /// 21 | public partial class MainWindow : Window 22 | { 23 | public MainWindow() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/AxManage/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("AxManage")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("AxManage")] 15 | [assembly: AssemblyCopyright("Copyright © 2013")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/AxManage/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18046 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AxManage.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AxManage.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/AxManage/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/AxManage/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18046 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AxManage.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/AxManage/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/CodeCrib.AX.Manage.PowerShell/AOS.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Management.Automation; 5 | using System.Text; 6 | 7 | namespace CodeCrib.AX.Manage.PowerShell 8 | { 9 | [Cmdlet(VerbsLifecycle.Start, "AOS")] 10 | public class Start_AOS : PSCmdlet 11 | { 12 | [Parameter(HelpMessage = "AOS Number", Mandatory = true)] 13 | public uint aosNumber; 14 | 15 | [Parameter(HelpMessage = "Timeout (in minutes)", Mandatory = false)] 16 | public int timeOutMinutes; 17 | 18 | protected override void ProcessRecord() 19 | { 20 | CodeCrib.AX.Manage.AOS aos = new AOS(aosNumber); 21 | 22 | aos.Start(timeOutMinutes); 23 | } 24 | } 25 | 26 | [Cmdlet(VerbsLifecycle.Stop, "AOS")] 27 | public class Stop_AOS : PSCmdlet 28 | { 29 | [Parameter(HelpMessage = "AOS Number", Mandatory = true)] 30 | public uint aosNumber; 31 | 32 | [Parameter(HelpMessage = "Timeout (in minutes)", Mandatory = false)] 33 | public int timeOutMinutes; 34 | 35 | protected override void ProcessRecord() 36 | { 37 | CodeCrib.AX.Manage.AOS aos = new AOS(aosNumber); 38 | 39 | aos.Stop(timeOutMinutes); 40 | } 41 | } 42 | 43 | [Cmdlet(VerbsCommon.Get, "AOSStatus")] 44 | public class Get_AOSStatus : PSCmdlet 45 | { 46 | [Parameter(HelpMessage = "AOS Number", Mandatory = true)] 47 | public uint aosNumber; 48 | 49 | protected override void ProcessRecord() 50 | { 51 | CodeCrib.AX.Manage.AOS aos = new AOS(aosNumber); 52 | 53 | this.WriteObject(aos.Status); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/CodeCrib.AX.Manage.PowerShell/CodeCrib.AX.Manage.PowerShell.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {910DDB69-0CE4-4486-B5E3-C2F6EC2422DF} 8 | Library 9 | Properties 10 | CodeCrib.AX.Manage.PowerShell 11 | CodeCrib.AX.Manage.PowerShell 12 | v3.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | False 38 | ..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\3.0\System.Management.Automation.dll 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | {9696d89c-9df8-43d0-b870-cbd4cabc8ba1} 54 | CodeCrib.AX.Manage 55 | 56 | 57 | 58 | 65 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/CodeCrib.AX.Manage.PowerShell/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CodeCrib.AX.Manage.PowerShell")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CodeCrib.AX.Manage.PowerShell")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("1f486069-291e-4a89-b203-9e638e30738f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.9.0.0")] 36 | [assembly: AssemblyFileVersion("0.9.0.0")] 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/CodeCrib.AX.Manage.PowerShell/Server.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Management.Automation; 5 | using System.Text; 6 | 7 | namespace CodeCrib.AX.Manage.PowerShell 8 | { 9 | [Cmdlet(VerbsCommon.Get, "Server")] 10 | public class Get_Server : PSCmdlet 11 | { 12 | [Parameter(HelpMessage = "Name of the server, if ommitted uses localhost", Mandatory = false, ParameterSetName = "configurationserverport")] 13 | //[Parameter(Mandatory = true, ParameterSetName = "configurationserverport")] 14 | public string server; 15 | 16 | [Parameter(HelpMessage = "WSDL port for specific AOS on the server", Mandatory = true, ParameterSetName = "configurationserverport")] 17 | public int wsdlport; 18 | 19 | [Parameter(HelpMessage = "Gets the configuration for the specific aos on server", Mandatory = true, ParameterSetName = "configurationserverport")] 20 | public SwitchParameter configuration; 21 | 22 | protected override void ProcessRecord() 23 | { 24 | switch (this.ParameterSetName) 25 | { 26 | case "configurationserverport": 27 | if (string.IsNullOrEmpty(server)) 28 | { 29 | this.WriteObject(CodeCrib.AX.Manage.ServerConfiguration.Get()); 30 | } 31 | else 32 | { 33 | this.WriteObject(CodeCrib.AX.Manage.ServerConfiguration.Get(server, wsdlport)); 34 | } 35 | break; 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/CodeCrib.AX.Manage.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Manage", "CodeCrib.AX.Manage\CodeCrib.AX.Manage.csproj", "{9696D89C-9DF8-43D0-B870-CBD4CABC8BA1}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AxManage", "AxManage\AxManage.csproj", "{8BB6FBE2-5182-48CB-B5A2-2D5182A9FE39}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Manage.PowerShell", "CodeCrib.AX.Manage.PowerShell\CodeCrib.AX.Manage.PowerShell.csproj", "{910DDB69-0CE4-4486-B5E3-C2F6EC2422DF}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {9696D89C-9DF8-43D0-B870-CBD4CABC8BA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {9696D89C-9DF8-43D0-B870-CBD4CABC8BA1}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {9696D89C-9DF8-43D0-B870-CBD4CABC8BA1}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {9696D89C-9DF8-43D0-B870-CBD4CABC8BA1}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {8BB6FBE2-5182-48CB-B5A2-2D5182A9FE39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {8BB6FBE2-5182-48CB-B5A2-2D5182A9FE39}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {8BB6FBE2-5182-48CB-B5A2-2D5182A9FE39}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {8BB6FBE2-5182-48CB-B5A2-2D5182A9FE39}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {910DDB69-0CE4-4486-B5E3-C2F6EC2422DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {910DDB69-0CE4-4486-B5E3-C2F6EC2422DF}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {910DDB69-0CE4-4486-B5E3-C2F6EC2422DF}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {910DDB69-0CE4-4486-B5E3-C2F6EC2422DF}.Release|Any CPU.Build.0 = Release|Any CPU 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/CodeCrib.AX.Manage/AOS.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.ServiceProcess; 9 | 10 | namespace CodeCrib.AX.Manage 11 | { 12 | public class AOS 13 | { 14 | uint serviceNumber; 15 | ServiceController service = null; 16 | 17 | public AOS(uint serviceNumber) 18 | { 19 | this.serviceNumber = serviceNumber; 20 | service = new ServiceController(string.Format("AOS60${0}", serviceNumber.ToString("D2"))); 21 | } 22 | 23 | public Boolean IsRunning 24 | { 25 | get 26 | { 27 | if (service.Status == ServiceControllerStatus.Running) 28 | return true; 29 | 30 | return false; 31 | } 32 | } 33 | 34 | public string Status 35 | { 36 | get 37 | { 38 | return service.Status.ToString(); 39 | } 40 | } 41 | 42 | public void Start(int timeOutMinutes = 0) 43 | { 44 | if (service.Status == ServiceControllerStatus.Running) 45 | return; 46 | 47 | if (service.Status != ServiceControllerStatus.StartPending) 48 | service.Start(); 49 | 50 | if (timeOutMinutes > 0) 51 | service.WaitForStatus(ServiceControllerStatus.Running, new TimeSpan(0, timeOutMinutes, 0)); 52 | else 53 | service.WaitForStatus(ServiceControllerStatus.Running); 54 | } 55 | 56 | public void Stop(int timeOutMinutes = 0) 57 | { 58 | if (service.Status == ServiceControllerStatus.Stopped) 59 | return; 60 | 61 | if (service.Status != ServiceControllerStatus.StopPending) 62 | service.Stop(); 63 | 64 | if (timeOutMinutes > 0) 65 | service.WaitForStatus(ServiceControllerStatus.Stopped, new TimeSpan(0, timeOutMinutes, 0)); 66 | else 67 | service.WaitForStatus(ServiceControllerStatus.Stopped); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/CodeCrib.AX.Manage/CodeCrib.AX.Manage.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {9696D89C-9DF8-43D0-B870-CBD4CABC8BA1} 8 | Library 9 | Properties 10 | CodeCrib.AX.Manage 11 | CodeCrib.AX.Manage 12 | v3.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | ..\..\..\..\..\Program Files\Microsoft Dynamics AX\60\ManagementUtilities\AXUtilLib.dll 36 | False 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 69 | -------------------------------------------------------------------------------- /CodeCrib.AX.Manage/CodeCrib.AX.Manage/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CodeCrib.AX.Manage")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CodeCrib.AX.Manage")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d008e05e-a274-41ba-bf56-34f7189bd1ad")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.9.1.0")] 36 | [assembly: AssemblyFileVersion("0.9.1.0")] 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/AxSetup/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/AxSetup/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/AxSetup/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace AxSetup 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/AxSetup/AxSetup.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {A610BF4E-EF5F-4B1D-9F26-E3ADE5E3F596} 8 | WinExe 9 | Properties 10 | AxSetup 11 | AxSetup 12 | v4.5 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 4.0 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | MSBuild:Compile 54 | Designer 55 | 56 | 57 | MSBuild:Compile 58 | Designer 59 | 60 | 61 | App.xaml 62 | Code 63 | 64 | 65 | MainWindow.xaml 66 | Code 67 | 68 | 69 | 70 | 71 | Code 72 | 73 | 74 | True 75 | True 76 | Resources.resx 77 | 78 | 79 | True 80 | Settings.settings 81 | True 82 | 83 | 84 | ResXFileCodeGenerator 85 | Resources.Designer.cs 86 | 87 | 88 | SettingsSingleFileGenerator 89 | Settings.Designer.cs 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | {427dd4b0-a0e9-42c9-a6c7-5e4a0a217398} 99 | CodeCrib.AX.Setup 100 | 101 | 102 | 103 | 110 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/AxSetup/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 18 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/AxSetup/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | using System.Windows; 13 | using System.Windows.Controls; 14 | using System.Windows.Data; 15 | using System.Windows.Documents; 16 | using System.Windows.Input; 17 | using System.Windows.Media; 18 | using System.Windows.Media.Imaging; 19 | using System.Windows.Navigation; 20 | using System.Windows.Shapes; 21 | using Microsoft.Win32; 22 | 23 | namespace AxSetup 24 | { 25 | /// 26 | /// Interaction logic for MainWindow.xaml 27 | /// 28 | public partial class MainWindow : Window 29 | { 30 | public MainWindow() 31 | { 32 | InitializeComponent(); 33 | 34 | List parameters = new List(); 35 | 36 | ParameterListView.ItemsSource = parameters; 37 | } 38 | 39 | private void OpenButton_Click(object sender, RoutedEventArgs e) 40 | { 41 | OpenFileDialog dialog = new OpenFileDialog(); 42 | 43 | dialog.Filter = "All Files|*.*"; 44 | if (dialog.ShowDialog() == true) 45 | { 46 | ParameterListView.ItemsSource = CodeCrib.AX.Setup.ParameterFile.Open(dialog.FileName); 47 | } 48 | } 49 | 50 | private void SaveButton_Click(object sender, RoutedEventArgs e) 51 | { 52 | if (ParameterListView.ItemsSource != null && ParameterListView.ItemsSource is List) 53 | { 54 | SaveFileDialog dialog = new SaveFileDialog(); 55 | 56 | dialog.Filter = "All Files|*.*"; 57 | dialog.OverwritePrompt = true; 58 | if (dialog.ShowDialog() == true) 59 | { 60 | CodeCrib.AX.Setup.ParameterFile.Save(ParameterListView.ItemsSource as List, dialog.FileName); 61 | } 62 | } 63 | else 64 | { 65 | MessageBox.Show("No parameters to save"); 66 | } 67 | } 68 | 69 | private void ParseLogFileButton_Click(object sender, RoutedEventArgs e) 70 | { 71 | OpenFileDialog dialog = new OpenFileDialog(); 72 | 73 | dialog.Filter = "Log Files|*.txt"; 74 | 75 | if (System.IO.Directory.Exists(@"C:\Program Files\Microsoft Dynamics AX\60\Setup Logs\")) 76 | { 77 | dialog.InitialDirectory = @"C:\Program Files\Microsoft Dynamics AX\60\Setup Logs\"; 78 | } 79 | 80 | if (dialog.ShowDialog() == true) 81 | { 82 | ParameterListView.ItemsSource = CodeCrib.AX.Setup.LogParser.LogExtract(dialog.FileName); 83 | } 84 | } 85 | 86 | private void RunSetupButton_Click(object sender, RoutedEventArgs e) 87 | { 88 | if (ParameterListView.ItemsSource != null && ParameterListView.ItemsSource is List) 89 | { 90 | OpenFileDialog dialog = new OpenFileDialog(); 91 | 92 | dialog.Filter = "Dynamics AX Setup|setup.exe"; 93 | 94 | if (dialog.ShowDialog() == true) 95 | { 96 | CodeCrib.AX.Setup.Setup setup = new CodeCrib.AX.Setup.Setup(); 97 | setup.ExecutablePath = dialog.FileName; 98 | setup.Run(ParameterListView.ItemsSource as List); 99 | } 100 | } 101 | else 102 | { 103 | MessageBox.Show("No parameters"); 104 | } 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/AxSetup/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("AxSetup")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("AxSetup")] 15 | [assembly: AssemblyCopyright("Copyright © 2013")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/AxSetup/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18046 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AxSetup.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AxSetup.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/AxSetup/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/AxSetup/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18046 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AxSetup.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/AxSetup/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/CodeCrib.AX.Setup.PowerShell/CodeCrib.AX.Setup.PowerShell.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {6707D0A5-4582-4875-9826-C5CD9C6E2C9B} 8 | Library 9 | Properties 10 | CodeCrib.AX.Setup.PowerShell 11 | CodeCrib.AX.Setup.PowerShell 12 | v3.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | False 38 | ..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | {427dd4b0-a0e9-42c9-a6c7-5e4a0a217398} 52 | CodeCrib.AX.Setup 53 | 54 | 55 | 56 | 63 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/CodeCrib.AX.Setup.PowerShell/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CodeCrib.AX.Setup.PowerShell")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CodeCrib.AX.Setup.PowerShell")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9cf3254b-06bd-4664-9fbb-77ca131f4b34")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/CodeCrib.AX.Setup.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AxSetup", "AxSetup\AxSetup.csproj", "{A610BF4E-EF5F-4B1D-9F26-E3ADE5E3F596}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Setup", "CodeCrib.AX.Setup\CodeCrib.AX.Setup.csproj", "{427DD4B0-A0E9-42C9-A6C7-5E4A0A217398}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Setup.PowerShell", "CodeCrib.AX.Setup.PowerShell\CodeCrib.AX.Setup.PowerShell.csproj", "{6707D0A5-4582-4875-9826-C5CD9C6E2C9B}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {A610BF4E-EF5F-4B1D-9F26-E3ADE5E3F596}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {A610BF4E-EF5F-4B1D-9F26-E3ADE5E3F596}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {A610BF4E-EF5F-4B1D-9F26-E3ADE5E3F596}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {A610BF4E-EF5F-4B1D-9F26-E3ADE5E3F596}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {427DD4B0-A0E9-42C9-A6C7-5E4A0A217398}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {427DD4B0-A0E9-42C9-A6C7-5E4A0A217398}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {427DD4B0-A0E9-42C9-A6C7-5E4A0A217398}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {427DD4B0-A0E9-42C9-A6C7-5E4A0A217398}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {6707D0A5-4582-4875-9826-C5CD9C6E2C9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {6707D0A5-4582-4875-9826-C5CD9C6E2C9B}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {6707D0A5-4582-4875-9826-C5CD9C6E2C9B}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {6707D0A5-4582-4875-9826-C5CD9C6E2C9B}.Release|Any CPU.Build.0 = Release|Any CPU 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/CodeCrib.AX.Setup/CodeCrib.AX.Setup.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {427DD4B0-A0E9-42C9-A6C7-5E4A0A217398} 8 | Library 9 | Properties 10 | CodeCrib.AX.Setup 11 | CodeCrib.AX.Setup 12 | v3.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 56 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/CodeCrib.AX.Setup/LogParser.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Text.RegularExpressions; 12 | 13 | namespace CodeCrib.AX.Setup 14 | { 15 | public class LogParser 16 | { 17 | /// 18 | /// Parse a setup log file and extract setup parameters 19 | /// 20 | /// Path and filename of a Dynamics Ax Setup log file 21 | /// List of parameters extracted from the log 22 | public static List LogExtract(string filename) 23 | { 24 | List parameters = new List(); 25 | System.IO.StreamReader reader = new System.IO.StreamReader(filename); 26 | 27 | while (!reader.EndOfStream) 28 | { 29 | string line = reader.ReadLine(); 30 | 31 | string[] columns = line.Split('\t'); 32 | if (columns.Count() > 1) 33 | { 34 | var match = Regex.Match(columns[1], @"^Property ([\w\d]+) set to: '(.*)'$"); 35 | if (match.Success) 36 | { 37 | Parameter param = parameters.FirstOrDefault(x => x.Name == match.Groups[1].Value); 38 | if (param != null) 39 | { 40 | param.Value = match.Groups[2].Value; 41 | } 42 | else 43 | { 44 | parameters.Add(new Parameter() { Name = match.Groups[1].Value, Value = match.Groups[2].Value, Enabled = true }); 45 | } 46 | } 47 | } 48 | } 49 | 50 | return parameters; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/CodeCrib.AX.Setup/Parameter.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Xml.Serialization; 12 | 13 | namespace CodeCrib.AX.Setup 14 | { 15 | [Serializable] 16 | public class Parameter 17 | { 18 | public string Name 19 | { 20 | get; 21 | set; 22 | } 23 | 24 | public string Value 25 | { 26 | get; 27 | set; 28 | } 29 | 30 | public bool Enabled 31 | { 32 | get; 33 | set; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/CodeCrib.AX.Setup/ParameterFile.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | 12 | namespace CodeCrib.AX.Setup 13 | { 14 | public class ParameterFile 15 | { 16 | /// 17 | /// Save parameters to a valid Dynamics AX Setup parameter file 18 | /// 19 | /// List of parameters 20 | /// Path and filename of parameters file; will overwrite if already exists 21 | public static void Save(List parameters, string fileName) 22 | { 23 | System.IO.StreamWriter writer = new System.IO.StreamWriter(fileName); 24 | 25 | foreach (Parameter parameter in parameters) 26 | { 27 | if (!parameter.Enabled) 28 | writer.Write("#"); 29 | 30 | writer.WriteLine(string.Format("{0}={1}", parameter.Name, parameter.Value)); 31 | } 32 | 33 | writer.Flush(); 34 | writer.Close(); 35 | } 36 | 37 | /// 38 | /// Read a Dynamics AX Setup parameters file 39 | /// 40 | /// Path and filename of parameter file to open 41 | /// List of parameters from the file 42 | public static List Open(string fileName) 43 | { 44 | List parameters = new List(); 45 | System.IO.StreamReader reader = new System.IO.StreamReader(fileName); 46 | 47 | while (!reader.EndOfStream) 48 | { 49 | bool commentedLine = false; 50 | string line = reader.ReadLine().Trim(); 51 | 52 | commentedLine = line.StartsWith("#"); 53 | // don't split after # if the string doesn't go beyond it, the column count won't equal 2 anyway 54 | if (commentedLine && line.Length >= line.IndexOf("#") + 1) 55 | { 56 | line = line.Substring(line.IndexOf("#") + 1); 57 | } 58 | 59 | string[] columns = line.Split('='); 60 | if (columns.Count() == 2) 61 | { 62 | Parameter param = parameters.FirstOrDefault(x => x.Name == columns[0]); 63 | if (param != null) 64 | { 65 | // If line is commented, don't update parameter if it appeared before 66 | if (!commentedLine) 67 | { 68 | param.Value = columns[1]; 69 | } 70 | } 71 | else 72 | { 73 | parameters.Add(new Parameter() { Name = columns[0].Trim(), Value = columns[1], Enabled = !commentedLine }); 74 | } 75 | } 76 | else 77 | { 78 | //Console.WriteLine(string.Format("Couldn't parse line '{0}'", line)); 79 | } 80 | } 81 | 82 | reader.Close(); 83 | 84 | return parameters; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/CodeCrib.AX.Setup/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CodeCrib.AX.Setup")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CodeCrib.AX.Setup")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d8113588-fa66-40fc-a334-2964512712fb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.Setup/CodeCrib.AX.Setup/Setup.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Diagnostics; 10 | using System.Linq; 11 | using System.Text; 12 | 13 | namespace CodeCrib.AX.Setup 14 | { 15 | public class Setup 16 | { 17 | /// 18 | /// Path and filename of Dynamics AX setup executable 19 | /// 20 | public string ExecutablePath 21 | { 22 | get; 23 | set; 24 | } 25 | 26 | /// 27 | /// Path and filename of setup parameters file 28 | /// 29 | public string ParametersFile 30 | { 31 | get; 32 | set; 33 | } 34 | 35 | /// 36 | /// Run Dynamics AX Setup as specified in ExecutablePath property, and pass in list of parameters. 37 | /// This will save the parameters as a file in the %temp% folder of the current user. 38 | /// This method will wait for the setup to exit. 39 | /// 40 | /// List of parameters to use for setup 41 | /// Exit code of the Dynamics AX Setup program 42 | public int Run(List parameters) 43 | { 44 | string filename = string.Format(@"{0}\{1}.txt", Environment.GetEnvironmentVariable("TEMP"), Guid.NewGuid().ToString()); 45 | ParameterFile.Save(parameters, filename); 46 | 47 | return Run(filename); 48 | } 49 | 50 | /// 51 | /// Run Dynamics AX Setup as specified in ExecutablePath property, and pass parameters file specified in the ParametersFile property. 52 | /// This method will wait for the setup to exit. 53 | /// 54 | /// Exit code of the Dynamics AX Setup program 55 | public int Run() 56 | { 57 | return Run(ParametersFile); 58 | } 59 | 60 | /// 61 | /// Run Dynamics AX Setup as specified in ExecutablePath property 62 | /// This method will wait for the setup to exit. 63 | /// 64 | /// Path and filename of parameters file to pass to setup 65 | /// Exit code of the Dynamics AX Setup program 66 | public int Run(string filename) 67 | { 68 | Process axSetup = Process.Start(ExecutablePath, string.Format("Parmfile=\"{0}\"", filename)); 69 | 70 | axSetup.WaitForExit(); 71 | 72 | return axSetup.ExitCode; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /CodeCrib.AX.Sql/CodeCrib.AX.Sql.PowerShell/CodeCrib.AX.Sql.PowerShell.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {D6765785-9568-4A8C-A6CB-6AEEBEC7ACC1} 8 | Library 9 | Properties 10 | CodeCrib.AX.Sql.PowerShell 11 | CodeCrib.AX.Sql.PowerShell 12 | v3.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | False 38 | ..\..\..\..\..\Windows\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | {5d785ef3-abf3-4038-8711-de346d55c5d3} 56 | CodeCrib.AX.Sql 57 | 58 | 59 | 60 | 67 | -------------------------------------------------------------------------------- /CodeCrib.AX.Sql/CodeCrib.AX.Sql.PowerShell/Disable_CustomerExperience.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Management.Automation; 5 | using System.Text; 6 | 7 | namespace CodeCrib.AX.Sql.PowerShell 8 | { 9 | [Cmdlet(VerbsLifecycle.Disable, "CustomerExperience")] 10 | public class Disable_CustomerExperience : PSCmdlet 11 | { 12 | [Parameter(HelpMessage = "Name of the SQL server instance", Mandatory = true)] 13 | public string serverName; 14 | 15 | [Parameter(HelpMessage = "Name of the database", Mandatory = true)] 16 | public string databaseName; 17 | 18 | protected override void ProcessRecord() 19 | { 20 | DbManagement.DisableCustomerExperienceDialog(serverName, databaseName); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CodeCrib.AX.Sql/CodeCrib.AX.Sql.PowerShell/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CodeCrib.AX.Sql.PowerShell")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CodeCrib.AX.Sql.PowerShell")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c842b0a5-e43a-492d-9425-da87086bd75f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.9.0.0")] 36 | [assembly: AssemblyFileVersion("0.9.0.0")] 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.Sql/CodeCrib.AX.Sql.PowerShell/Reset_Admin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Management.Automation; 5 | using System.Text; 6 | 7 | namespace CodeCrib.AX.Sql.PowerShell 8 | { 9 | [Cmdlet(VerbsCommon.Reset, "Admin")] 10 | public class Reset_Admin : PSCmdlet 11 | { 12 | [Parameter(HelpMessage = "Name of the SQL server instance", Mandatory = true)] 13 | public string serverName; 14 | 15 | [Parameter(HelpMessage = "Name of the database", Mandatory = true)] 16 | public string databaseName; 17 | 18 | protected override void ProcessRecord() 19 | { 20 | DbManagement.ResetAdminUser(serverName, databaseName); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CodeCrib.AX.Sql/CodeCrib.AX.Sql.PowerShell/Reset_GlobalGuid.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Management.Automation; 12 | 13 | namespace CodeCrib.AX.Sql.PowerShell 14 | { 15 | [Cmdlet(VerbsCommon.Reset, "GlobalGuid")] 16 | public class Reset_GlobalGuid : PSCmdlet 17 | { 18 | [Parameter(HelpMessage = "Name of the SQL server instance", Mandatory = true)] 19 | public string serverName; 20 | 21 | [Parameter(HelpMessage = "Name of the database to reset the global GUID in", Mandatory = true)] 22 | public string databaseName; 23 | 24 | protected override void ProcessRecord() 25 | { 26 | DbManagement.ResetGlobalGuid(serverName, databaseName); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CodeCrib.AX.Sql/CodeCrib.AX.Sql.PowerShell/Restore_SqlDb.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Management.Automation; 12 | 13 | namespace CodeCrib.AX.Sql.PowerShell 14 | { 15 | [Cmdlet(VerbsData.Restore, "SqlDB")] 16 | public class Restore_SqlDb : PSCmdlet 17 | { 18 | [Parameter(HelpMessage = "Name of the SQL server instance", Mandatory = true)] 19 | public string serverName; 20 | 21 | [Parameter(HelpMessage = "Path to the database backup file", Mandatory = true)] 22 | public string filename; 23 | 24 | [Parameter(HelpMessage = "Name of the database to restore to", Mandatory = true)] 25 | public string databaseName; 26 | 27 | protected override void ProcessRecord() 28 | { 29 | DbManagement.RestoreDbFromFile(serverName, databaseName, filename); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /CodeCrib.AX.Sql/CodeCrib.AX.Sql.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Sql", "CodeCrib.AX.Sql\CodeCrib.AX.Sql.csproj", "{5D785EF3-ABF3-4038-8711-DE346D55C5D3}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Sql.PowerShell", "CodeCrib.AX.Sql.PowerShell\CodeCrib.AX.Sql.PowerShell.csproj", "{D6765785-9568-4A8C-A6CB-6AEEBEC7ACC1}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {5D785EF3-ABF3-4038-8711-DE346D55C5D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {5D785EF3-ABF3-4038-8711-DE346D55C5D3}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {5D785EF3-ABF3-4038-8711-DE346D55C5D3}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {5D785EF3-ABF3-4038-8711-DE346D55C5D3}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {D6765785-9568-4A8C-A6CB-6AEEBEC7ACC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {D6765785-9568-4A8C-A6CB-6AEEBEC7ACC1}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {D6765785-9568-4A8C-A6CB-6AEEBEC7ACC1}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {D6765785-9568-4A8C-A6CB-6AEEBEC7ACC1}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /CodeCrib.AX.Sql/CodeCrib.AX.Sql/CodeCrib.AX.Sql.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {5D785EF3-ABF3-4038-8711-DE346D55C5D3} 8 | Library 9 | Properties 10 | CodeCrib.AX.Sql 11 | CodeCrib.AX.Sql 12 | v3.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | False 36 | ..\..\..\..\..\..\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SqlServer.ConnectionInfo.dll 37 | 38 | 39 | False 40 | ..\..\..\..\..\..\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SqlServer.Management.Sdk.Sfc.dll 41 | 42 | 43 | False 44 | ..\..\..\..\..\..\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SqlServer.Smo.dll 45 | 46 | 47 | False 48 | ..\..\..\..\..\..\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SqlServer.SmoExtended.dll 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 70 | -------------------------------------------------------------------------------- /CodeCrib.AX.Sql/CodeCrib.AX.Sql/DbServerExtensions.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using Microsoft.SqlServer.Management.Smo; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Text; 12 | 13 | namespace CodeCrib.AX.Sql 14 | { 15 | static class DbServerExtensions 16 | { 17 | public static string DataPath(this Server server) 18 | { 19 | // If the default data path has never been modified from the original 20 | // value, the DefaultFile property may be blank. 21 | if (String.IsNullOrEmpty(server.Settings.DefaultFile)) 22 | { 23 | return server.Information.MasterDBPath; 24 | } 25 | 26 | return server.Settings.DefaultFile; 27 | } 28 | 29 | public static string LogPath(this Server server) 30 | { 31 | // If the default log path has never been modified from the original 32 | // value, the DefaultFile property may be blank. 33 | if (String.IsNullOrEmpty(server.Settings.DefaultLog)) 34 | { 35 | return server.Information.MasterDBLogPath; 36 | } 37 | 38 | return server.Settings.DefaultLog; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /CodeCrib.AX.Sql/CodeCrib.AX.Sql/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CodeCrib.AX.Sql")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CodeCrib.AX.Sql")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6a0498bf-4ee2-4d81-9d3a-92305686833e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.9.1.0")] 36 | [assembly: AssemblyFileVersion("0.9.1.0")] 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.TFS/CodeCrib.AX.TFS.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.TFS", "CodeCrib.AX.TFS\CodeCrib.AX.TFS.csproj", "{F622C66F-77C0-4965-B9CD-3871BC9EB71B}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Client", "..\CodeCrib.AX.Client\CodeCrib.AX.Client\CodeCrib.AX.Client.csproj", "{9F793FC4-3616-44FA-8CED-6475C840BE00}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Config", "..\CodeCrib.AX.Config\CodeCrib.AX.Config\CodeCrib.AX.Config.csproj", "{E84F034B-0FEA-49A6-8CBA-B801CB494533}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Manage", "..\CodeCrib.AX.Manage\CodeCrib.AX.Manage\CodeCrib.AX.Manage.csproj", "{9696D89C-9DF8-43D0-B870-CBD4CABC8BA1}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.Sql", "..\CodeCrib.AX.Sql\CodeCrib.AX.Sql\CodeCrib.AX.Sql.csproj", "{5D785EF3-ABF3-4038-8711-DE346D55C5D3}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCrib.AX.AXBuild", "..\CodeCrib.AX.AXBuild\CodeCrib.AX.AXBuild\CodeCrib.AX.AXBuild.csproj", "{C1E5B831-90A6-4AB5-80DD-7918F817AFE7}" 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Release|Any CPU = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {F622C66F-77C0-4965-B9CD-3871BC9EB71B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {F622C66F-77C0-4965-B9CD-3871BC9EB71B}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {F622C66F-77C0-4965-B9CD-3871BC9EB71B}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {F622C66F-77C0-4965-B9CD-3871BC9EB71B}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {9F793FC4-3616-44FA-8CED-6475C840BE00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {9F793FC4-3616-44FA-8CED-6475C840BE00}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {9F793FC4-3616-44FA-8CED-6475C840BE00}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {9F793FC4-3616-44FA-8CED-6475C840BE00}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {E84F034B-0FEA-49A6-8CBA-B801CB494533}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {E84F034B-0FEA-49A6-8CBA-B801CB494533}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {E84F034B-0FEA-49A6-8CBA-B801CB494533}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {E84F034B-0FEA-49A6-8CBA-B801CB494533}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {9696D89C-9DF8-43D0-B870-CBD4CABC8BA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {9696D89C-9DF8-43D0-B870-CBD4CABC8BA1}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {9696D89C-9DF8-43D0-B870-CBD4CABC8BA1}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {9696D89C-9DF8-43D0-B870-CBD4CABC8BA1}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {5D785EF3-ABF3-4038-8711-DE346D55C5D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {5D785EF3-ABF3-4038-8711-DE346D55C5D3}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {5D785EF3-ABF3-4038-8711-DE346D55C5D3}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {5D785EF3-ABF3-4038-8711-DE346D55C5D3}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {C1E5B831-90A6-4AB5-80DD-7918F817AFE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {C1E5B831-90A6-4AB5-80DD-7918F817AFE7}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {C1E5B831-90A6-4AB5-80DD-7918F817AFE7}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {C1E5B831-90A6-4AB5-80DD-7918F817AFE7}.Release|Any CPU.Build.0 = Release|Any CPU 46 | EndGlobalSection 47 | GlobalSection(SolutionProperties) = preSolution 48 | HideSolutionNode = FALSE 49 | EndGlobalSection 50 | EndGlobal 51 | -------------------------------------------------------------------------------- /CodeCrib.AX.TFS/CodeCrib.AX.TFS/AOSService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | using System.Activities; 8 | using Microsoft.TeamFoundation.Build.Client; 9 | using Microsoft.TeamFoundation.Build.Workflow.Activities; 10 | 11 | namespace CodeCrib.AX.TFS 12 | { 13 | [BuildActivity(HostEnvironmentOption.Agent)] 14 | public class StopAOSService : CodeActivity 15 | { 16 | public InArgument ConfigurationFile { get; set; } 17 | public InArgument TimeOutMinutes { get; set; } 18 | 19 | protected override void Execute(CodeActivityContext context) 20 | { 21 | int timeOutMinutes = TimeOutMinutes.Get(context); 22 | string configurationFile = ConfigurationFile.Get(context); 23 | var aosNumber = Helper.GetServerNumber(configurationFile); 24 | 25 | CodeCrib.AX.Manage.AOS aos = new Manage.AOS(aosNumber); 26 | aos.Stop(timeOutMinutes); 27 | } 28 | } 29 | 30 | [BuildActivity(HostEnvironmentOption.Agent)] 31 | public class StartAOSService : CodeActivity 32 | { 33 | public InArgument ConfigurationFile { get; set; } 34 | public InArgument TimeOutMinutes { get; set; } 35 | 36 | protected override void Execute(CodeActivityContext context) 37 | { 38 | int timeOutMinutes = TimeOutMinutes.Get(context); 39 | string configurationFile = ConfigurationFile.Get(context); 40 | var aosNumber = Helper.GetServerNumber(configurationFile); 41 | 42 | CodeCrib.AX.Manage.AOS aos = new Manage.AOS(aosNumber); 43 | aos.Start(timeOutMinutes); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /CodeCrib.AX.TFS/CodeCrib.AX.TFS/AXBuild.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using Microsoft.TeamFoundation.Build.Client; 8 | using Microsoft.TeamFoundation.Build.Workflow.Activities; 9 | using System; 10 | using System.Activities; 11 | using System.IO; 12 | using System.Diagnostics; 13 | using System.Management; 14 | 15 | namespace CodeCrib.AX.TFS 16 | { 17 | [BuildActivity(HostEnvironmentOption.Agent)] 18 | public class AXBuildCompile : AsyncCodeActivity 19 | { 20 | public InArgument TimeOutMinutes { get; set; } 21 | public InArgument Workers { get; set; } 22 | public InArgument ConfigurationFile { get; set; } 23 | public InArgument AlternateBinaryFolder { get; set; } 24 | 25 | protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state) 26 | { 27 | int timeOutMinutes = TimeOutMinutes.Get(context); 28 | 29 | AXBuild.Commands.Compile compile = new AXBuild.Commands.Compile() 30 | { 31 | Workers = Workers.Get(context), 32 | LogPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())).FullName 33 | }; 34 | 35 | string configurationFile = ConfigurationFile.Get(context); 36 | string serverBinPath = Helper.GetServerConfig(configurationFile).AlternateBinDirectory; 37 | 38 | if (string.IsNullOrEmpty(serverBinPath)) 39 | { 40 | throw new Exception("Could not determine server binaries path"); 41 | } 42 | 43 | string altBin = AlternateBinaryFolder.Get(context); 44 | if (string.IsNullOrEmpty(altBin)) 45 | { 46 | altBin = Helper.GetClientConfig(configurationFile).BinaryDirectory; 47 | } 48 | 49 | compile.Compiler = Path.Combine(serverBinPath, "Ax32Serv.exe"); 50 | compile.AOSInstance = Helper.GetServerNumber(configurationFile).ToString("D2"); 51 | compile.AltBinDir = altBin; 52 | 53 | context.TrackBuildMessage("Compiling application using AXBuild", BuildMessageImportance.Normal); 54 | Process process = AXBuild.AXBuild.StartCommand(serverBinPath, compile); 55 | 56 | Func processWaitDelegate = new Func(CommandContext.WaitForProcess); 57 | context.UserState = new CommandContext { Delegate = processWaitDelegate, Process = process, AutoRun = null, AutoRunFile = null, LogFile = Path.Combine(compile.LogPath, "AxCompileAll.html") }; 58 | return processWaitDelegate.BeginInvoke(process.Id, timeOutMinutes, callback, state); 59 | } 60 | 61 | protected override void Cancel(AsyncCodeActivityContext context) 62 | { 63 | CommandContext userState = context.UserState as CommandContext; 64 | 65 | if (userState != null && userState.Process != null) 66 | { 67 | // Kill the AxBuild process 68 | int processId = userState.Process.Id; 69 | userState.Process.Kill(); 70 | 71 | // Find all Ax32Serv.exe sub-processes of the AxBuild 72 | using (var mos = new ManagementObjectSearcher(string.Format("SELECT ProcessId, Name FROM Win32_Process WHERE ParentProcessId = {0}", processId))) 73 | { 74 | foreach (var obj in mos.Get()) 75 | { 76 | string processName = (string)obj.Properties["Name"].Value; 77 | if (processName == "Ax32Serv.exe") 78 | { 79 | UInt32 pid = (UInt32)obj.Properties["ProcessId"].Value; 80 | if (pid != 0) 81 | { 82 | Process subProcess = Process.GetProcessById(Convert.ToInt32(pid)); 83 | if (!subProcess.HasExited) 84 | subProcess.Kill(); 85 | } 86 | } 87 | } 88 | } 89 | 90 | if (File.Exists(userState.LogFile)) 91 | File.Delete(userState.LogFile); 92 | } 93 | 94 | if (context.IsCancellationRequested) 95 | { 96 | context.MarkCanceled(); 97 | } 98 | } 99 | 100 | protected override void EndExecute(AsyncCodeActivityContext context, IAsyncResult result) 101 | { 102 | CommandContext userState = context.UserState as CommandContext; 103 | 104 | if (userState != null) 105 | { 106 | Func processWaitDelegate = userState.Delegate; 107 | Exception processWaitException = processWaitDelegate.EndInvoke(result); 108 | 109 | if (processWaitException != null) 110 | throw processWaitException; 111 | 112 | Client.CompileOutput output = null; 113 | 114 | try 115 | { 116 | output = Client.CompileOutput.CreateFromFile(userState.LogFile); 117 | } 118 | catch (FileNotFoundException) 119 | { 120 | throw new Exception("Compile log could not be found"); 121 | } 122 | catch (Exception ex) 123 | { 124 | throw new Exception(string.Format("Error parsing compile log: {0}", ex.Message)); 125 | } 126 | 127 | Helper.ReportCompileMessages(context, output); 128 | } 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /CodeCrib.AX.TFS/CodeCrib.AX.TFS/Clean.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | 13 | using System.Activities; 14 | using Microsoft.TeamFoundation.Build.Client; 15 | using Microsoft.TeamFoundation.Build.Workflow.Activities; 16 | using System.IO; 17 | 18 | namespace CodeCrib.AX.TFS 19 | { 20 | [BuildActivity(HostEnvironmentOption.Agent)] 21 | public class Clean : CodeActivity 22 | { 23 | public InArgument ConfigurationFile { get; set; } 24 | 25 | public InArgument LeaveXppIL { get; set; } 26 | 27 | private void CleanFolder(string path, string filePattern) 28 | { 29 | if (System.IO.Directory.Exists(path)) 30 | { 31 | IEnumerable files = System.IO.Directory.EnumerateFiles(path, filePattern); 32 | foreach (string file in files) 33 | { 34 | System.IO.File.SetAttributes(file, FileAttributes.Normal); 35 | System.IO.File.Delete(file); 36 | } 37 | } 38 | } 39 | 40 | private void CleanFolders(string path, string pathPattern, string filePattern) 41 | { 42 | if (System.IO.Directory.Exists(path)) 43 | { 44 | IEnumerable folders = System.IO.Directory.EnumerateDirectories(path, pathPattern); 45 | foreach (string folder in folders) 46 | { 47 | CleanFolder(folder, filePattern); 48 | } 49 | } 50 | } 51 | 52 | protected override void Execute(CodeActivityContext context) 53 | { 54 | bool leaveXppIL = LeaveXppIL.Get(context); 55 | string configurationFile = ConfigurationFile.Get(context); 56 | var serverConfig = Helper.GetServerConfig(configurationFile); 57 | 58 | context.TrackBuildMessage("Cleaning server label artifacts"); 59 | CleanFolder(string.Format(@"{0}\Application\Appl\Standard", serverConfig.AlternateBinDirectory), "ax*.al?"); 60 | 61 | if (!leaveXppIL) 62 | { 63 | context.TrackBuildMessage("Cleaning server XppIL artifacts"); 64 | CleanFolder(string.Format(@"{0}\XppIL", serverConfig.AlternateBinDirectory), "*"); 65 | } 66 | 67 | context.TrackBuildMessage("Cleaning server VSAssemblies artifacts"); 68 | CleanFolder(string.Format(@"{0}\VSAssemblies", serverConfig.AlternateBinDirectory), "*"); 69 | 70 | context.TrackBuildMessage("Cleaning client cache artifacts"); 71 | CleanFolder(System.Environment.GetEnvironmentVariable("localappdata"), "ax_*.auc"); 72 | CleanFolder(System.Environment.GetEnvironmentVariable("localappdata"), "ax*.kti"); 73 | 74 | context.TrackBuildMessage("Cleaning client VSAssemblies artifacts"); 75 | CleanFolders(string.Format(@"{0}\{1}", System.Environment.GetEnvironmentVariable("localappdata"), @"Microsoft\Dynamics Ax"), "VSAssemblies*", "*"); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /CodeCrib.AX.TFS/CodeCrib.AX.TFS/CodeCrib.AX.TFS.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {F622C66F-77C0-4965-B9CD-3871BC9EB71B} 8 | Library 9 | Properties 10 | CodeCrib.AX.TFS 11 | CodeCrib.AX.TFS 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | False 35 | 36 | 37 | False 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | {c1e5b831-90a6-4ab5-80dd-7918f817afe7} 68 | CodeCrib.AX.AXBuild 69 | 70 | 71 | {9f793fc4-3616-44fa-8ced-6475c840be00} 72 | CodeCrib.AX.Client 73 | 74 | 75 | {e84f034b-0fea-49a6-8cba-b801cb494533} 76 | CodeCrib.AX.Config 77 | 78 | 79 | {9696d89c-9df8-43d0-b870-cbd4cabc8ba1} 80 | CodeCrib.AX.Manage 81 | 82 | 83 | {5d785ef3-abf3-4038-8711-de346d55c5d3} 84 | CodeCrib.AX.Sql 85 | 86 | 87 | 88 | 95 | -------------------------------------------------------------------------------- /CodeCrib.AX.TFS/CodeCrib.AX.TFS/CombineXPOs.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | 13 | using System.Activities; 14 | using Microsoft.TeamFoundation.Build.Client; 15 | using Microsoft.TeamFoundation.Build.Workflow.Activities; 16 | 17 | namespace CodeCrib.AX.TFS 18 | { 19 | [BuildActivity(HostEnvironmentOption.Agent)] 20 | public class CombineXPOs : CodeActivity 21 | { 22 | [RequiredArgument] 23 | public InArgument Folder { get; set; } 24 | public InArgument Recursive { get; set; } 25 | 26 | [RequiredArgument] 27 | public InArgument CombinedXPOFile { get; set; } 28 | 29 | public InArgument IncludeSystemObjects { get; set; } 30 | public InArgument IncludeNonSystemObjects { get; set; } 31 | 32 | protected override void Execute(CodeActivityContext context) 33 | { 34 | string folder = Folder.Get(context); 35 | bool recursive = Recursive.Get(context); 36 | string combinedXPOFile = CombinedXPOFile.Get(context); 37 | bool includeSystemObjects = IncludeSystemObjects.Get(context); 38 | bool includeNonSystemObjects = IncludeNonSystemObjects.Get(context); 39 | 40 | if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(combinedXPOFile))) 41 | System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(combinedXPOFile)); 42 | 43 | if (includeNonSystemObjects && includeSystemObjects) 44 | CodeCrib.AX.Client.CombineXPOs.Combine(folder, recursive, combinedXPOFile, Client.CombineXPOs.IncludeObjects.AllObjects); 45 | else if (includeNonSystemObjects && !includeSystemObjects) 46 | CodeCrib.AX.Client.CombineXPOs.Combine(folder, recursive, combinedXPOFile, Client.CombineXPOs.IncludeObjects.ExcludeSystemObjects); 47 | else if (!includeNonSystemObjects && includeSystemObjects) 48 | CodeCrib.AX.Client.CombineXPOs.Combine(folder, recursive, combinedXPOFile, Client.CombineXPOs.IncludeObjects.SystemObjectsOnly); 49 | // else neither 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /CodeCrib.AX.TFS/CodeCrib.AX.TFS/CopyReferences.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | 13 | using System.Activities; 14 | using Microsoft.TeamFoundation.Build.Client; 15 | using Microsoft.TeamFoundation.Build.Workflow.Activities; 16 | using System.IO; 17 | 18 | namespace CodeCrib.AX.TFS 19 | { 20 | [BuildActivity(HostEnvironmentOption.Agent)] 21 | public class DeployReferences : CodeActivity 22 | { 23 | public InArgument ConfigurationFile { get; set; } 24 | [RequiredArgument] 25 | public InArgument ReferencesFolder { get; set; } 26 | 27 | protected override void Execute(CodeActivityContext context) 28 | { 29 | string configurationFile = ConfigurationFile.Get(context); 30 | var serverConfig = Helper.GetServerConfig(configurationFile); 31 | string sourcePath = ReferencesFolder.Get(context); 32 | 33 | context.TrackBuildMessage("Deploying references to client and server"); 34 | 35 | if (System.IO.Directory.Exists(sourcePath)) 36 | { 37 | string clientBasePath = string.Format(@"{0}\Microsoft\Dynamics Ax", System.Environment.GetEnvironmentVariable("localappdata")); 38 | IEnumerable folders = System.IO.Directory.EnumerateDirectories(clientBasePath, "VSAssemblies*"); 39 | string serverPath = string.Format(@"{0}\VSAssemblies", serverConfig.AlternateBinDirectory); 40 | 41 | if (!System.IO.Directory.Exists(serverPath)) 42 | System.IO.Directory.CreateDirectory(serverPath); 43 | 44 | IEnumerable files = System.IO.Directory.EnumerateFiles(sourcePath, "*"); 45 | foreach (string file in files) 46 | { 47 | foreach (string folder in folders) 48 | { 49 | System.IO.File.Copy(file, string.Format(@"{0}\{1}", folder, System.IO.Path.GetFileName(file))); 50 | } 51 | System.IO.File.Copy(file, string.Format(@"{0}\{1}", serverPath, System.IO.Path.GetFileName(file))); 52 | } 53 | } 54 | else 55 | { 56 | context.TrackBuildWarning(string.Format("Folder '{0}' containing reference files does not exist", sourcePath)); 57 | } 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /CodeCrib.AX.TFS/CodeCrib.AX.TFS/Database.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | 13 | using System.Activities; 14 | using Microsoft.TeamFoundation.Build.Client; 15 | using Microsoft.TeamFoundation.Build.Workflow.Activities; 16 | 17 | namespace CodeCrib.AX.TFS 18 | { 19 | [BuildActivity(HostEnvironmentOption.Agent)] 20 | public class RestoreDb : CodeActivity 21 | { 22 | public InArgument ServerName { get; set; } 23 | [RequiredArgument] 24 | public InArgument DatabaseName { get; set; } 25 | [RequiredArgument] 26 | public InArgument BackupFilePath { get; set; } 27 | public InArgument ConfigurationFile { get; set; } 28 | 29 | protected override void Execute(CodeActivityContext context) 30 | { 31 | string serverName = ServerName.Get(context); 32 | string databaseName = DatabaseName.Get(context); 33 | string backupFilePath = BackupFilePath.Get(context); 34 | string configurationFile = ConfigurationFile.Get(context); 35 | 36 | if (string.IsNullOrEmpty(serverName)) 37 | { 38 | var serverConfig = Helper.GetServerConfig(configurationFile); 39 | serverName = serverConfig.DatabaseServer; 40 | } 41 | 42 | context.TrackBuildMessage(String.Format("Restoring database {0} on server {1} from file {2}", databaseName, serverName, backupFilePath)); 43 | 44 | Sql.DbManagement.RestoreDbFromFile(serverName, databaseName, backupFilePath); 45 | 46 | context.TrackBuildMessage("Database restore complete"); 47 | } 48 | } 49 | 50 | [BuildActivity(HostEnvironmentOption.Agent)] 51 | public class BackupDb : CodeActivity 52 | { 53 | public InArgument ServerName { get; set; } 54 | [RequiredArgument] 55 | public InArgument DatabaseName { get; set; } 56 | [RequiredArgument] 57 | public InArgument BackupFilePath { get; set; } 58 | public InArgument OverwriteBackupSets { get; set; } 59 | public InArgument ForceCompressionOn { get; set; } 60 | public InArgument ConfigurationFile { get; set; } 61 | 62 | protected override void Execute(CodeActivityContext context) 63 | { 64 | string serverName = ServerName.Get(context); 65 | string databaseName = DatabaseName.Get(context); 66 | string backupFilePath = BackupFilePath.Get(context); 67 | bool overwriteBackupSets = OverwriteBackupSets.Get(context); 68 | bool forceCompressionOn = ForceCompressionOn.Get(context); 69 | string configurationFile = ConfigurationFile.Get(context); 70 | 71 | if (string.IsNullOrEmpty(serverName)) 72 | { 73 | var serverConfig = Helper.GetServerConfig(configurationFile); 74 | serverName = serverConfig.DatabaseServer; 75 | } 76 | 77 | context.TrackBuildMessage(String.Format("Backing up database {0} from server {1} to file {2}", databaseName, serverName, backupFilePath)); 78 | 79 | Sql.DbManagement.BackupDbToFile(serverName, databaseName, backupFilePath, true, overwriteBackupSets, forceCompressionOn); 80 | 81 | context.TrackBuildMessage("Database backup complete"); 82 | } 83 | } 84 | 85 | [BuildActivity(HostEnvironmentOption.Agent)] 86 | public class ResetAdmin : CodeActivity 87 | { 88 | public InArgument ConfigurationFile { get; set; } 89 | 90 | protected override void Execute(CodeActivityContext context) 91 | { 92 | string configurationFile = ConfigurationFile.Get(context); 93 | var serverConfig = CodeCrib.AX.Deploy.Configs.GetServerConfig(configurationFile); 94 | string serverName = serverConfig.DatabaseServer; 95 | string databaseName = serverConfig.Database; 96 | 97 | context.TrackBuildMessage(String.Format("Resetting admin on database {0} on server {1}", databaseName, serverName)); 98 | 99 | Sql.DbManagement.ResetAdminUser(serverName, databaseName); 100 | } 101 | } 102 | 103 | [BuildActivity(HostEnvironmentOption.Agent)] 104 | public class DisableCustomerExperience : CodeActivity 105 | { 106 | public InArgument ConfigurationFile { get; set; } 107 | 108 | protected override void Execute(CodeActivityContext context) 109 | { 110 | string configurationFile = ConfigurationFile.Get(context); 111 | var serverConfig = CodeCrib.AX.Deploy.Configs.GetServerConfig(configurationFile); 112 | string serverName = serverConfig.DatabaseServer; 113 | string databaseName = serverConfig.Database; 114 | 115 | context.TrackBuildMessage(String.Format("Disable customer experience dialog on database {0} on server {1}", databaseName, serverName)); 116 | 117 | Sql.DbManagement.DisableCustomerExperienceDialog(serverName, databaseName); 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /CodeCrib.AX.TFS/CodeCrib.AX.TFS/GenerateCIL.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | 9 | using System.Activities; 10 | using Microsoft.TeamFoundation.Build.Client; 11 | using Microsoft.TeamFoundation.Build.Workflow.Activities; 12 | using System.IO; 13 | using System.Diagnostics; 14 | 15 | namespace CodeCrib.AX.TFS 16 | { 17 | [BuildActivity(HostEnvironmentOption.Agent)] 18 | public class GenerateCIL : AsyncCodeActivity 19 | { 20 | public InArgument ClientExecutablePath { get; set; } 21 | 22 | public InArgument TimeOutMinutes { get; set; } 23 | 24 | public InArgument ConfigurationFile { get; set; } 25 | 26 | protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state) 27 | { 28 | int timeOutMinutes = TimeOutMinutes.Get(context); 29 | string clientExePath = ClientExecutablePath.Get(context); 30 | string configurationFile = ConfigurationFile.Get(context); 31 | 32 | context.TrackBuildMessage("Generating CIL."); 33 | 34 | Client.Commands.GenerateCIL compile = new Client.Commands.GenerateCIL() 35 | { 36 | Minimize = true, 37 | LazyClassLoading = true, 38 | LazyTableLoading = true 39 | }; 40 | 41 | if (!string.IsNullOrEmpty(configurationFile)) 42 | { 43 | compile.ConfigurationFile = configurationFile; 44 | } 45 | 46 | Process process = null; 47 | if (string.IsNullOrEmpty(clientExePath)) 48 | process = Client.Client.StartCommand(compile); 49 | else 50 | process = Client.Client.StartCommand(clientExePath, compile); 51 | 52 | var alternateBinDirectory = Helper.GetServerConfig(configurationFile).AlternateBinDirectory; 53 | 54 | Func processWaitDelegate = new Func(CommandContext.WaitForProcess); 55 | context.UserState = new CommandContext { Delegate = processWaitDelegate, Process = process, AutoRun = null, AutoRunFile = null, LogFile = string.Format(@"{0}\XppIL\Dynamics.Ax.Application.dll.log", Environment.ExpandEnvironmentVariables(alternateBinDirectory)) }; 56 | return processWaitDelegate.BeginInvoke(process.Id, timeOutMinutes, callback, state); 57 | } 58 | 59 | protected override void Cancel(AsyncCodeActivityContext context) 60 | { 61 | CommandContext userState = context.UserState as CommandContext; 62 | 63 | if (userState != null && userState.Process != null) 64 | { 65 | userState.Process.Kill(); 66 | 67 | if (File.Exists(userState.LogFile)) 68 | File.Delete(userState.LogFile); 69 | } 70 | 71 | if (context.IsCancellationRequested) 72 | { 73 | context.MarkCanceled(); 74 | } 75 | } 76 | 77 | protected override void EndExecute(AsyncCodeActivityContext context, IAsyncResult result) 78 | { 79 | CommandContext userState = context.UserState as CommandContext; 80 | 81 | if (userState != null) 82 | { 83 | Func processWaitDelegate = userState.Delegate; 84 | Exception processWaitException = processWaitDelegate.EndInvoke(result); 85 | 86 | if (processWaitException != null) 87 | throw processWaitException; 88 | 89 | Client.CILGenerationOutput output = null; 90 | try 91 | { 92 | output = Client.CILGenerationOutput.CreateFromFile(userState.LogFile); 93 | } 94 | catch (FileNotFoundException) 95 | { 96 | throw new Exception("CIL generation log could not be found"); 97 | } 98 | catch (Exception ex) 99 | { 100 | throw new Exception(string.Format("Error parsing CIL generation log: {0}", ex.Message)); 101 | } 102 | 103 | bool hasErrors = false; 104 | foreach (var item in output.Output) 105 | { 106 | string compileMessage; 107 | 108 | if (item.LineNumber > 0) 109 | compileMessage = string.Format("Object {0} method {1}, line {2} : {3}", item.ElementName, item.MethodName, item.LineNumber, item.Message); 110 | else 111 | compileMessage = string.Format("Object {0} method {1} : {2}", item.ElementName, item.MethodName, item.Message); 112 | 113 | switch (item.Severity) 114 | { 115 | // Compile Errors 116 | case 0: 117 | context.TrackBuildError(compileMessage); 118 | hasErrors = true; 119 | break; 120 | // Compile Warnings 121 | case 1: 122 | context.TrackBuildWarning(compileMessage); 123 | break; 124 | // "Other" 125 | case 4: 126 | default: 127 | context.TrackBuildMessage(item.Message); 128 | break; 129 | } 130 | } 131 | if (hasErrors) 132 | throw new Exception("CIL error(s) found"); 133 | } 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /CodeCrib.AX.TFS/CodeCrib.AX.TFS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CodeCrib.AX.TFS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CodeCrib.AX.TFS")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ff9f106c-15c7-4976-b6ff-30ecaf810380")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.9.1.0")] 36 | [assembly: AssemblyFileVersion("0.9.1.0")] 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.TFS/CodeCrib.AX.TFS/SetAOSDatabase.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | 12 | using System.Activities; 13 | using Microsoft.TeamFoundation.Build.Client; 14 | using Microsoft.TeamFoundation.Build.Workflow.Activities; 15 | 16 | namespace CodeCrib.AX.TFS 17 | { 18 | public class SetAOSDatabase : CodeActivity 19 | { 20 | public InArgument ConfigurationFile { get; set; } 21 | [RequiredArgument] 22 | public InArgument Database { get; set; } 23 | 24 | protected override void Execute(CodeActivityContext context) 25 | { 26 | string configurationFile = ConfigurationFile.Get(context); 27 | string database = Database.Get(context); 28 | 29 | var serverConfig = Helper.GetServerConfig(configurationFile); 30 | 31 | serverConfig.Database = database; 32 | 33 | CodeCrib.AX.Config.Server.SaveConfigToRegistry(serverConfig.AOSNumberOrigin, serverConfig); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /CodeCrib.AX.TFS/CodeCrib.AX.TFS/XPOLabelCheck.cs: -------------------------------------------------------------------------------- 1 | //This C# code file was released under the Ms-PL license 2 | //http://www.opensource.org/licenses/ms-pl.html 3 | //This script was originally intended for use with Microsoft Dynamics AX 4 | //and maintained and distributed as a project on CodePlex 5 | //http://dynamicsaxadmin.codeplex.com 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | 13 | using System.Activities; 14 | using Microsoft.TeamFoundation.Build.Client; 15 | using Microsoft.TeamFoundation.Build.Workflow.Activities; 16 | 17 | namespace CodeCrib.AX.TFS 18 | { 19 | [BuildActivity(HostEnvironmentOption.Agent)] 20 | public class XPOLabelCheck : CodeActivity 21 | { 22 | [RequiredArgument] 23 | public InArgument Folder { get; set; } 24 | public InArgument Recursive { get; set; } 25 | 26 | protected override void Execute(CodeActivityContext context) 27 | { 28 | string folder = Folder.Get(context); 29 | bool recursive = Recursive.Get(context); 30 | 31 | var xpoList = Client.XPOLabelCheck.FindTempLabels(folder, recursive); 32 | foreach (var xpo in xpoList) 33 | { 34 | // Tracking error without exception will cause "partially succeeded" 35 | context.TrackBuildError(string.Format("Temporary label(s) found in XPO {0}", xpo)); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Joris de Gruyter 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dynamics AX Admin 2 | 3 | This project and the utilities within will help you automate multiple facets of your Microsoft Dynamics AX 2012 installation. Each project comes with a class library that contains all the functionality, and PowerShell cmdlets supporting pipeline as well as WPF sample apps that wrap that functionality. Use PowerShell, the GUI, or use the class libraries in your own projects. 4 | 5 | - The **Setup** utilities help you with silent mode installations, by managing the parameter files and passing them to the setup utility of Dynamics AX 2012 6 | - The **Config** utilities help you manage client and server configurations both in configuration files and registry settings. 7 | - The **Manage** utilities help you manage the object server service (stop/start) and manage the model store 8 | - The **Client** utilities help you automate client commands, such as compiling, synchronizing, generating CIL, AutoRun scripts, and much more 9 | - The **SQL** utilities help you restore an AX database and reset the global guid 10 | - The **AXBuild** utilities help you automate the axbuild commands (AX 2012 CU7 or higher) 11 | - The **TFS** custom XAML workflow activities wrap all the above utilities into custom workflow activities for use in automated builds in TFS 12 | --------------------------------------------------------------------------------